From 065f4fe8456f3f15826840517426c504ab0d0f30 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Mon, 24 Jun 2024 14:23:37 -0700 Subject: [PATCH 01/43] First bit of including Adel's SBMLNetwork. --- CMakeLists.txt | 21 +++++++++++++++++++++ src/module-sbml.cpp | 5 +++++ src/sbmlx.cpp | 1 + 3 files changed, 27 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf7fc49d..b2be5b1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,6 +338,27 @@ if(WITH_LIBSBML_COMPRESSION) set(LIBANTIMONY_LIBS ${LIBANTIMONY_LIBS} ${BZIP_LIBRARY} ) endif() +if(WITH_SBML) + find_library(SBMLNETWORK_LIBRARY + NAMES libsbmlnetwork-static.lib sbmlnetwork-static.lib libsbmlnetwork-static sbmlnetwork-static + PATHS /usr/lib /usr/local/lib + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dependencies/lib + ${LIBSBML_INCLUDE_DIR}/../lib + ) + set(LIBANTIMONY_LIBS ${LIBANTIMONY_LIBS} ${SBMLNETWORK_LIBRARY} ) + + find_path(SBMLNETWORK_INCLUDE_DIR + NAMES libsbmlnetwork_common.h + PATHS /usr/include /usr/local/include ${LIBSBML_DEPENDENCY_DIR}/include + DOC "The directory containing the SBMLNetwork include files." + ) + + INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${SBMLNETWORK_INCLUDE_DIR} ) +endif() + +message(STATUS "Antimony libs: ${LIBANTIMONY_LIBS}") + ############################################################################### # # If WITH_SWIG is selected, we need to find swig diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 93d7f2a1..647d9e0a 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -1,5 +1,6 @@ #include "module.h" #include "sbml/Model.h" +#include "libsbmlnetwork_sbmldocument.h" using namespace libsbml; @@ -2438,6 +2439,10 @@ void Module::CreateSBMLModel(bool comp) FixPortReferencesIn(sbmlmod); } #endif //USE_COMP + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml); + //LIBSBMLNETWORK_CPP_NAMESPACE::updateLayoutCurves(&m_sbml, NULL); + LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); + //compareChar('b', 'c'); } void Module::SetAssignmentFor(Model* sbmlmod, const Variable* var, const map& syncmap, bool comp, set > referencedVars) diff --git a/src/sbmlx.cpp b/src/sbmlx.cpp index bc5752a6..27580761 100644 --- a/src/sbmlx.cpp +++ b/src/sbmlx.cpp @@ -15,6 +15,7 @@ extern bool CaselessStrCmp(bool caseless, const string& lhs, const string& rhs); #ifndef NSBML #include "sbmlx.h" #include "sbml/math/FormulaFormatter.h" +#include "libsbmlnetwork_sbmldocument.h" #if LIBSBML_VERSION >= 50900 #include "sbml/math/L3FormulaFormatter.h" #endif From cbad899ca874094726f3feac2fbce2a00d1655d0 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 28 Jun 2024 12:17:04 -0700 Subject: [PATCH 02/43] Let the user set stuff. (Most of it isn't used yet, but at least it's stored.) --- src/antimony.tab.cpp | 2808 +++++++++++++++++++++++------------------- src/antimony.ypp | 166 ++- src/module-sbml.cpp | 11 +- src/module.cpp | 362 ++++++ src/module.h | 41 + 5 files changed, 2107 insertions(+), 1281 deletions(-) diff --git a/src/antimony.tab.cpp b/src/antimony.tab.cpp index b516f459..a8f4b945 100644 --- a/src/antimony.tab.cpp +++ b/src/antimony.tab.cpp @@ -226,12 +226,13 @@ union ANTIMONY_YYSTYPE Variable* varmaybeis; Variable* maybein; Variable* unitdef; - bool maybemain; bool maxormin; constraint_type inequality; std::vector* stringlist; + std::vector variablelist; + std::vector numlist; -#line 235 "antimony.tab.cpp" +#line 236 "antimony.tab.cpp" }; typedef union ANTIMONY_YYSTYPE ANTIMONY_YYSTYPE; @@ -313,83 +314,88 @@ enum yysymbol_kind_t YYSYMBOL_59_ = 59, /* '=' */ YYSYMBOL_60_ = 60, /* ':' */ YYSYMBOL_61_ = 61, /* '\'' */ - YYSYMBOL_62_ = 62, /* ';' */ - YYSYMBOL_63_ = 63, /* '{' */ - YYSYMBOL_64_ = 64, /* '}' */ - YYSYMBOL_65_ = 65, /* '!' */ - YYSYMBOL_66_ = 66, /* '<' */ - YYSYMBOL_67_ = 67, /* '>' */ - YYSYMBOL_68_n_ = 68, /* '\n' */ - YYSYMBOL_YYACCEPT = 69, /* $accept */ - YYSYMBOL_input = 70, /* input */ - YYSYMBOL_import = 71, /* import */ - YYSYMBOL_module = 72, /* module */ - YYSYMBOL_73_1 = 73, /* $@1 */ - YYSYMBOL_74_2 = 74, /* $@2 */ - YYSYMBOL_maybemain = 75, /* maybemain */ - YYSYMBOL_function = 76, /* function */ + YYSYMBOL_62_ = 62, /* '[' */ + YYSYMBOL_63_ = 63, /* ']' */ + YYSYMBOL_64_n_ = 64, /* '\n' */ + YYSYMBOL_65_ = 65, /* ';' */ + YYSYMBOL_66_ = 66, /* '{' */ + YYSYMBOL_67_ = 67, /* '}' */ + YYSYMBOL_68_ = 68, /* '!' */ + YYSYMBOL_69_ = 69, /* '<' */ + YYSYMBOL_70_ = 70, /* '>' */ + YYSYMBOL_YYACCEPT = 71, /* $accept */ + YYSYMBOL_input = 72, /* input */ + YYSYMBOL_import = 73, /* import */ + YYSYMBOL_module = 74, /* module */ + YYSYMBOL_75_1 = 75, /* $@1 */ + YYSYMBOL_76_2 = 76, /* $@2 */ YYSYMBOL_77_3 = 77, /* $@3 */ - YYSYMBOL_spacedformula = 78, /* spacedformula */ - YYSYMBOL_variableexportlist = 79, /* variableexportlist */ - YYSYMBOL_variable = 80, /* variable */ - YYSYMBOL_variablein = 81, /* variablein */ - YYSYMBOL_varmaybein = 82, /* varmaybein */ - YYSYMBOL_varmaybeis = 83, /* varmaybeis */ - YYSYMBOL_maybein = 84, /* maybein */ - YYSYMBOL_modulebody = 85, /* modulebody */ - YYSYMBOL_moduleannotation = 86, /* moduleannotation */ - YYSYMBOL_modulepart = 87, /* modulepart */ - YYSYMBOL_reaction = 88, /* reaction */ - YYSYMBOL_reactantList = 89, /* reactantList */ - YYSYMBOL_reactionDivider = 90, /* reactionDivider */ - YYSYMBOL_formula = 91, /* formula */ - YYSYMBOL_commaformula = 92, /* commaformula */ - YYSYMBOL_mathThing = 93, /* mathThing */ - YYSYMBOL_inequality = 94, /* inequality */ - YYSYMBOL_lineend = 95, /* lineend */ - YYSYMBOL_assignment = 96, /* assignment */ - YYSYMBOL_algrule = 97, /* algrule */ - YYSYMBOL_submodule = 98, /* submodule */ - YYSYMBOL_99_4 = 99, /* $@4 */ - YYSYMBOL_100_5 = 100, /* $@5 */ - YYSYMBOL_variableimportlist = 101, /* variableimportlist */ - YYSYMBOL_submodifications = 102, /* submodifications */ - YYSYMBOL_varinitialize = 103, /* varinitialize */ - YYSYMBOL_specinit = 104, /* specinit */ - YYSYMBOL_formulainit = 105, /* formulainit */ - YYSYMBOL_reactioninit = 106, /* reactioninit */ - YYSYMBOL_dnainit = 107, /* dnainit */ - YYSYMBOL_geneinit = 108, /* geneinit */ - YYSYMBOL_operatorinit = 109, /* operatorinit */ - YYSYMBOL_compartmentinit = 110, /* compartmentinit */ - YYSYMBOL_varconstinit = 111, /* varconstinit */ - YYSYMBOL_unitinit = 112, /* unitinit */ - YYSYMBOL_dnadef = 113, /* dnadef */ - YYSYMBOL_dnastrand = 114, /* dnastrand */ - YYSYMBOL_dnamiddle = 115, /* dnamiddle */ - YYSYMBOL_event = 116, /* event */ - YYSYMBOL_117_6 = 117, /* $@6 */ - YYSYMBOL_118_7 = 118, /* $@7 */ - YYSYMBOL_119_8 = 119, /* $@8 */ - YYSYMBOL_120_9 = 120, /* $@9 */ - YYSYMBOL_colonret = 121, /* colonret */ - YYSYMBOL_eventmodifications = 122, /* eventmodifications */ - YYSYMBOL_assignmentlist = 123, /* assignmentlist */ - YYSYMBOL_deletion = 124, /* deletion */ - YYSYMBOL_unitdef = 125, /* unitdef */ - YYSYMBOL_constraint = 126, /* constraint */ - YYSYMBOL_objective = 127, /* objective */ - YYSYMBOL_maxormin = 128, /* maxormin */ - YYSYMBOL_stringlist = 129, /* stringlist */ - YYSYMBOL_annotationBlock = 130, /* annotationBlock */ - YYSYMBOL_131_10 = 131, /* $@10 */ - YYSYMBOL_annotations = 132, /* annotations */ - YYSYMBOL_cvterm = 133, /* cvterm */ - YYSYMBOL_toplevel_sbo = 134, /* toplevel_sbo */ - YYSYMBOL_modulename = 135, /* modulename */ - YYSYMBOL_functionname = 136, /* functionname */ - YYSYMBOL_modulecvterm = 137, /* modulecvterm */ - YYSYMBOL_functioncvterm = 138 /* functioncvterm */ + YYSYMBOL_78_4 = 78, /* $@4 */ + YYSYMBOL_function = 79, /* function */ + YYSYMBOL_80_5 = 80, /* $@5 */ + YYSYMBOL_spacedformula = 81, /* spacedformula */ + YYSYMBOL_variableexportlist = 82, /* variableexportlist */ + YYSYMBOL_variable = 83, /* variable */ + YYSYMBOL_variablein = 84, /* variablein */ + YYSYMBOL_varmaybein = 85, /* varmaybein */ + YYSYMBOL_varmaybeis = 86, /* varmaybeis */ + YYSYMBOL_maybein = 87, /* maybein */ + YYSYMBOL_modulebody = 88, /* modulebody */ + YYSYMBOL_moduleannotation = 89, /* moduleannotation */ + YYSYMBOL_variablelist = 90, /* variablelist */ + YYSYMBOL_numlist = 91, /* numlist */ + YYSYMBOL_modulepart = 92, /* modulepart */ + YYSYMBOL_reaction = 93, /* reaction */ + YYSYMBOL_reactantList = 94, /* reactantList */ + YYSYMBOL_reactionDivider = 95, /* reactionDivider */ + YYSYMBOL_formula = 96, /* formula */ + YYSYMBOL_commaformula = 97, /* commaformula */ + YYSYMBOL_mathThing = 98, /* mathThing */ + YYSYMBOL_inequality = 99, /* inequality */ + YYSYMBOL_lineend = 100, /* lineend */ + YYSYMBOL_assignment = 101, /* assignment */ + YYSYMBOL_algrule = 102, /* algrule */ + YYSYMBOL_submodule = 103, /* submodule */ + YYSYMBOL_104_6 = 104, /* $@6 */ + YYSYMBOL_105_7 = 105, /* $@7 */ + YYSYMBOL_variableimportlist = 106, /* variableimportlist */ + YYSYMBOL_submodifications = 107, /* submodifications */ + YYSYMBOL_varinitialize = 108, /* varinitialize */ + YYSYMBOL_specinit = 109, /* specinit */ + YYSYMBOL_formulainit = 110, /* formulainit */ + YYSYMBOL_reactioninit = 111, /* reactioninit */ + YYSYMBOL_dnainit = 112, /* dnainit */ + YYSYMBOL_geneinit = 113, /* geneinit */ + YYSYMBOL_operatorinit = 114, /* operatorinit */ + YYSYMBOL_compartmentinit = 115, /* compartmentinit */ + YYSYMBOL_varconstinit = 116, /* varconstinit */ + YYSYMBOL_unitinit = 117, /* unitinit */ + YYSYMBOL_dnadef = 118, /* dnadef */ + YYSYMBOL_dnastrand = 119, /* dnastrand */ + YYSYMBOL_dnamiddle = 120, /* dnamiddle */ + YYSYMBOL_event = 121, /* event */ + YYSYMBOL_122_8 = 122, /* $@8 */ + YYSYMBOL_123_9 = 123, /* $@9 */ + YYSYMBOL_124_10 = 124, /* $@10 */ + YYSYMBOL_125_11 = 125, /* $@11 */ + YYSYMBOL_colonret = 126, /* colonret */ + YYSYMBOL_eventmodifications = 127, /* eventmodifications */ + YYSYMBOL_assignmentlist = 128, /* assignmentlist */ + YYSYMBOL_deletion = 129, /* deletion */ + YYSYMBOL_unitdef = 130, /* unitdef */ + YYSYMBOL_constraint = 131, /* constraint */ + YYSYMBOL_objective = 132, /* objective */ + YYSYMBOL_maxormin = 133, /* maxormin */ + YYSYMBOL_stringlist = 134, /* stringlist */ + YYSYMBOL_annotationBlock = 135, /* annotationBlock */ + YYSYMBOL_136_12 = 136, /* $@12 */ + YYSYMBOL_annotations = 137, /* annotations */ + YYSYMBOL_cvterm = 138, /* cvterm */ + YYSYMBOL_toplevel_sbo = 139, /* toplevel_sbo */ + YYSYMBOL_modulename = 140, /* modulename */ + YYSYMBOL_functionname = 141, /* functionname */ + YYSYMBOL_modulecvterm = 142, /* modulecvterm */ + YYSYMBOL_functioncvterm = 143 /* functioncvterm */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -717,16 +723,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1141 +#define YYLAST 1279 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 69 +#define YYNTOKENS 71 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 70 +#define YYNNTS 73 /* YYNRULES -- Number of rules. */ -#define YYNRULES 239 +#define YYNRULES 258 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 457 +#define YYNSTATES 499 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 300 @@ -744,18 +750,18 @@ union yyalloc static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 68, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 64, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 65, 2, 2, 12, 10, 4, 61, + 2, 2, 2, 68, 2, 2, 12, 10, 4, 61, 56, 57, 8, 7, 58, 6, 13, 9, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 60, 62, - 66, 59, 67, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 60, 65, + 69, 59, 70, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, + 2, 62, 2, 63, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 63, 5, 64, 2, 2, 2, 2, + 2, 2, 2, 66, 5, 67, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -780,30 +786,32 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 160, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 175, 178, 178, 184, 184, - 190, 191, 194, 195, 198, 198, 199, 200, 203, 204, - 205, 215, 216, 217, 220, 221, 227, 230, 233, 234, - 237, 238, 239, 240, 241, 244, 245, 248, 249, 250, - 251, 254, 259, 264, 269, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 297, - 305, 313, 321, 329, 337, 347, 348, 349, 350, 351, - 352, 356, 357, 358, 359, 360, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 378, - 379, 382, 383, 384, 385, 386, 387, 388, 391, 392, - 393, 394, 395, 398, 399, 400, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 415, 416, 419, 419, 420, - 420, 424, 425, 426, 427, 428, 432, 433, 437, 441, - 442, 443, 444, 445, 446, 447, 448, 451, 452, 453, - 454, 455, 456, 457, 458, 461, 462, 463, 464, 467, - 468, 469, 470, 473, 474, 475, 476, 479, 480, 481, - 482, 485, 486, 487, 488, 492, 493, 494, 495, 498, - 499, 500, 503, 506, 509, 510, 513, 514, 515, 516, - 517, 520, 521, 524, 524, 525, 525, 526, 526, 527, - 527, 530, 531, 534, 535, 542, 543, 544, 545, 546, - 549, 550, 553, 568, 569, 570, 571, 572, 573, 576, - 579, 580, 583, 584, 585, 587, 587, 590, 591, 596, - 597, 598, 601, 612, 624, 626, 630, 631, 632, 633 + 0, 162, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 178, 181, 181, 187, + 187, 193, 193, 199, 199, 204, 205, 208, 208, 209, + 210, 213, 214, 215, 225, 226, 227, 230, 231, 237, + 240, 243, 244, 247, 248, 249, 250, 251, 254, 255, + 258, 259, 260, 261, 264, 269, 274, 279, 289, 299, + 312, 325, 338, 353, 354, 355, 358, 359, 360, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 379, 387, 395, 403, 411, 419, 429, + 430, 431, 432, 433, 434, 438, 439, 440, 441, 442, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 460, 461, 464, 465, 466, 467, 468, + 469, 470, 473, 474, 475, 476, 477, 480, 481, 482, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 497, + 498, 501, 501, 502, 502, 506, 507, 508, 509, 510, + 514, 515, 519, 523, 524, 525, 526, 527, 528, 529, + 530, 533, 534, 535, 536, 537, 538, 539, 540, 543, + 544, 545, 546, 549, 550, 551, 552, 555, 556, 557, + 558, 561, 562, 563, 564, 567, 568, 569, 570, 574, + 575, 576, 577, 580, 581, 582, 585, 588, 591, 592, + 595, 596, 597, 598, 599, 602, 603, 606, 606, 607, + 607, 608, 608, 609, 609, 612, 613, 616, 617, 624, + 625, 626, 627, 628, 631, 632, 635, 650, 651, 652, + 653, 654, 655, 658, 661, 662, 665, 666, 667, 669, + 669, 672, 673, 678, 679, 680, 683, 694, 704, 714, + 727, 740, 753, 768, 770, 774, 775, 776, 777 }; #endif @@ -833,22 +841,22 @@ static const char *const yytname[] = "\"name of an existing module\"", "\"'model' or 'module'\"", "\"'operator'\"", "\"'reaction'\"", "\"'species'\"", "\"'substanceOnly'\"", "\"text string\"", "\"'unit'\"", "\"'var'\"", - "'('", "')'", "','", "'='", "':'", "'\\''", "';'", "'{'", "'}'", "'!'", - "'<'", "'>'", "'\\n'", "$accept", "input", "import", "module", "$@1", - "$@2", "maybemain", "function", "$@3", "spacedformula", + "'('", "')'", "','", "'='", "':'", "'\\''", "'['", "']'", "'\\n'", "';'", + "'{'", "'}'", "'!'", "'<'", "'>'", "$accept", "input", "import", + "module", "$@1", "$@2", "$@3", "$@4", "function", "$@5", "spacedformula", "variableexportlist", "variable", "variablein", "varmaybein", - "varmaybeis", "maybein", "modulebody", "moduleannotation", "modulepart", - "reaction", "reactantList", "reactionDivider", "formula", "commaformula", - "mathThing", "inequality", "lineend", "assignment", "algrule", - "submodule", "$@4", "$@5", "variableimportlist", "submodifications", - "varinitialize", "specinit", "formulainit", "reactioninit", "dnainit", - "geneinit", "operatorinit", "compartmentinit", "varconstinit", - "unitinit", "dnadef", "dnastrand", "dnamiddle", "event", "$@6", "$@7", - "$@8", "$@9", "colonret", "eventmodifications", "assignmentlist", - "deletion", "unitdef", "constraint", "objective", "maxormin", - "stringlist", "annotationBlock", "$@10", "annotations", "cvterm", - "toplevel_sbo", "modulename", "functionname", "modulecvterm", - "functioncvterm", YY_NULLPTR + "varmaybeis", "maybein", "modulebody", "moduleannotation", + "variablelist", "numlist", "modulepart", "reaction", "reactantList", + "reactionDivider", "formula", "commaformula", "mathThing", "inequality", + "lineend", "assignment", "algrule", "submodule", "$@6", "$@7", + "variableimportlist", "submodifications", "varinitialize", "specinit", + "formulainit", "reactioninit", "dnainit", "geneinit", "operatorinit", + "compartmentinit", "varconstinit", "unitinit", "dnadef", "dnastrand", + "dnamiddle", "event", "$@8", "$@9", "$@10", "$@11", "colonret", + "eventmodifications", "assignmentlist", "deletion", "unitdef", + "constraint", "objective", "maxormin", "stringlist", "annotationBlock", + "$@12", "annotations", "cvterm", "toplevel_sbo", "modulename", + "functionname", "modulecvterm", "functioncvterm", YY_NULLPTR }; static const char * @@ -858,12 +866,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-364) +#define YYPACT_NINF (-393) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-76) +#define YYTABLE_NINF (-90) #define yytable_value_is_error(Yyn) \ 0 @@ -872,129 +880,139 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - -364, 656, -364, -364, 12, 162, -364, 23, 351, -364, - -364, -364, -364, -364, 162, 209, 38, 437, 162, 162, - 162, -364, 162, 218, 115, 162, -17, -364, -364, 215, - 222, 162, 162, 162, 188, 162, 511, -364, -364, -364, - -364, -364, 366, 64, 181, -364, 35, 456, 268, -364, - 35, 35, 35, 35, -14, -2, 5, 62, 138, 144, - 149, 175, 35, 35, -364, 162, 35, 25, 35, 35, - -364, -364, 35, -364, -364, -364, -364, -364, 209, -364, - -364, 44, -364, -364, -364, -364, -364, -364, 44, -364, - -364, -364, 160, 16, -364, 238, -364, -364, -364, 13, - 162, 162, 162, 162, 162, -364, 162, 122, -364, 127, - 162, 44, -364, -364, 229, 199, 220, -364, -364, -364, - -364, -364, 265, 32, 231, -364, -364, -364, -364, 271, - -364, -364, -364, 162, -364, 29, 162, 162, 162, 162, - 162, 162, 162, 284, -364, 290, 99, -364, 162, 44, - 162, -364, 57, -364, 191, 260, -364, 266, 277, 118, - 162, 278, 9, -364, -364, -364, -364, 162, 162, 162, - 162, 162, 162, 162, 162, -364, -364, 241, -364, 162, - -364, -364, -364, 913, -364, -364, 913, 913, 320, 913, - 340, 341, -364, -364, -364, -364, -364, -364, -364, -364, - -364, -364, -364, -364, 289, -364, -364, 44, -364, -364, - -364, -364, -364, 293, 307, 913, 913, -364, -364, -364, - -364, -364, -364, -364, 162, 241, 308, -364, 37, 35, - 312, 311, 332, 37, 35, 291, 318, -364, -364, -364, - -364, -364, -364, -364, -364, -364, 162, -364, 359, 322, - 44, 150, 913, -364, -364, 128, 913, 42, -364, 321, - -364, 232, 456, 268, -364, -364, -364, 162, 278, -364, - 15, -364, -364, -364, -364, -364, -364, -364, -364, -364, - -364, 44, 913, 324, 350, -364, -364, 913, 913, 243, - -364, 55, 134, -364, 913, -364, -364, 913, -364, 376, - -15, -364, -364, 162, 377, 93, -364, -364, -364, 44, - 275, 344, 1073, 913, -364, 102, 162, 162, -364, 785, - -364, 913, 119, 24, 913, 913, 44, 44, 849, -364, - 849, 199, -364, -364, -364, -364, -364, 379, -364, 7, - 913, 913, -364, -364, 348, 285, 44, -364, 35, 37, - -364, 313, 162, 209, 347, 170, 969, -364, -364, -364, - 322, 44, 44, 913, -364, -364, 291, -364, 30, -364, - 162, -364, 849, -364, 322, 134, 913, 345, -364, 47, - -364, -364, 35, 162, -364, -364, -12, -364, 44, 303, - 388, 108, -364, -364, -364, 913, 134, 306, 849, -364, - 849, 44, -364, 7, -364, -364, 34, 913, 35, 44, - 390, -364, 1073, 353, 393, 37, -364, 7, -364, -364, - 849, -364, -364, 913, 721, -364, -364, 35, 356, 1021, - 405, 103, -364, 134, -364, -12, -364, 8, 11, 319, - -364, -364, 35, 37, 7, -364, 162, -364, 162, -364, - -364, 44, -364, -364, -364, -364, -364 + -393, 892, -393, -393, 90, 231, -393, 34, 221, -393, + -393, -393, -393, -393, 231, 232, 169, 353, 231, 231, + 231, -393, 231, 201, 240, 231, -25, -393, -393, 181, + 237, 231, 231, 231, 210, 231, 1227, -393, -393, -393, + -393, -393, 688, 27, 82, -393, -393, 35, 292, 309, + -393, 35, 35, 35, 35, -22, -19, -16, 173, 182, + 222, 234, 258, 35, 35, -393, 231, 35, 55, 35, + 35, -393, -393, 35, -393, -393, -393, -393, -393, 232, + -393, -393, 81, -393, -393, -393, -393, -393, -393, 81, + -393, -393, -393, 589, 1, -393, 245, -393, -393, -393, + 66, 231, 231, 231, 231, 231, -393, 231, 238, -393, + 208, 231, 81, -393, -393, 337, 308, 316, -393, -393, + -393, -393, -393, 360, 105, 326, -393, 364, 366, 154, + -393, -393, -393, -393, -393, 231, -393, 16, 231, 231, + 231, 231, 231, 231, 231, 244, -393, 376, 170, -393, + 231, 81, 231, -393, 196, -393, 1213, 286, -393, 356, + 332, 41, 231, 305, 6, -393, -393, -393, -393, 231, + 231, 231, 231, 231, 231, 231, 231, -393, -393, 220, + -393, 231, -393, -393, -393, 821, -393, -393, 821, 821, + 383, 821, 403, 408, -393, -393, -393, -393, -393, -393, + -393, -393, -393, -393, -393, -393, 355, -393, -393, 81, + -393, -393, -393, -393, -393, 357, 358, 821, 821, -393, + -393, -393, -393, -393, -393, -393, 231, 220, 359, -393, + 131, 35, 367, 32, 402, 131, 35, 351, 369, 88, + 405, 371, 1162, 131, -393, -393, -393, -393, -393, -393, + -393, -393, -393, 231, -393, 411, 374, 81, 199, 821, + -393, -393, 242, 821, 180, -393, 379, -393, 269, 292, + 309, -393, -393, -393, 231, 305, -393, 15, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, 81, 821, + 380, 406, -393, -393, 821, 821, 99, -393, 44, 174, + -393, 821, -393, -393, 821, -393, 424, -37, -393, -393, + 231, 431, 249, 83, -393, -393, -393, 81, 250, 393, + 1162, 434, 262, 167, 231, 232, 399, 312, 946, -393, + -393, -393, 821, -393, 200, 231, 231, -393, 658, -393, + 821, 42, 17, 821, 821, 81, 81, 739, -393, 739, + 308, -393, -393, -393, -393, -393, 442, -393, 13, 821, + 821, -393, -393, 407, 275, 81, 410, -393, -393, 35, + 131, -393, 363, 231, 1000, 416, -393, -393, 35, 131, + 294, 172, -393, -393, -393, -393, 374, 81, 81, 821, + -393, -393, 351, -393, 19, -393, 231, -393, 739, -393, + 374, 174, 821, 417, -393, 95, -393, -393, 35, 231, + 149, -393, -393, 121, -393, 81, 328, -393, 176, -393, + -393, 1162, 821, 174, 341, 739, -393, 739, 81, -393, + 13, -393, -393, 113, 821, 35, 81, -393, -393, 377, + 444, -393, 1162, -393, -393, 377, 1054, -393, 13, -393, + -393, 739, -393, -393, 821, 517, -393, -393, 35, -393, + 81, 252, 278, 420, 1108, 297, 304, -393, 174, -393, + 121, -393, 21, 111, 112, -393, 25, -393, 394, -393, + -393, -393, 13, -393, 231, -393, 231, -393, 231, 81, + -393, 443, -393, 81, -393, -393, -393, 81, -393 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ -static const yytype_uint8 yydefact[] = +static const yytype_int16 yydefact[] = { - 2, 0, 1, 13, 0, 0, 115, 0, 34, 86, - 81, 82, 84, 85, 0, 0, 0, 0, 0, 0, - 0, 14, 0, 0, 0, 0, 0, 220, 221, 0, - 22, 0, 0, 0, 0, 0, 0, 113, 114, 3, - 4, 6, 38, 64, 0, 5, 0, 0, 0, 68, - 0, 0, 0, 0, 139, 140, 141, 142, 143, 144, - 145, 146, 0, 0, 184, 190, 0, 0, 0, 0, - 86, 12, 0, 11, 7, 8, 9, 10, 0, 83, - 34, 36, 111, 112, 109, 86, 108, 110, 76, 86, - 225, 86, 193, 38, 39, 40, 175, 86, 86, 0, - 0, 0, 0, 0, 0, 161, 0, 0, 180, 186, - 187, 210, 163, 155, 0, 0, 0, 24, 27, 26, - 167, 15, 0, 0, 0, 129, 23, 21, 20, 0, - 171, 159, 147, 0, 151, 183, 0, 0, 0, 0, - 0, 0, 0, 0, 179, 0, 34, 191, 0, 77, - 0, 86, 0, 86, 0, 0, 55, 0, 0, 0, - 0, 75, 0, 56, 67, 57, 58, 0, 0, 0, - 0, 0, 0, 0, 0, 61, 59, 188, 60, 0, - 62, 65, 66, 219, 63, 86, 125, 213, 227, 216, - 0, 0, 102, 101, 103, 104, 107, 105, 89, 86, - 90, 87, 91, 86, 0, 86, 106, 88, 94, 95, - 203, 86, 86, 0, 0, 215, 217, 86, 177, 165, - 157, 169, 173, 149, 0, 189, 0, 222, 0, 0, - 0, 0, 0, 0, 0, 131, 18, 150, 86, 176, - 164, 156, 168, 172, 160, 148, 0, 35, 0, 229, - 37, 0, 212, 124, 121, 118, 117, 0, 86, 0, - 86, 75, 0, 0, 185, 86, 86, 0, 78, 86, - 0, 86, 154, 158, 162, 166, 170, 174, 178, 181, - 192, 211, 214, 0, 0, 97, 98, 195, 99, 0, - 96, 0, 0, 44, 41, 86, 86, 218, 153, 0, - 0, 239, 235, 31, 0, 0, 236, 234, 134, 132, - 0, 0, 0, 182, 152, 0, 0, 0, 86, 197, - 127, 122, 0, 0, 116, 123, 79, 80, 45, 86, - 45, 0, 226, 203, 92, 86, 93, 0, 201, 0, - 42, 43, 233, 223, 0, 0, 32, 232, 0, 0, - 136, 0, 31, 34, 0, 0, 0, 48, 47, 231, - 230, 120, 119, 126, 86, 203, 131, 86, 0, 86, - 0, 71, 45, 73, 228, 0, 100, 0, 202, 0, - 194, 224, 86, 0, 238, 237, 45, 135, 133, 0, - 0, 0, 19, 50, 49, 199, 0, 0, 45, 86, - 45, 46, 70, 0, 86, 86, 0, 28, 86, 33, - 0, 130, 0, 0, 0, 0, 203, 0, 136, 72, - 45, 74, 196, 204, 205, 25, 30, 29, 0, 0, - 0, 0, 51, 0, 198, 45, 69, 0, 0, 0, - 17, 54, 0, 0, 0, 128, 0, 208, 0, 206, - 138, 137, 53, 52, 200, 209, 207 + 2, 0, 1, 14, 0, 0, 129, 0, 37, 100, + 95, 96, 98, 99, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 234, 235, 0, + 0, 0, 0, 0, 0, 0, 0, 128, 127, 3, + 4, 6, 41, 78, 0, 13, 5, 0, 0, 0, + 82, 0, 0, 0, 0, 153, 154, 155, 156, 157, + 158, 159, 160, 0, 0, 198, 204, 0, 0, 0, + 0, 100, 12, 0, 11, 7, 8, 9, 10, 0, + 97, 37, 39, 125, 126, 123, 100, 122, 124, 90, + 100, 239, 100, 207, 41, 42, 43, 189, 100, 100, + 0, 0, 0, 0, 0, 0, 175, 0, 0, 194, + 200, 201, 224, 177, 169, 0, 0, 0, 27, 30, + 29, 181, 16, 0, 0, 0, 143, 0, 0, 19, + 26, 25, 185, 173, 161, 0, 165, 197, 0, 0, + 0, 0, 0, 0, 0, 0, 193, 0, 37, 205, + 0, 91, 0, 100, 0, 100, 0, 0, 69, 0, + 0, 0, 0, 89, 0, 70, 81, 71, 72, 0, + 0, 0, 0, 0, 0, 0, 0, 75, 73, 202, + 74, 0, 76, 79, 80, 233, 77, 100, 139, 227, + 241, 230, 0, 0, 116, 115, 117, 118, 121, 119, + 103, 100, 104, 101, 105, 100, 0, 100, 120, 102, + 108, 109, 217, 100, 100, 0, 0, 229, 231, 100, + 191, 179, 171, 183, 187, 163, 0, 203, 0, 236, + 0, 0, 0, 0, 0, 0, 0, 145, 23, 0, + 0, 0, 0, 0, 164, 100, 190, 178, 170, 182, + 186, 174, 162, 0, 38, 0, 243, 40, 0, 226, + 138, 135, 132, 131, 0, 100, 0, 100, 89, 0, + 0, 199, 100, 100, 0, 92, 100, 0, 100, 168, + 172, 176, 180, 184, 188, 192, 195, 206, 225, 228, + 0, 0, 111, 112, 209, 113, 0, 110, 0, 0, + 47, 44, 100, 100, 232, 167, 0, 0, 258, 254, + 34, 0, 0, 0, 255, 253, 148, 146, 0, 0, + 0, 0, 0, 0, 34, 37, 0, 0, 0, 51, + 50, 54, 196, 166, 0, 0, 0, 100, 211, 141, + 136, 0, 0, 130, 137, 93, 94, 48, 100, 48, + 0, 240, 217, 106, 100, 107, 0, 215, 0, 45, + 46, 247, 237, 0, 0, 35, 0, 246, 248, 0, + 0, 150, 0, 34, 0, 0, 57, 58, 0, 0, + 0, 0, 20, 53, 52, 245, 244, 134, 133, 140, + 100, 217, 145, 100, 0, 100, 0, 85, 48, 87, + 242, 0, 114, 0, 216, 0, 208, 238, 100, 0, + 0, 257, 256, 48, 149, 147, 0, 24, 0, 56, + 55, 0, 213, 0, 0, 48, 100, 48, 49, 84, + 0, 100, 100, 0, 31, 100, 36, 249, 250, 0, + 0, 144, 0, 59, 60, 0, 0, 217, 0, 150, + 86, 48, 88, 210, 218, 219, 28, 33, 32, 66, + 63, 0, 0, 0, 0, 0, 0, 18, 0, 212, + 48, 83, 0, 0, 0, 251, 0, 252, 0, 22, + 61, 62, 0, 142, 0, 222, 0, 220, 0, 64, + 67, 0, 152, 151, 214, 223, 221, 65, 68 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -364, -364, -364, -364, -364, -364, -364, -364, -364, 18, - 69, -1, 1, 2, 475, -320, 20, -348, 0, -364, - -43, -40, 256, 228, -364, 6, 76, -364, -364, -364, - -364, -364, 61, 17, -364, -364, -364, -364, -364, -364, - -364, -364, -364, -364, -364, 280, 421, -364, -364, -364, - -364, -364, -363, -322, -174, -364, 233, -364, -364, 286, - -114, -364, -364, -364, -364, -364, -364, -364, -364, -364 + -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, + 31, -292, -1, 10, 36, 30, -330, -312, 0, 20, + 39, 22, -393, -44, -41, 344, 255, -393, -5, 441, + -393, -393, -393, -393, -393, 75, 40, -393, -393, -393, + -393, -393, -393, -393, -393, -393, -393, -393, 314, 462, + -393, -393, -393, -393, -393, -392, -331, -334, -393, 277, + -393, -393, 335, -104, -393, -393, -393, -393, -393, -393, + -393, -393, -393 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 1, 39, 40, 311, 312, 129, 41, 230, 406, - 345, 93, 94, 95, 96, 371, 356, 357, 358, 46, - 47, 48, 252, 289, 208, 209, 49, 50, 51, 52, - 366, 235, 310, 386, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 210, 333, - 365, 416, 339, 292, 380, 67, 253, 68, 69, 70, - 228, 71, 188, 284, 72, 73, 74, 75, 76, 77 + 0, 1, 39, 40, 241, 242, 319, 320, 41, 232, + 433, 364, 94, 95, 96, 97, 397, 328, 329, 461, + 462, 330, 47, 48, 49, 259, 296, 210, 211, 50, + 51, 52, 53, 392, 237, 318, 413, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 212, 352, 391, 447, 358, 299, 406, 68, 260, + 69, 70, 71, 243, 72, 190, 291, 73, 74, 75, + 76, 77, 78 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1002,350 +1020,384 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 42, 45, 43, 44, 81, 162, 88, 159, 393, 233, - 373, 375, 403, 89, 91, 99, 158, 109, 111, 5, - 5, 97, 158, 5, 80, 80, 145, 78, 80, 145, - 370, 158, 249, 417, 135, 5, 121, 158, 343, 6, - 80, 149, 145, 396, 167, 232, 410, 161, 6, 6, - 5, 6, 402, 344, 5, 80, 168, 145, 148, 80, - 145, 82, 83, 169, 177, 425, 411, 84, 79, 5, - 444, 271, -39, 217, 80, 378, 446, 329, 419, 448, - 421, 393, 85, 179, 185, 227, 369, 37, 238, 86, - 87, 207, 399, 38, 433, 300, 37, 37, 98, 37, - 436, 318, 38, 38, -39, 38, 405, -39, 348, 225, - 254, 262, 248, 335, 263, 445, 270, 359, 442, 336, - 170, 414, 156, -39, -39, -39, 163, 164, 165, 166, - 5, 5, 117, 160, 160, 80, 80, 317, 175, 176, - 145, 145, 178, 180, 181, 182, 227, 250, 184, 251, - 118, 255, 227, 261, 147, 227, 227, 268, 161, 88, - 149, 227, 119, 145, 190, 191, 192, 193, 194, 195, - 196, 197, 5, 224, 5, 198, 199, 80, 281, 80, - 269, 367, 207, 390, 200, 207, 207, 391, 207, 150, - 201, 349, 337, 316, 338, 202, 171, 157, 82, 83, - 5, 360, 172, 5, 84, 80, 257, 173, 80, 258, - 10, 11, 12, 13, 207, 207, 203, 374, 18, 204, - 323, 151, 322, 205, 152, 206, 86, 87, 122, 422, - 126, 114, 123, 174, 309, 115, 27, 28, 259, 133, - 153, 154, 155, 434, 5, 145, 226, 82, 83, 80, - 260, 207, 227, 84, 145, 207, 88, 127, 124, 147, - 149, 116, 161, 447, 449, 92, 326, 327, 280, 128, - 454, 125, 455, 229, 456, 86, 87, 415, 211, 368, - 5, 207, 231, 160, 234, 80, 207, 207, 236, 5, - 5, 145, 267, 207, 80, 80, 207, 212, 213, 214, - 334, 335, 346, 5, 301, 302, 308, 247, 80, 306, - 307, 42, 207, 43, 44, 361, 362, 443, 207, 266, - 207, 161, 79, 207, 207, 5, 183, 207, 387, 207, - 80, 5, 350, 351, 450, 246, 80, 283, 379, 207, - 207, 186, 382, 383, 285, 187, 286, 189, 290, 305, - 388, 346, 295, 215, 216, 42, 394, 43, 44, 91, - 412, 383, 207, 418, 351, 309, 296, 299, 303, 401, - 304, 207, -75, -75, -16, 207, 315, 320, 5, 145, - 300, 332, 409, 146, 331, -75, -75, -75, -75, 82, - 83, 342, 347, 147, 207, 84, 377, 207, 90, 207, - 352, 381, 379, 125, 404, 413, 207, 428, 148, 256, - 431, 42, 430, 43, 44, 439, 379, 86, 87, 207, - 441, 389, 207, 207, 384, 385, 427, 397, 42, 394, - 43, 44, 429, 291, 264, 435, 379, 379, 451, 110, - 265, 282, 0, 379, 293, 379, 0, 379, 0, 5, - 0, 0, 0, 0, 80, 287, 0, 0, 408, 288, - 100, 288, 157, 158, 0, 0, 101, 0, 294, 0, - 0, 102, 0, 297, 103, 10, 11, 12, 13, 0, - 0, 0, 426, 0, 408, 0, 104, 105, 106, 107, - 0, 432, 108, 0, 313, 112, 0, 113, 0, 0, - 120, 0, 0, 426, 0, 0, 130, 131, 132, 134, - 0, 144, 0, 0, 319, 0, 321, 0, 452, 453, - 0, 324, 325, 5, 0, 328, 0, 330, 80, 0, - 0, 0, 0, 0, 136, 0, 0, 0, 0, 0, - 137, 0, 0, 0, 0, 138, 0, 0, 139, 0, - 0, 340, 341, 0, 0, 0, 0, 0, 0, 0, - 140, 141, 142, 143, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 363, 218, 219, 220, 221, 222, - 0, 223, 0, 0, 0, 372, 0, 0, 0, 0, - 0, 376, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 237, 0, - 0, 239, 240, 241, 242, 243, 244, 245, 0, 0, - 395, 0, 0, 398, 0, 400, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 407, 0, - 0, 0, 272, 273, 274, 275, 276, 277, 278, 279, - 0, 0, 0, 0, 0, 420, 2, 3, 0, 0, - 423, 424, 4, 0, 407, 0, 0, 0, 5, 0, - 6, 7, 0, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 0, 0, 21, 0, - 22, 23, 24, 25, 0, 0, 0, 26, 0, 298, - 0, 27, 28, 29, 30, 31, 32, 33, 34, 0, - 35, 36, 0, 0, 0, 0, 0, 0, 37, 0, - 0, 314, 0, 0, 38, 190, 191, 192, 193, 194, - 195, 196, 197, 5, 0, 0, 198, 0, 80, 0, - 0, 0, 0, 0, 0, 200, 0, 0, 0, 0, - 0, 201, 0, 0, 0, 0, 202, 0, 0, 82, - 83, 0, 0, 0, 0, 84, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 203, 0, 437, - 204, 438, 0, 0, 205, 0, 206, 86, 87, 190, - 191, 192, 193, 194, 195, 196, 197, 5, 0, 0, - 198, 364, 80, 0, 0, 0, 0, 0, 0, 200, - 0, 0, 0, 0, 0, 201, 0, 0, 0, 0, - 202, 0, 0, 82, 83, 0, 0, 0, 0, 84, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 203, 0, 0, 204, 0, 0, 0, 205, 0, - 206, 86, 87, 190, 191, 192, 193, 194, 195, 196, - 197, 5, 0, 0, 198, 0, 80, 0, 0, 0, - 0, 0, 0, 200, 0, 0, 0, 0, 0, 201, - 0, 0, 0, 0, 202, 0, 0, 82, 83, 0, - 0, 370, 0, 84, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 203, 0, 0, 204, 0, - 0, 0, 205, 0, 206, 86, 87, 190, 191, 192, - 193, 194, 195, 196, 197, 5, 0, 0, 198, 0, - 80, 0, 0, 0, 0, 0, 0, 200, 0, 0, - 0, 0, 0, 201, 0, 0, 0, 0, 202, 0, - 0, 82, 83, 0, 0, 0, 0, 84, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 203, - 0, 0, 204, 0, 0, 4, 205, 0, 206, 86, - 87, 5, 0, 6, 7, 0, 353, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, - 392, 0, 0, 22, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 0, 27, 28, 354, 355, 31, 32, - 33, 34, 0, 35, 36, 0, 0, 4, 0, 0, - 0, 37, 0, 5, 0, 6, 7, 38, 353, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 0, 440, 0, 0, 22, 0, 0, 25, 0, - 0, 0, 0, 0, 0, 0, 27, 28, 354, 355, - 31, 32, 33, 34, 0, 35, 36, 0, 0, 4, - 0, 0, 0, 37, 0, 5, 0, 6, 7, 38, - 353, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 0, 0, 0, 0, 22, 0, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, - 354, 355, 31, 32, 33, 34, 0, 35, 36, 0, - 0, 0, 0, 0, 0, 37, 0, 0, 0, 0, - 0, 38 + 42, 45, 90, 92, 82, 164, 89, 161, 374, 430, + 98, 43, 230, 160, 147, 100, 362, 110, 112, 399, + 235, 401, 160, 46, 160, 5, 160, 363, 122, 147, + 81, 448, 380, 5, 137, -42, 169, 44, 81, 170, + 490, 151, 171, 150, 256, 311, 5, 109, 163, 6, + 113, 81, 114, 5, 5, 121, 162, 162, 81, 81, + 423, 132, 133, 134, 136, 179, 146, -42, 429, 6, + -42, 278, 83, 84, 187, 245, 482, 404, 85, 147, + 348, 416, 395, 441, 426, 484, -42, -42, -42, 491, + 152, 312, 209, 86, 147, 450, 453, 452, 369, 37, + 38, 321, 354, 87, 88, 79, 276, 393, 147, 446, + 227, 355, 269, 181, 469, 270, 468, 277, 234, 37, + 38, 471, 153, 5, 5, 154, 219, 6, 81, 81, + 464, 220, 221, 222, 223, 224, 229, 225, 485, 487, + 483, 155, 156, 157, 456, 6, 80, 322, 494, 257, + 495, 258, 496, 262, 432, 268, 353, 354, 229, 275, + 163, 89, 151, 396, 437, 244, 438, 240, 246, 247, + 248, 249, 250, 251, 252, 486, 488, 37, 38, 440, + 288, 5, 378, 255, 209, 240, 81, 209, 209, 307, + 209, 443, 5, 444, 123, 37, 38, 81, 124, 279, + 280, 281, 282, 283, 284, 285, 286, 229, 5, 370, + -17, 439, 147, 81, 115, 385, 209, 209, 116, 379, + 229, 147, 5, 229, 125, 229, 342, 81, 341, 99, + 386, 172, 356, 147, 357, 149, 317, 126, 445, 337, + 173, 42, 335, 5, 117, 127, 400, 287, 81, 261, + 128, 336, 43, 229, 129, 147, 305, 118, 209, 83, + 84, 135, 209, 89, 367, 85, 368, 151, 91, 163, + 83, 84, 130, 345, 346, 119, 85, 376, 44, 377, + 174, 5, 147, 333, 131, 213, 81, 120, 209, 226, + 87, 88, 175, 209, 209, 253, 149, 394, 159, 160, + 209, 87, 88, 209, 214, 215, 216, 371, 372, 365, + 474, 10, 11, 12, 13, 475, 176, 5, 147, 42, + 92, 5, 81, 365, 162, 128, 81, 42, 383, 381, + 43, 209, 408, 409, 387, 388, 476, 209, 43, 209, + 163, 477, 209, 209, 5, 273, 209, 274, 209, 81, + 384, 421, 409, 93, 228, 474, 44, 405, 209, 209, + 480, 229, 476, 5, 44, 5, 316, 481, 81, 231, + 81, 415, 365, 42, 383, 5, 101, 233, 414, 236, + 81, 238, 102, 239, 43, 442, 409, 103, 209, 5, + 104, 317, 459, 254, 81, 428, 384, 209, 449, 372, + 290, 209, 105, 106, 107, 108, 5, 292, 436, 492, + 44, 81, 80, 293, 297, 185, 302, 303, 306, 313, + 42, 209, 323, 310, 209, -21, 209, 324, 334, 405, + 188, 43, 307, 209, 189, 339, 191, 351, 460, 361, + 350, 42, 217, 218, 460, 42, 383, 405, 366, 373, + 209, 375, 43, 209, 209, 126, 43, 44, 498, 403, + 407, 463, 298, 42, 383, 465, 458, 424, 384, 410, + 271, 405, 405, 489, 43, 418, 431, 493, 44, 478, + 111, 405, 44, 405, 466, 405, 384, 497, 158, 470, + 300, 272, 165, 166, 167, 168, 0, 0, 0, 263, + 44, 0, 0, 0, 177, 178, 0, 0, 180, 182, + 183, 184, 0, 0, 186, 0, 0, 0, 0, 0, + 0, 192, 193, 194, 195, 196, 197, 198, 199, 5, + 0, 289, 200, 0, 81, 0, 0, 0, 0, 0, + 0, 202, 0, 0, 0, 294, 0, 203, 0, 295, + 0, 295, 204, 0, 0, 83, 84, 0, 301, 0, + 0, 85, 0, 304, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 205, 0, 472, 206, 473, 0, 0, + 0, 0, 0, 207, 0, 208, 87, 88, 0, 332, + 0, 0, 0, 192, 193, 194, 195, 196, 197, 198, + 199, 5, 0, 0, 200, 201, 81, 0, 0, 338, + 0, 340, 0, 202, 0, 0, 343, 344, 0, 203, + 347, 0, 349, 0, 204, 0, 0, 83, 84, 0, + 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 205, 359, 360, 206, 0, + 0, 0, 0, 0, 0, 207, 0, 208, 87, 88, + 0, 0, 192, 193, 194, 195, 196, 197, 198, 199, + 5, 308, 309, 200, 390, 81, 314, 315, 0, 0, + 0, 389, 202, 0, 331, 0, 0, 0, 203, 0, + 0, 0, 398, 204, -89, -89, 83, 84, 402, 0, + 5, 147, 85, 0, 0, 148, 0, -89, -89, -89, + -89, 0, 0, 0, 205, 149, 0, 206, 0, 0, + 0, 0, 0, 0, 207, 0, 208, 87, 88, 0, + 150, 0, 0, 0, 422, 0, 0, 425, 0, 427, + 0, 0, 0, 192, 193, 194, 195, 196, 197, 198, + 199, 5, 434, 0, 200, 0, 81, 0, 0, 0, + 0, 0, 0, 202, 0, 0, 0, 0, 0, 203, + 451, 0, 0, 0, 204, 454, 455, 83, 84, 434, + 0, 396, 0, 85, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 205, 0, 0, 206, 0, + 0, 0, 0, 0, 0, 207, 0, 208, 87, 88, + 411, 412, 0, 0, 0, 0, 0, 0, 0, 419, + 420, 0, 0, 0, 0, 192, 193, 194, 195, 196, + 197, 198, 199, 5, 0, 0, 200, 0, 81, 0, + 0, 0, 0, 0, 0, 202, 0, 0, 0, 435, + 0, 203, 0, 0, 0, 0, 204, 0, 0, 83, + 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, + 0, 0, 0, 0, 457, 0, 435, 205, 0, 0, + 206, 0, 0, 0, 0, 0, 0, 207, 0, 208, + 87, 88, 2, 3, 0, 0, 0, 0, 4, 457, + 0, 0, 0, 0, 5, 0, 6, 7, 0, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 0, 0, 21, 0, 22, 23, 24, 25, + 0, 0, 0, 26, 0, 0, 0, 27, 28, 29, + 30, 31, 32, 33, 34, 0, 35, 36, 0, 0, + 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, + 6, 7, 0, 325, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 0, 382, 0, 0, + 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, + 0, 27, 28, 326, 327, 31, 32, 33, 34, 0, + 35, 36, 0, 0, 0, 0, 4, 0, 0, 0, + 37, 38, 5, 0, 6, 7, 0, 325, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 0, 417, 0, 0, 22, 0, 0, 25, 0, 0, + 0, 0, 0, 0, 0, 27, 28, 326, 327, 31, + 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, + 4, 0, 0, 0, 37, 38, 5, 0, 6, 7, + 0, 325, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 0, 467, 0, 0, 22, 0, + 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, + 28, 326, 327, 31, 32, 33, 34, 0, 35, 36, + 0, 0, 0, 0, 4, 0, 0, 0, 37, 38, + 5, 0, 6, 7, 0, 325, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 0, 479, + 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, + 0, 0, 0, 27, 28, 326, 327, 31, 32, 33, + 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, + 0, 0, 37, 38, 5, 0, 6, 7, 0, 325, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 0, 0, 0, 0, 22, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 27, 28, 326, + 327, 31, 32, 33, 34, 0, 35, 36, 0, 159, + 0, 0, 0, 0, 0, 5, 37, 38, 264, 0, + 81, 265, 10, 11, 12, 13, 0, 0, 0, 5, + 18, 0, 0, 0, 81, 0, 0, 0, 0, 0, + 138, 0, 0, 0, 0, 0, 139, 0, 27, 28, + 266, 140, 0, 0, 141, 0, 0, 0, 0, 0, + 0, 0, 267, 0, 0, 0, 142, 143, 144, 145 }; static const yytype_int16 yycheck[] = { - 1, 1, 1, 1, 5, 48, 7, 47, 356, 123, - 330, 333, 375, 7, 8, 16, 7, 18, 19, 12, - 12, 15, 7, 12, 17, 17, 13, 15, 17, 13, - 42, 7, 146, 396, 35, 12, 53, 7, 53, 14, - 17, 42, 13, 365, 58, 13, 58, 48, 14, 14, - 12, 14, 372, 68, 12, 17, 58, 13, 42, 17, - 13, 38, 39, 58, 65, 31, 386, 44, 56, 12, - 433, 62, 8, 60, 17, 68, 68, 62, 398, 68, - 400, 429, 59, 58, 78, 53, 62, 62, 59, 66, - 67, 92, 62, 68, 416, 58, 62, 62, 60, 62, - 420, 59, 68, 68, 40, 68, 59, 43, 15, 110, - 53, 154, 13, 58, 154, 435, 159, 15, 15, 64, - 58, 13, 46, 59, 60, 61, 50, 51, 52, 53, - 12, 12, 17, 15, 15, 17, 17, 9, 62, 63, - 13, 13, 66, 67, 68, 69, 53, 148, 72, 150, - 35, 152, 53, 154, 27, 53, 53, 158, 159, 160, - 161, 53, 47, 13, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 51, 12, 15, 16, 17, 179, 17, - 62, 62, 183, 13, 24, 186, 187, 17, 189, 8, - 30, 305, 58, 43, 60, 35, 58, 6, 38, 39, - 12, 315, 58, 12, 44, 17, 15, 58, 17, 18, - 19, 20, 21, 22, 215, 216, 56, 331, 27, 59, - 263, 40, 262, 63, 43, 65, 66, 67, 13, 403, - 8, 13, 17, 58, 235, 17, 45, 46, 47, 51, - 59, 60, 61, 417, 12, 13, 17, 38, 39, 17, - 59, 252, 53, 44, 13, 256, 257, 35, 43, 27, - 261, 43, 263, 437, 438, 9, 267, 268, 27, 47, - 444, 56, 446, 53, 448, 66, 67, 391, 40, 322, - 12, 282, 17, 15, 53, 17, 287, 288, 17, 12, - 12, 13, 15, 294, 17, 17, 297, 59, 60, 61, - 57, 58, 303, 12, 228, 229, 15, 17, 17, 233, - 234, 312, 313, 312, 312, 316, 317, 431, 319, 59, - 321, 322, 56, 324, 325, 12, 70, 328, 15, 330, - 17, 12, 57, 58, 15, 51, 17, 17, 339, 340, - 341, 85, 57, 58, 4, 89, 5, 91, 59, 17, - 351, 352, 59, 97, 98, 356, 356, 356, 356, 353, - 57, 58, 363, 57, 58, 366, 59, 59, 56, 370, - 59, 372, 6, 7, 56, 376, 17, 56, 12, 13, - 58, 31, 383, 17, 60, 19, 20, 21, 22, 38, - 39, 15, 15, 27, 395, 44, 17, 398, 47, 400, - 56, 53, 403, 56, 59, 17, 407, 17, 42, 153, - 17, 412, 59, 412, 412, 59, 417, 66, 67, 420, - 15, 352, 423, 424, 348, 349, 408, 366, 429, 429, - 429, 429, 412, 205, 154, 418, 437, 438, 439, 18, - 154, 185, -1, 444, 211, 446, -1, 448, -1, 12, - -1, -1, -1, -1, 17, 199, -1, -1, 382, 203, - 23, 205, 6, 7, -1, -1, 29, -1, 212, -1, - -1, 34, -1, 217, 37, 19, 20, 21, 22, -1, - -1, -1, 406, -1, 408, -1, 49, 50, 51, 52, - -1, 415, 17, -1, 238, 20, -1, 22, -1, -1, - 25, -1, -1, 427, -1, -1, 31, 32, 33, 34, - -1, 36, -1, -1, 258, -1, 260, -1, 442, 443, - -1, 265, 266, 12, -1, 269, -1, 271, 17, -1, - -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, - 29, -1, -1, -1, -1, 34, -1, -1, 37, -1, - -1, 295, 296, -1, -1, -1, -1, -1, -1, -1, - 49, 50, 51, 52, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 318, 100, 101, 102, 103, 104, - -1, 106, -1, -1, -1, 329, -1, -1, -1, -1, - -1, 335, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 133, -1, - -1, 136, 137, 138, 139, 140, 141, 142, -1, -1, - 364, -1, -1, 367, -1, 369, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 382, -1, - -1, -1, 167, 168, 169, 170, 171, 172, 173, 174, - -1, -1, -1, -1, -1, 399, 0, 1, -1, -1, - 404, 405, 6, -1, 408, -1, -1, -1, 12, -1, - 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, -1, -1, 32, -1, - 34, 35, 36, 37, -1, -1, -1, 41, -1, 224, - -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, - 54, 55, -1, -1, -1, -1, -1, -1, 62, -1, - -1, 246, -1, -1, 68, 4, 5, 6, 7, 8, - 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, - -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, - -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, - 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 56, -1, 58, - 59, 60, -1, -1, 63, -1, 65, 66, 67, 4, - 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, - 15, 16, 17, -1, -1, -1, -1, -1, -1, 24, - -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, - 35, -1, -1, 38, 39, -1, -1, -1, -1, 44, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 56, -1, -1, 59, -1, -1, -1, 63, -1, - 65, 66, 67, 4, 5, 6, 7, 8, 9, 10, - 11, 12, -1, -1, 15, -1, 17, -1, -1, -1, + 1, 1, 7, 8, 5, 49, 7, 48, 320, 401, + 15, 1, 116, 7, 13, 16, 53, 18, 19, 349, + 124, 352, 7, 1, 7, 12, 7, 64, 53, 13, + 17, 423, 324, 12, 35, 8, 58, 1, 17, 58, + 15, 42, 58, 42, 148, 13, 12, 17, 49, 14, + 20, 17, 22, 12, 12, 25, 15, 15, 17, 17, + 391, 31, 32, 33, 34, 66, 36, 40, 398, 14, + 43, 65, 38, 39, 79, 59, 468, 64, 44, 13, + 65, 373, 65, 413, 65, 64, 59, 60, 61, 64, + 8, 59, 93, 59, 13, 425, 430, 427, 15, 64, + 65, 13, 58, 69, 70, 15, 65, 65, 13, 421, + 111, 67, 156, 58, 448, 156, 447, 161, 13, 64, + 65, 451, 40, 12, 12, 43, 60, 14, 17, 17, + 442, 101, 102, 103, 104, 105, 53, 107, 472, 473, + 470, 59, 60, 61, 31, 14, 56, 59, 482, 150, + 484, 152, 486, 154, 59, 156, 57, 58, 53, 160, + 161, 162, 163, 42, 15, 135, 17, 13, 138, 139, + 140, 141, 142, 143, 144, 64, 64, 64, 65, 58, + 181, 12, 15, 13, 185, 13, 17, 188, 189, 58, + 191, 15, 12, 17, 13, 64, 65, 17, 17, 169, + 170, 171, 172, 173, 174, 175, 176, 53, 12, 313, + 56, 62, 13, 17, 13, 15, 217, 218, 17, 323, + 53, 13, 12, 53, 43, 53, 270, 17, 269, 60, + 334, 58, 58, 13, 60, 27, 237, 56, 62, 59, + 58, 242, 43, 12, 43, 8, 350, 27, 17, 53, + 13, 9, 242, 53, 17, 13, 226, 17, 259, 38, + 39, 51, 263, 264, 15, 44, 17, 268, 47, 270, + 38, 39, 35, 274, 275, 35, 44, 15, 242, 17, + 58, 12, 13, 253, 47, 40, 17, 47, 289, 51, + 69, 70, 58, 294, 295, 51, 27, 341, 6, 7, + 301, 69, 70, 304, 59, 60, 61, 57, 58, 310, + 58, 19, 20, 21, 22, 63, 58, 12, 13, 320, + 325, 12, 17, 324, 15, 13, 17, 328, 328, 17, + 320, 332, 57, 58, 335, 336, 58, 338, 328, 340, + 341, 63, 343, 344, 12, 59, 347, 15, 349, 17, + 328, 57, 58, 9, 17, 58, 320, 358, 359, 360, + 63, 53, 58, 12, 328, 12, 15, 63, 17, 53, + 17, 372, 373, 374, 374, 12, 23, 17, 15, 53, + 17, 17, 29, 17, 374, 57, 58, 34, 389, 12, + 37, 392, 15, 17, 17, 396, 374, 398, 57, 58, + 17, 402, 49, 50, 51, 52, 12, 4, 409, 15, + 374, 17, 56, 5, 59, 71, 59, 59, 59, 17, + 421, 422, 17, 56, 425, 56, 427, 56, 17, 430, + 86, 421, 58, 434, 90, 56, 92, 31, 439, 15, + 60, 442, 98, 99, 445, 446, 446, 448, 17, 56, + 451, 17, 442, 454, 455, 56, 446, 421, 15, 17, + 53, 17, 207, 464, 464, 445, 435, 392, 446, 59, + 156, 472, 473, 474, 464, 59, 59, 478, 442, 59, + 18, 482, 446, 484, 445, 486, 464, 488, 47, 449, + 213, 156, 51, 52, 53, 54, -1, -1, -1, 155, + 464, -1, -1, -1, 63, 64, -1, -1, 67, 68, + 69, 70, -1, -1, 73, -1, -1, -1, -1, -1, + -1, 4, 5, 6, 7, 8, 9, 10, 11, 12, + -1, 187, 15, -1, 17, -1, -1, -1, -1, -1, + -1, 24, -1, -1, -1, 201, -1, 30, -1, 205, + -1, 207, 35, -1, -1, 38, 39, -1, 214, -1, + -1, 44, -1, 219, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 56, -1, 58, 59, 60, -1, -1, + -1, -1, -1, 66, -1, 68, 69, 70, -1, 245, + -1, -1, -1, 4, 5, 6, 7, 8, 9, 10, + 11, 12, -1, -1, 15, 16, 17, -1, -1, 265, + -1, 267, -1, 24, -1, -1, 272, 273, -1, 30, + 276, -1, 278, -1, 35, -1, -1, 38, 39, -1, + -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 56, 302, 303, 59, -1, + -1, -1, -1, -1, -1, 66, -1, 68, 69, 70, + -1, -1, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 230, 231, 15, 16, 17, 235, 236, -1, -1, + -1, 337, 24, -1, 243, -1, -1, -1, 30, -1, + -1, -1, 348, 35, 6, 7, 38, 39, 354, -1, + 12, 13, 44, -1, -1, 17, -1, 19, 20, 21, + 22, -1, -1, -1, 56, 27, -1, 59, -1, -1, + -1, -1, -1, -1, 66, -1, 68, 69, 70, -1, + 42, -1, -1, -1, 390, -1, -1, 393, -1, 395, + -1, -1, -1, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 408, -1, 15, -1, 17, -1, -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, 30, - -1, -1, -1, -1, 35, -1, -1, 38, 39, -1, + 426, -1, -1, -1, 35, 431, 432, 38, 39, 435, -1, 42, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, -1, -1, 59, -1, - -1, -1, 63, -1, 65, 66, 67, 4, 5, 6, - 7, 8, 9, 10, 11, 12, -1, -1, 15, -1, - 17, -1, -1, -1, -1, -1, -1, 24, -1, -1, - -1, -1, -1, 30, -1, -1, -1, -1, 35, -1, - -1, 38, 39, -1, -1, -1, -1, 44, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 56, - -1, -1, 59, -1, -1, 6, 63, -1, 65, 66, - 67, 12, -1, 14, 15, -1, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, - 31, -1, -1, 34, -1, -1, 37, -1, -1, -1, - -1, -1, -1, -1, 45, 46, 47, 48, 49, 50, - 51, 52, -1, 54, 55, -1, -1, 6, -1, -1, - -1, 62, -1, 12, -1, 14, 15, 68, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, -1, -1, 34, -1, -1, 37, -1, - -1, -1, -1, -1, -1, -1, 45, 46, 47, 48, - 49, 50, 51, 52, -1, 54, 55, -1, -1, 6, - -1, -1, -1, 62, -1, 12, -1, 14, 15, 68, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, - 37, -1, -1, -1, -1, -1, -1, -1, 45, 46, - 47, 48, 49, 50, 51, 52, -1, 54, 55, -1, - -1, -1, -1, -1, -1, 62, -1, -1, -1, -1, - -1, 68 + -1, -1, -1, -1, -1, 66, -1, 68, 69, 70, + 369, 370, -1, -1, -1, -1, -1, -1, -1, 378, + 379, -1, -1, -1, -1, 4, 5, 6, 7, 8, + 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, + -1, -1, -1, -1, -1, 24, -1, -1, -1, 408, + -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, + 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, + -1, -1, -1, -1, 433, -1, 435, 56, -1, -1, + 59, -1, -1, -1, -1, -1, -1, 66, -1, 68, + 69, 70, 0, 1, -1, -1, -1, -1, 6, 458, + -1, -1, -1, -1, 12, -1, 14, 15, -1, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, -1, -1, 32, -1, 34, 35, 36, 37, + -1, -1, -1, 41, -1, -1, -1, 45, 46, 47, + 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, + -1, -1, 6, -1, -1, -1, 64, 65, 12, -1, + 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, -1, 31, -1, -1, + 34, -1, -1, 37, -1, -1, -1, -1, -1, -1, + -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, + 54, 55, -1, -1, -1, -1, 6, -1, -1, -1, + 64, 65, 12, -1, 14, 15, -1, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + -1, 31, -1, -1, 34, -1, -1, 37, -1, -1, + -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, + 50, 51, 52, -1, 54, 55, -1, -1, -1, -1, + 6, -1, -1, -1, 64, 65, 12, -1, 14, 15, + -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, -1, -1, 34, -1, + -1, 37, -1, -1, -1, -1, -1, -1, -1, 45, + 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, + -1, -1, -1, -1, 6, -1, -1, -1, 64, 65, + 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, + -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, + -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, + 52, -1, 54, 55, -1, -1, -1, -1, 6, -1, + -1, -1, 64, 65, 12, -1, 14, 15, -1, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, + -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, + 48, 49, 50, 51, 52, -1, 54, 55, -1, 6, + -1, -1, -1, -1, -1, 12, 64, 65, 15, -1, + 17, 18, 19, 20, 21, 22, -1, -1, -1, 12, + 27, -1, -1, -1, 17, -1, -1, -1, -1, -1, + 23, -1, -1, -1, -1, -1, 29, -1, 45, 46, + 47, 34, -1, -1, 37, -1, -1, -1, -1, -1, + -1, -1, 59, -1, -1, -1, 49, 50, 51, 52 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 70, 0, 1, 6, 12, 14, 15, 17, 18, + 0, 72, 0, 1, 6, 12, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 34, 35, 36, 37, 41, 45, 46, 47, - 48, 49, 50, 51, 52, 54, 55, 62, 68, 71, - 72, 76, 80, 81, 82, 87, 88, 89, 90, 95, - 96, 97, 98, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 124, 126, 127, - 128, 130, 133, 134, 135, 136, 137, 138, 15, 56, - 17, 80, 38, 39, 44, 59, 66, 67, 80, 94, - 47, 94, 91, 80, 81, 82, 83, 94, 60, 80, - 23, 29, 34, 37, 49, 50, 51, 52, 83, 80, - 115, 80, 83, 83, 13, 17, 43, 17, 35, 47, - 83, 53, 13, 17, 43, 56, 8, 35, 47, 75, - 83, 83, 83, 51, 83, 80, 23, 29, 34, 37, - 49, 50, 51, 52, 83, 13, 17, 27, 42, 80, - 8, 40, 43, 59, 60, 61, 95, 6, 7, 90, - 15, 80, 89, 95, 95, 95, 95, 58, 58, 58, - 58, 58, 58, 58, 58, 95, 95, 80, 95, 58, - 95, 95, 95, 91, 95, 94, 91, 91, 131, 91, - 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, - 24, 30, 35, 56, 59, 63, 65, 80, 93, 94, - 117, 40, 59, 60, 61, 91, 91, 60, 83, 83, - 83, 83, 83, 83, 51, 80, 17, 53, 129, 53, - 77, 17, 13, 129, 53, 100, 17, 83, 59, 83, - 83, 83, 83, 83, 83, 83, 51, 17, 13, 129, - 80, 80, 91, 125, 53, 80, 91, 15, 18, 47, - 59, 80, 89, 90, 114, 128, 59, 15, 80, 62, - 89, 62, 83, 83, 83, 83, 83, 83, 83, 83, - 27, 80, 91, 17, 132, 4, 5, 91, 91, 92, - 59, 92, 122, 125, 91, 59, 59, 91, 83, 59, - 58, 95, 95, 56, 59, 17, 95, 95, 15, 80, - 101, 73, 74, 91, 83, 17, 43, 9, 59, 91, - 56, 91, 90, 89, 91, 91, 80, 80, 91, 62, - 91, 60, 31, 118, 57, 58, 64, 58, 60, 121, - 91, 91, 15, 53, 68, 79, 80, 15, 15, 129, - 57, 58, 56, 17, 47, 48, 85, 86, 87, 15, - 129, 80, 80, 91, 16, 119, 99, 62, 89, 62, - 42, 84, 91, 84, 129, 122, 91, 17, 68, 80, - 123, 53, 57, 58, 95, 95, 102, 15, 80, 79, - 13, 17, 31, 86, 87, 91, 122, 101, 91, 62, - 91, 80, 84, 121, 59, 59, 78, 91, 95, 80, - 58, 84, 57, 17, 13, 129, 120, 121, 57, 84, - 91, 84, 123, 91, 91, 31, 95, 78, 17, 85, - 59, 17, 95, 122, 123, 102, 84, 58, 60, 59, - 31, 15, 15, 129, 121, 84, 68, 123, 68, 123, - 15, 80, 95, 95, 123, 123, 123 + 48, 49, 50, 51, 52, 54, 55, 64, 65, 73, + 74, 79, 83, 84, 85, 89, 92, 93, 94, 95, + 100, 101, 102, 103, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 129, 131, + 132, 133, 135, 138, 139, 140, 141, 142, 143, 15, + 56, 17, 83, 38, 39, 44, 59, 69, 70, 83, + 99, 47, 99, 96, 83, 84, 85, 86, 99, 60, + 83, 23, 29, 34, 37, 49, 50, 51, 52, 86, + 83, 120, 83, 86, 86, 13, 17, 43, 17, 35, + 47, 86, 53, 13, 17, 43, 56, 8, 13, 17, + 35, 47, 86, 86, 86, 51, 86, 83, 23, 29, + 34, 37, 49, 50, 51, 52, 86, 13, 17, 27, + 42, 83, 8, 40, 43, 59, 60, 61, 100, 6, + 7, 95, 15, 83, 94, 100, 100, 100, 100, 58, + 58, 58, 58, 58, 58, 58, 58, 100, 100, 83, + 100, 58, 100, 100, 100, 96, 100, 99, 96, 96, + 136, 96, 4, 5, 6, 7, 8, 9, 10, 11, + 15, 16, 24, 30, 35, 56, 59, 66, 68, 83, + 98, 99, 122, 40, 59, 60, 61, 96, 96, 60, + 86, 86, 86, 86, 86, 86, 51, 83, 17, 53, + 134, 53, 80, 17, 13, 134, 53, 105, 17, 17, + 13, 75, 76, 134, 86, 59, 86, 86, 86, 86, + 86, 86, 86, 51, 17, 13, 134, 83, 83, 96, + 130, 53, 83, 96, 15, 18, 47, 59, 83, 94, + 95, 119, 133, 59, 15, 83, 65, 94, 65, 86, + 86, 86, 86, 86, 86, 86, 86, 27, 83, 96, + 17, 137, 4, 5, 96, 96, 97, 59, 97, 127, + 130, 96, 59, 59, 96, 86, 59, 58, 100, 100, + 56, 13, 59, 17, 100, 100, 15, 83, 106, 77, + 78, 13, 59, 17, 56, 17, 47, 48, 88, 89, + 92, 100, 96, 86, 17, 43, 9, 59, 96, 56, + 96, 95, 94, 96, 96, 83, 83, 96, 65, 96, + 60, 31, 123, 57, 58, 67, 58, 60, 126, 96, + 96, 15, 53, 64, 82, 83, 17, 15, 17, 15, + 134, 57, 58, 56, 88, 17, 15, 17, 15, 134, + 82, 17, 31, 89, 92, 15, 134, 83, 83, 96, + 16, 124, 104, 65, 94, 65, 42, 87, 96, 87, + 134, 127, 96, 17, 64, 83, 128, 53, 57, 58, + 59, 100, 100, 107, 15, 83, 82, 31, 59, 100, + 100, 57, 96, 127, 106, 96, 65, 96, 83, 87, + 126, 59, 59, 81, 96, 100, 83, 15, 17, 62, + 58, 87, 57, 15, 17, 62, 88, 125, 126, 57, + 87, 96, 87, 128, 96, 96, 31, 100, 81, 15, + 83, 90, 91, 17, 88, 90, 91, 31, 127, 128, + 107, 87, 58, 60, 58, 63, 58, 63, 59, 31, + 63, 63, 126, 87, 64, 128, 64, 128, 64, 83, + 15, 64, 15, 83, 128, 128, 128, 83, 15 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_uint8 yyr1[] = { - 0, 69, 70, 70, 70, 70, 70, 70, 70, 70, - 70, 70, 70, 70, 70, 71, 73, 72, 74, 72, - 72, 72, 75, 75, 77, 76, 76, 76, 78, 78, - 78, 79, 79, 79, 80, 80, 80, 81, 82, 82, - 83, 83, 83, 83, 83, 84, 84, 85, 85, 85, - 85, 86, 86, 86, 86, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, - 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, - 89, 90, 90, 90, 90, 90, 91, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, - 92, 93, 93, 93, 93, 93, 93, 93, 94, 94, - 94, 94, 94, 95, 95, 95, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 97, 97, 99, 98, 100, - 98, 101, 101, 101, 101, 101, 102, 102, 102, 103, - 103, 103, 103, 103, 103, 103, 103, 104, 104, 104, - 104, 104, 104, 104, 104, 105, 105, 105, 105, 106, - 106, 106, 106, 107, 107, 107, 107, 108, 108, 108, - 108, 109, 109, 109, 109, 110, 110, 110, 110, 111, - 111, 111, 112, 112, 113, 113, 114, 114, 114, 114, - 114, 115, 115, 117, 116, 118, 116, 119, 116, 120, - 116, 121, 121, 122, 122, 123, 123, 123, 123, 123, - 124, 124, 125, 126, 126, 126, 126, 126, 126, 127, - 128, 128, 129, 129, 129, 131, 130, 132, 132, 133, - 133, 133, 134, 134, 135, 136, 137, 137, 137, 138 + 0, 71, 72, 72, 72, 72, 72, 72, 72, 72, + 72, 72, 72, 72, 72, 72, 73, 75, 74, 76, + 74, 77, 74, 78, 74, 74, 74, 80, 79, 79, + 79, 81, 81, 81, 82, 82, 82, 83, 83, 83, + 84, 85, 85, 86, 86, 86, 86, 86, 87, 87, + 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 90, 90, 90, 91, 91, 91, 92, + 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 93, 93, 93, 93, 93, 93, 94, + 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 97, 97, 98, 98, 98, 98, 98, + 98, 98, 99, 99, 99, 99, 99, 100, 100, 100, + 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, + 102, 104, 103, 105, 103, 106, 106, 106, 106, 106, + 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, + 108, 109, 109, 109, 109, 109, 109, 109, 109, 110, + 110, 110, 110, 111, 111, 111, 111, 112, 112, 112, + 112, 113, 113, 113, 113, 114, 114, 114, 114, 115, + 115, 115, 115, 116, 116, 116, 117, 117, 118, 118, + 119, 119, 119, 119, 119, 120, 120, 122, 121, 123, + 121, 124, 121, 125, 121, 126, 126, 127, 127, 128, + 128, 128, 128, 128, 129, 129, 130, 131, 131, 131, + 131, 131, 131, 132, 133, 133, 134, 134, 134, 136, + 135, 137, 137, 138, 138, 138, 139, 139, 139, 139, + 139, 139, 139, 140, 141, 142, 142, 142, 143 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 0, 9, 0, 6, - 2, 2, 0, 1, 0, 8, 2, 2, 1, 2, - 2, 0, 1, 3, 1, 3, 2, 3, 1, 1, - 1, 3, 4, 4, 3, 0, 2, 1, 1, 2, - 2, 4, 6, 6, 5, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 1, 2, 2, 2, 1, 8, - 6, 5, 7, 5, 7, 1, 2, 2, 3, 4, - 4, 1, 1, 2, 1, 1, 0, 2, 2, 2, - 2, 2, 4, 4, 2, 2, 3, 3, 3, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 3, 3, 5, - 5, 3, 4, 4, 3, 3, 5, 0, 9, 0, - 7, 0, 1, 3, 1, 3, 0, 5, 5, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, - 3, 2, 4, 4, 3, 2, 3, 3, 3, 2, - 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 0, 8, 0, + 5, 0, 9, 0, 6, 2, 2, 0, 8, 2, + 2, 1, 2, 2, 0, 1, 3, 1, 3, 2, + 3, 1, 1, 1, 3, 4, 4, 3, 0, 2, + 1, 1, 2, 2, 4, 6, 6, 5, 5, 7, + 7, 9, 9, 1, 3, 4, 1, 3, 4, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, + 2, 2, 1, 8, 6, 5, 7, 5, 7, 1, + 2, 2, 3, 4, 4, 1, 1, 2, 1, 1, + 0, 2, 2, 2, 2, 2, 4, 4, 2, 2, + 3, 3, 3, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 3, 3, 5, 5, 3, 4, 4, 3, 3, + 5, 0, 9, 0, 7, 0, 1, 3, 1, 3, + 0, 5, 5, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 3, 3, 2, 4, 4, 3, 2, + 3, 3, 3, 2, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, - 2, 3, 4, 2, 1, 3, 2, 2, 2, 3, - 1, 2, 3, 0, 6, 0, 8, 0, 8, 0, - 10, 1, 2, 0, 5, 3, 5, 6, 5, 6, - 2, 3, 1, 3, 4, 3, 3, 3, 4, 2, - 1, 1, 1, 3, 4, 0, 5, 0, 3, 3, - 5, 5, 5, 5, 4, 4, 4, 6, 6, 4 + 3, 3, 3, 2, 2, 3, 4, 2, 1, 3, + 2, 2, 2, 3, 1, 2, 3, 0, 6, 0, + 8, 0, 8, 0, 10, 1, 2, 0, 5, 3, + 5, 6, 5, 6, 2, 3, 1, 3, 4, 3, + 3, 3, 4, 2, 1, 1, 1, 3, 4, 0, + 5, 0, 3, 3, 5, 5, 5, 5, 5, 7, + 7, 9, 9, 4, 4, 4, 6, 6, 4 }; @@ -2079,433 +2131,577 @@ yyparse (void) switch (yyn) { case 3: /* input: input import */ -#line 161 "antimony.ypp" +#line 163 "antimony.ypp" {} -#line 2085 "antimony.tab.cpp" +#line 2137 "antimony.tab.cpp" break; case 4: /* input: input module */ -#line 162 "antimony.ypp" +#line 164 "antimony.ypp" { /*cout << endl << $2->ToString() << endl << endl;*/ } -#line 2091 "antimony.tab.cpp" +#line 2143 "antimony.tab.cpp" break; case 5: /* input: input modulepart */ -#line 163 "antimony.ypp" +#line 165 "antimony.ypp" {} -#line 2097 "antimony.tab.cpp" +#line 2149 "antimony.tab.cpp" break; case 6: /* input: input function */ -#line 164 "antimony.ypp" +#line 166 "antimony.ypp" {} -#line 2103 "antimony.tab.cpp" +#line 2155 "antimony.tab.cpp" break; case 7: /* input: input modulename */ -#line 165 "antimony.ypp" +#line 167 "antimony.ypp" {} -#line 2109 "antimony.tab.cpp" +#line 2161 "antimony.tab.cpp" break; case 8: /* input: input functionname */ -#line 166 "antimony.ypp" +#line 168 "antimony.ypp" {} -#line 2115 "antimony.tab.cpp" +#line 2167 "antimony.tab.cpp" break; case 9: /* input: input modulecvterm */ -#line 167 "antimony.ypp" +#line 169 "antimony.ypp" {} -#line 2121 "antimony.tab.cpp" +#line 2173 "antimony.tab.cpp" break; case 10: /* input: input functioncvterm */ -#line 168 "antimony.ypp" +#line 170 "antimony.ypp" {} -#line 2127 "antimony.tab.cpp" +#line 2179 "antimony.tab.cpp" break; case 11: /* input: input toplevel_sbo */ -#line 169 "antimony.ypp" +#line 171 "antimony.ypp" {} -#line 2133 "antimony.tab.cpp" +#line 2185 "antimony.tab.cpp" break; case 12: /* input: input annotationBlock */ -#line 170 "antimony.ypp" +#line 172 "antimony.ypp" {} -#line 2139 "antimony.tab.cpp" +#line 2191 "antimony.tab.cpp" break; - case 13: /* input: input error */ -#line 171 "antimony.ypp" - {YYABORT;} -#line 2145 "antimony.tab.cpp" + case 13: /* input: input moduleannotation */ +#line 173 "antimony.ypp" + {} +#line 2197 "antimony.tab.cpp" break; - case 14: /* input: input "an error" */ -#line 172 "antimony.ypp" + case 14: /* input: input error */ +#line 174 "antimony.ypp" {YYABORT;} -#line 2151 "antimony.tab.cpp" +#line 2203 "antimony.tab.cpp" break; - case 15: /* import: "'import'" "text string" */ + case 15: /* input: input "an error" */ #line 175 "antimony.ypp" - { if (g_registry.OpenFile(*((yyvsp[0].word)))==0) YYABORT;} -#line 2157 "antimony.tab.cpp" + {YYABORT;} +#line 2209 "antimony.tab.cpp" break; - case 16: /* $@1: %empty */ + case 16: /* import: "'import'" "text string" */ #line 178 "antimony.ypp" - {g_registry.NewCurrentModule((yyvsp[0].word), NULL, (yyvsp[-1].maybemain));} -#line 2163 "antimony.tab.cpp" + { if (g_registry.OpenFile(*((yyvsp[0].word)))==0) YYABORT;} +#line 2215 "antimony.tab.cpp" + break; + + case 17: /* $@1: %empty */ +#line 181 "antimony.ypp" + {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} +#line 2221 "antimony.tab.cpp" break; - case 17: /* module: "'model' or 'module'" maybemain "element name" $@1 '(' variableexportlist ')' modulebody "'end'" */ -#line 179 "antimony.ypp" + case 18: /* module: "'model' or 'module'" "element name" $@1 '(' variableexportlist ')' modulebody "'end'" */ +#line 182 "antimony.ypp" { (yyval.module) = g_registry.CurrentModule(); if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2173 "antimony.tab.cpp" +#line 2231 "antimony.tab.cpp" break; - case 18: /* $@2: %empty */ -#line 184 "antimony.ypp" - {g_registry.NewCurrentModule((yyvsp[0].word), NULL, (yyvsp[-1].maybemain));} -#line 2179 "antimony.tab.cpp" + case 19: /* $@2: %empty */ +#line 187 "antimony.ypp" + {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} +#line 2237 "antimony.tab.cpp" break; - case 19: /* module: "'model' or 'module'" maybemain "element name" $@2 modulebody "'end'" */ -#line 185 "antimony.ypp" + case 20: /* module: "'model' or 'module'" "element name" $@2 modulebody "'end'" */ +#line 188 "antimony.ypp" { (yyval.module) = g_registry.CurrentModule(); if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2189 "antimony.tab.cpp" +#line 2247 "antimony.tab.cpp" break; - case 20: /* module: "'model' or 'module'" "name of an existing module" */ -#line 190 "antimony.ypp" - {g_registry.SetError("module '" + *((yyvsp[0].word)) + "' already defined."); YYABORT;} -#line 2195 "antimony.tab.cpp" + case 21: /* $@3: %empty */ +#line 193 "antimony.ypp" + {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} +#line 2253 "antimony.tab.cpp" break; - case 21: /* module: "'model' or 'module'" "name of an existing function" */ -#line 191 "antimony.ypp" - {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a module because it is already a defined function."); YYABORT;} -#line 2201 "antimony.tab.cpp" + case 22: /* module: "'model' or 'module'" '*' "element name" $@3 '(' variableexportlist ')' modulebody "'end'" */ +#line 194 "antimony.ypp" + { + (yyval.module) = g_registry.CurrentModule(); + if ((yyval.module)->Finalize()) YYABORT; + g_registry.RevertToPreviousModule(); + } +#line 2263 "antimony.tab.cpp" break; - case 22: /* maybemain: %empty */ -#line 194 "antimony.ypp" - {(yyval.maybemain) = false;} -#line 2207 "antimony.tab.cpp" + case 23: /* $@4: %empty */ +#line 199 "antimony.ypp" + {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} +#line 2269 "antimony.tab.cpp" + break; + + case 24: /* module: "'model' or 'module'" '*' "element name" $@4 modulebody "'end'" */ +#line 200 "antimony.ypp" + { + (yyval.module) = g_registry.CurrentModule(); + if ((yyval.module)->Finalize()) YYABORT; + g_registry.RevertToPreviousModule(); + } +#line 2279 "antimony.tab.cpp" + break; + + case 25: /* module: "'model' or 'module'" "name of an existing module" */ +#line 204 "antimony.ypp" + {g_registry.SetError("module '" + *((yyvsp[0].word)) + "' already defined."); YYABORT;} +#line 2285 "antimony.tab.cpp" break; - case 23: /* maybemain: '*' */ -#line 195 "antimony.ypp" - {(yyval.maybemain) = true;} -#line 2213 "antimony.tab.cpp" + case 26: /* module: "'model' or 'module'" "name of an existing function" */ +#line 205 "antimony.ypp" + {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a module because it is already a defined function."); YYABORT;} +#line 2291 "antimony.tab.cpp" break; - case 24: /* $@3: %empty */ -#line 198 "antimony.ypp" + case 27: /* $@5: %empty */ +#line 208 "antimony.ypp" {g_registry.NewUserFunction((yyvsp[0].word));} -#line 2219 "antimony.tab.cpp" +#line 2297 "antimony.tab.cpp" break; - case 25: /* function: "'function'" "element name" $@3 '(' variableexportlist ')' spacedformula "'end'" */ -#line 198 "antimony.ypp" + case 28: /* function: "'function'" "element name" $@5 '(' variableexportlist ')' spacedformula "'end'" */ +#line 208 "antimony.ypp" {if (g_registry.SetUserFunction((yyvsp[-1].formula))) YYABORT;} -#line 2225 "antimony.tab.cpp" +#line 2303 "antimony.tab.cpp" break; - case 26: /* function: "'function'" "name of an existing module" */ -#line 199 "antimony.ypp" + case 29: /* function: "'function'" "name of an existing module" */ +#line 209 "antimony.ypp" {g_registry.SetError("Cannot use '" + *((yyvsp[0].word)) +"' as a function name because it is already the name of a module."); YYABORT;} -#line 2231 "antimony.tab.cpp" +#line 2309 "antimony.tab.cpp" break; - case 27: /* function: "'function'" "name of an existing function" */ -#line 200 "antimony.ypp" + case 30: /* function: "'function'" "name of an existing function" */ +#line 210 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a new function because it is already a defined function."); YYABORT;} -#line 2237 "antimony.tab.cpp" +#line 2315 "antimony.tab.cpp" break; - case 28: /* spacedformula: formula */ -#line 203 "antimony.ypp" + case 31: /* spacedformula: formula */ +#line 213 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2243 "antimony.tab.cpp" +#line 2321 "antimony.tab.cpp" break; - case 29: /* spacedformula: lineend spacedformula */ -#line 204 "antimony.ypp" + case 32: /* spacedformula: lineend spacedformula */ +#line 214 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2249 "antimony.tab.cpp" +#line 2327 "antimony.tab.cpp" break; - case 30: /* spacedformula: spacedformula lineend */ -#line 205 "antimony.ypp" + case 33: /* spacedformula: spacedformula lineend */ +#line 215 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula);} -#line 2255 "antimony.tab.cpp" +#line 2333 "antimony.tab.cpp" break; - case 31: /* variableexportlist: %empty */ -#line 215 "antimony.ypp" + case 34: /* variableexportlist: %empty */ +#line 225 "antimony.ypp" {} -#line 2261 "antimony.tab.cpp" +#line 2339 "antimony.tab.cpp" break; - case 32: /* variableexportlist: variable */ -#line 216 "antimony.ypp" + case 35: /* variableexportlist: variable */ +#line 226 "antimony.ypp" {if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2267 "antimony.tab.cpp" +#line 2345 "antimony.tab.cpp" break; - case 33: /* variableexportlist: variableexportlist ',' variable */ -#line 217 "antimony.ypp" + case 36: /* variableexportlist: variableexportlist ',' variable */ +#line 227 "antimony.ypp" { if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2273 "antimony.tab.cpp" +#line 2351 "antimony.tab.cpp" break; - case 34: /* variable: "element name" */ -#line 220 "antimony.ypp" + case 37: /* variable: "element name" */ +#line 230 "antimony.ypp" {(yyval.variable) = g_registry.AddVariableToCurrent((yyvsp[0].word)); } -#line 2279 "antimony.tab.cpp" +#line 2357 "antimony.tab.cpp" break; - case 35: /* variable: variable '.' "element name" */ -#line 221 "antimony.ypp" + case 38: /* variable: variable '.' "element name" */ +#line 231 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable)->GetSubVariable((yyvsp[0].word)); if ((yyval.variable) == NULL) { g_registry.SetError("'" + *((yyvsp[0].word)) + "' is not a subvariable of '" + (yyvsp[-2].variable)->GetNameDelimitedBy(".") + "'."); YYABORT; } } -#line 2290 "antimony.tab.cpp" +#line 2368 "antimony.tab.cpp" break; - case 36: /* variable: '$' variable */ -#line 227 "antimony.ypp" + case 39: /* variable: '$' variable */ +#line 237 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable); if ((yyval.variable)->SetIsConst(true)) YYABORT;} -#line 2296 "antimony.tab.cpp" +#line 2374 "antimony.tab.cpp" break; - case 37: /* variablein: variable "'in'" variable */ -#line 230 "antimony.ypp" + case 40: /* variablein: variable "'in'" variable */ +#line 240 "antimony.ypp" {if ((yyvsp[-2].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; (yyval.variable) = (yyvsp[-2].variable);} -#line 2302 "antimony.tab.cpp" +#line 2380 "antimony.tab.cpp" break; - case 38: /* varmaybein: variable */ -#line 233 "antimony.ypp" + case 41: /* varmaybein: variable */ +#line 243 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2308 "antimony.tab.cpp" +#line 2386 "antimony.tab.cpp" break; - case 39: /* varmaybein: variablein */ -#line 234 "antimony.ypp" + case 42: /* varmaybein: variablein */ +#line 244 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2314 "antimony.tab.cpp" +#line 2392 "antimony.tab.cpp" break; - case 40: /* varmaybeis: varmaybein */ -#line 237 "antimony.ypp" + case 43: /* varmaybeis: varmaybein */ +#line 247 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2320 "antimony.tab.cpp" +#line 2398 "antimony.tab.cpp" break; - case 41: /* varmaybeis: varmaybein '=' formula */ -#line 238 "antimony.ypp" + case 44: /* varmaybeis: varmaybein '=' formula */ +#line 248 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 2326 "antimony.tab.cpp" +#line 2404 "antimony.tab.cpp" break; - case 42: /* varmaybeis: varmaybein ':' '=' formula */ -#line 239 "antimony.ypp" + case 45: /* varmaybeis: varmaybein ':' '=' formula */ +#line 249 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT; } -#line 2332 "antimony.tab.cpp" +#line 2410 "antimony.tab.cpp" break; - case 43: /* varmaybeis: varmaybein '\'' '=' formula */ -#line 240 "antimony.ypp" + case 46: /* varmaybeis: varmaybein '\'' '=' formula */ +#line 250 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT; } -#line 2338 "antimony.tab.cpp" +#line 2416 "antimony.tab.cpp" break; - case 44: /* varmaybeis: varmaybein "'has'" unitdef */ -#line 241 "antimony.ypp" + case 47: /* varmaybeis: varmaybein "'has'" unitdef */ +#line 251 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 2344 "antimony.tab.cpp" +#line 2422 "antimony.tab.cpp" break; - case 45: /* maybein: %empty */ -#line 244 "antimony.ypp" + case 48: /* maybein: %empty */ +#line 254 "antimony.ypp" {(yyval.variable) = NULL;} -#line 2350 "antimony.tab.cpp" +#line 2428 "antimony.tab.cpp" break; - case 46: /* maybein: "'in'" variable */ -#line 245 "antimony.ypp" + case 49: /* maybein: "'in'" variable */ +#line 255 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2356 "antimony.tab.cpp" +#line 2434 "antimony.tab.cpp" break; - case 47: /* modulebody: modulepart */ -#line 248 "antimony.ypp" + case 50: /* modulebody: modulepart */ +#line 258 "antimony.ypp" {} -#line 2362 "antimony.tab.cpp" +#line 2440 "antimony.tab.cpp" break; - case 48: /* modulebody: moduleannotation */ -#line 249 "antimony.ypp" + case 51: /* modulebody: moduleannotation */ +#line 259 "antimony.ypp" {} -#line 2368 "antimony.tab.cpp" +#line 2446 "antimony.tab.cpp" break; - case 49: /* modulebody: modulebody modulepart */ -#line 250 "antimony.ypp" + case 52: /* modulebody: modulebody modulepart */ +#line 260 "antimony.ypp" {} -#line 2374 "antimony.tab.cpp" +#line 2452 "antimony.tab.cpp" break; - case 50: /* modulebody: modulebody moduleannotation */ -#line 251 "antimony.ypp" + case 53: /* modulebody: modulebody moduleannotation */ +#line 261 "antimony.ypp" {} -#line 2380 "antimony.tab.cpp" +#line 2458 "antimony.tab.cpp" break; - case 51: /* moduleannotation: "'model' or 'module'" "element name" stringlist lineend */ -#line 255 "antimony.ypp" + case 54: /* moduleannotation: "'model' or 'module'" "element name" stringlist lineend */ +#line 265 "antimony.ypp" { string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCVTerm(&modname,(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT; } -#line 2389 "antimony.tab.cpp" +#line 2467 "antimony.tab.cpp" break; - case 52: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" stringlist lineend */ -#line 260 "antimony.ypp" + case 55: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" stringlist lineend */ +#line 270 "antimony.ypp" { string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT; } -#line 2398 "antimony.tab.cpp" +#line 2476 "antimony.tab.cpp" break; - case 53: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" "number" lineend */ -#line 265 "antimony.ypp" + case 56: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" "number" lineend */ +#line 275 "antimony.ypp" { string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT; } -#line 2407 "antimony.tab.cpp" +#line 2485 "antimony.tab.cpp" break; - case 54: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "number" */ -#line 270 "antimony.ypp" + case 57: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "number" */ +#line 280 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); } else { - g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model this way is 'sboTerm'."); + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a number is 'sboTerm'."); + YYABORT; + } + } +#line 2499 "antimony.tab.cpp" + break; + + case 58: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "element name" */ +#line 290 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[0].word))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + YYABORT; + } + } +#line 2513 "antimony.tab.cpp" + break; + + case 59: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "number" */ +#line 300 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; + } + else if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "layout")) { + if (module->SetLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } +#line 2530 "antimony.tab.cpp" + break; + + case 60: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "element name" */ +#line 313 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; + } + else if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "layout")) { + if (module->SetLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } +#line 2547 "antimony.tab.cpp" + break; + + case 61: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '[' variablelist ']' */ +#line 326 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; + } + else if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "layout")) { + if (module->SetLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } +#line 2564 "antimony.tab.cpp" + break; + + case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '[' numlist ']' */ +#line 339 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; + } + else if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "layout")) { + if (module->SetLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } } -#line 2421 "antimony.tab.cpp" +#line 2581 "antimony.tab.cpp" + break; + + case 63: /* variablelist: variable */ +#line 353 "antimony.ypp" + { std::vector ret; (yyval.variablelist) = ret; (yyval.variablelist).push_back((yyvsp[0].variable));} +#line 2587 "antimony.tab.cpp" + break; + + case 64: /* variablelist: variablelist ',' variable */ +#line 354 "antimony.ypp" + { (yyval.variablelist) = (yyvsp[-2].variablelist); (yyval.variablelist).push_back((yyvsp[0].variable)); } +#line 2593 "antimony.tab.cpp" break; - case 55: /* modulepart: reaction lineend */ -#line 281 "antimony.ypp" + case 65: /* variablelist: variablelist ',' '\n' variable */ +#line 355 "antimony.ypp" + { (yyval.variablelist) = (yyvsp[-3].variablelist); (yyval.variablelist).push_back((yyvsp[0].variable)); } +#line 2599 "antimony.tab.cpp" + break; + + case 66: /* numlist: "number" */ +#line 358 "antimony.ypp" + { std::vector ret; (yyval.numlist) = ret; (yyval.numlist).push_back((yyvsp[0].num)); } +#line 2605 "antimony.tab.cpp" + break; + + case 67: /* numlist: numlist ',' "number" */ +#line 359 "antimony.ypp" + { (yyval.numlist) = (yyvsp[-2].numlist); (yyval.numlist).push_back((yyvsp[0].num)); } +#line 2611 "antimony.tab.cpp" + break; + + case 68: /* numlist: numlist ',' '\n' "number" */ +#line 360 "antimony.ypp" + { (yyval.numlist) = (yyvsp[-3].numlist); (yyval.numlist).push_back((yyvsp[0].num)); } +#line 2617 "antimony.tab.cpp" + break; + + case 69: /* modulepart: reaction lineend */ +#line 363 "antimony.ypp" {} -#line 2427 "antimony.tab.cpp" +#line 2623 "antimony.tab.cpp" break; - case 56: /* modulepart: assignment lineend */ -#line 282 "antimony.ypp" + case 70: /* modulepart: assignment lineend */ +#line 364 "antimony.ypp" {} -#line 2433 "antimony.tab.cpp" +#line 2629 "antimony.tab.cpp" break; - case 57: /* modulepart: submodule lineend */ -#line 283 "antimony.ypp" + case 71: /* modulepart: submodule lineend */ +#line 365 "antimony.ypp" {} -#line 2439 "antimony.tab.cpp" +#line 2635 "antimony.tab.cpp" break; - case 58: /* modulepart: varinitialize lineend */ -#line 284 "antimony.ypp" + case 72: /* modulepart: varinitialize lineend */ +#line 366 "antimony.ypp" {} -#line 2445 "antimony.tab.cpp" +#line 2641 "antimony.tab.cpp" break; - case 59: /* modulepart: dnadef lineend */ -#line 285 "antimony.ypp" + case 73: /* modulepart: dnadef lineend */ +#line 367 "antimony.ypp" {} -#line 2451 "antimony.tab.cpp" +#line 2647 "antimony.tab.cpp" break; - case 60: /* modulepart: event lineend */ -#line 286 "antimony.ypp" + case 74: /* modulepart: event lineend */ +#line 368 "antimony.ypp" {} -#line 2457 "antimony.tab.cpp" +#line 2653 "antimony.tab.cpp" break; - case 61: /* modulepart: unitinit lineend */ -#line 287 "antimony.ypp" + case 75: /* modulepart: unitinit lineend */ +#line 369 "antimony.ypp" {} -#line 2463 "antimony.tab.cpp" +#line 2659 "antimony.tab.cpp" break; - case 62: /* modulepart: deletion lineend */ -#line 288 "antimony.ypp" + case 76: /* modulepart: deletion lineend */ +#line 370 "antimony.ypp" {} -#line 2469 "antimony.tab.cpp" +#line 2665 "antimony.tab.cpp" break; - case 63: /* modulepart: cvterm lineend */ -#line 289 "antimony.ypp" + case 77: /* modulepart: cvterm lineend */ +#line 371 "antimony.ypp" {} -#line 2475 "antimony.tab.cpp" +#line 2671 "antimony.tab.cpp" break; - case 64: /* modulepart: variablein */ -#line 290 "antimony.ypp" + case 78: /* modulepart: variablein */ +#line 372 "antimony.ypp" {} -#line 2481 "antimony.tab.cpp" +#line 2677 "antimony.tab.cpp" break; - case 65: /* modulepart: constraint lineend */ -#line 291 "antimony.ypp" + case 79: /* modulepart: constraint lineend */ +#line 373 "antimony.ypp" {} -#line 2487 "antimony.tab.cpp" +#line 2683 "antimony.tab.cpp" break; - case 66: /* modulepart: objective lineend */ -#line 292 "antimony.ypp" + case 80: /* modulepart: objective lineend */ +#line 374 "antimony.ypp" {} -#line 2493 "antimony.tab.cpp" +#line 2689 "antimony.tab.cpp" break; - case 67: /* modulepart: algrule lineend */ -#line 293 "antimony.ypp" + case 81: /* modulepart: algrule lineend */ +#line 375 "antimony.ypp" {} -#line 2499 "antimony.tab.cpp" +#line 2695 "antimony.tab.cpp" break; - case 68: /* modulepart: lineend */ -#line 294 "antimony.ypp" + case 82: /* modulepart: lineend */ +#line 376 "antimony.ypp" {} -#line 2505 "antimony.tab.cpp" +#line 2701 "antimony.tab.cpp" break; - case 69: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ -#line 298 "antimony.ypp" + case 83: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ +#line 380 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-7].variable), 0); if (var == NULL) YYABORT; @@ -2513,11 +2709,11 @@ yyparse (void) if ((yyvsp[-7].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2517 "antimony.tab.cpp" +#line 2713 "antimony.tab.cpp" break; - case 70: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ -#line 306 "antimony.ypp" + case 84: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ +#line 388 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 0); if (var == NULL) YYABORT; @@ -2525,11 +2721,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2529 "antimony.tab.cpp" +#line 2725 "antimony.tab.cpp" break; - case 71: /* reaction: reactantList reactionDivider ';' formula maybein */ -#line 314 "antimony.ypp" + case 85: /* reaction: reactantList reactionDivider ';' formula maybein */ +#line 396 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), 1); if (var == NULL) YYABORT; @@ -2537,11 +2733,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2541 "antimony.tab.cpp" +#line 2737 "antimony.tab.cpp" break; - case 72: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ -#line 322 "antimony.ypp" + case 86: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ +#line 404 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 1); if (var == NULL) YYABORT; @@ -2549,11 +2745,11 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2553 "antimony.tab.cpp" +#line 2749 "antimony.tab.cpp" break; - case 73: /* reaction: reactionDivider reactantList ';' formula maybein */ -#line 330 "antimony.ypp" + case 87: /* reaction: reactionDivider reactantList ';' formula maybein */ +#line 412 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 2); if (var == NULL) YYABORT; @@ -2561,11 +2757,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2565 "antimony.tab.cpp" +#line 2761 "antimony.tab.cpp" break; - case 74: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ -#line 338 "antimony.ypp" + case 88: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ +#line 420 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 2); if (var == NULL) YYABORT; @@ -2573,843 +2769,843 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2577 "antimony.tab.cpp" +#line 2773 "antimony.tab.cpp" break; - case 75: /* reactantList: variable */ -#line 347 "antimony.ypp" + case 89: /* reactantList: variable */ +#line 429 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2583 "antimony.tab.cpp" +#line 2779 "antimony.tab.cpp" break; - case 76: /* reactantList: "number" variable */ -#line 348 "antimony.ypp" + case 90: /* reactantList: "number" variable */ +#line 430 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2589 "antimony.tab.cpp" +#line 2785 "antimony.tab.cpp" break; - case 77: /* reactantList: variable variable */ -#line 349 "antimony.ypp" + case 91: /* reactantList: variable variable */ +#line 431 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2595 "antimony.tab.cpp" +#line 2791 "antimony.tab.cpp" break; - case 78: /* reactantList: reactantList '+' variable */ -#line 350 "antimony.ypp" + case 92: /* reactantList: reactantList '+' variable */ +#line 432 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-2].reactantList); if((yyvsp[-2].reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2601 "antimony.tab.cpp" +#line 2797 "antimony.tab.cpp" break; - case 79: /* reactantList: reactantList '+' "number" variable */ -#line 351 "antimony.ypp" + case 93: /* reactantList: reactantList '+' "number" variable */ +#line 433 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2607 "antimony.tab.cpp" +#line 2803 "antimony.tab.cpp" break; - case 80: /* reactantList: reactantList '+' variable variable */ -#line 352 "antimony.ypp" + case 94: /* reactantList: reactantList '+' variable variable */ +#line 434 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2613 "antimony.tab.cpp" +#line 2809 "antimony.tab.cpp" break; - case 81: /* reactionDivider: "->" */ -#line 356 "antimony.ypp" + case 95: /* reactionDivider: "->" */ +#line 438 "antimony.ypp" {(yyval.reactionDivider) = rdBecomes;} -#line 2619 "antimony.tab.cpp" +#line 2815 "antimony.tab.cpp" break; - case 82: /* reactionDivider: "-|" */ -#line 357 "antimony.ypp" + case 96: /* reactionDivider: "-|" */ +#line 439 "antimony.ypp" {(yyval.reactionDivider) = rdInhibits;} -#line 2625 "antimony.tab.cpp" +#line 2821 "antimony.tab.cpp" break; - case 83: /* reactionDivider: '-' '(' */ -#line 358 "antimony.ypp" + case 97: /* reactionDivider: '-' '(' */ +#line 440 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2631 "antimony.tab.cpp" +#line 2827 "antimony.tab.cpp" break; - case 84: /* reactionDivider: "-o" */ -#line 359 "antimony.ypp" + case 98: /* reactionDivider: "-o" */ +#line 441 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2637 "antimony.tab.cpp" +#line 2833 "antimony.tab.cpp" break; - case 85: /* reactionDivider: "=>" */ -#line 360 "antimony.ypp" + case 99: /* reactionDivider: "=>" */ +#line 442 "antimony.ypp" {(yyval.reactionDivider) = rdBecomesIrreversibly;} -#line 2643 "antimony.tab.cpp" +#line 2839 "antimony.tab.cpp" break; - case 86: /* formula: %empty */ -#line 363 "antimony.ypp" + case 100: /* formula: %empty */ +#line 445 "antimony.ypp" {(yyval.formula) = g_registry.NewBlankFormula(); } -#line 2649 "antimony.tab.cpp" +#line 2845 "antimony.tab.cpp" break; - case 87: /* formula: formula "..." */ -#line 364 "antimony.ypp" + case 101: /* formula: formula "..." */ +#line 446 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddEllipses();} -#line 2655 "antimony.tab.cpp" +#line 2851 "antimony.tab.cpp" break; - case 88: /* formula: formula variable */ -#line 365 "antimony.ypp" + case 102: /* formula: formula variable */ +#line 447 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); if((yyvsp[-1].formula)->AddVariable((yyvsp[0].variable))) YYABORT; } -#line 2661 "antimony.tab.cpp" +#line 2857 "antimony.tab.cpp" break; - case 89: /* formula: formula "number" */ -#line 366 "antimony.ypp" + case 103: /* formula: formula "number" */ +#line 448 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddNum((yyvsp[0].num)); } -#line 2667 "antimony.tab.cpp" +#line 2863 "antimony.tab.cpp" break; - case 90: /* formula: formula "name of a pre-defined constant" */ -#line 367 "antimony.ypp" + case 104: /* formula: formula "name of a pre-defined constant" */ +#line 449 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2673 "antimony.tab.cpp" +#line 2869 "antimony.tab.cpp" break; - case 91: /* formula: formula "name of an existing function" */ -#line 368 "antimony.ypp" + case 105: /* formula: formula "name of an existing function" */ +#line 450 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2679 "antimony.tab.cpp" +#line 2875 "antimony.tab.cpp" break; - case 92: /* formula: formula '(' commaformula ')' */ -#line 369 "antimony.ypp" + case 106: /* formula: formula '(' commaformula ')' */ +#line 451 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddParentheses(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2685 "antimony.tab.cpp" +#line 2881 "antimony.tab.cpp" break; - case 93: /* formula: formula '{' commaformula '}' */ -#line 370 "antimony.ypp" + case 107: /* formula: formula '{' commaformula '}' */ +#line 452 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddCurlyBrackets(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2691 "antimony.tab.cpp" +#line 2887 "antimony.tab.cpp" break; - case 94: /* formula: formula mathThing */ -#line 371 "antimony.ypp" + case 108: /* formula: formula mathThing */ +#line 453 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddMathThing((yyvsp[0].character)); } -#line 2697 "antimony.tab.cpp" +#line 2893 "antimony.tab.cpp" break; - case 95: /* formula: formula inequality */ -#line 372 "antimony.ypp" + case 109: /* formula: formula inequality */ +#line 454 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddInequality((yyvsp[0].inequality)); } -#line 2703 "antimony.tab.cpp" +#line 2899 "antimony.tab.cpp" break; - case 96: /* formula: formula '=' '=' */ -#line 373 "antimony.ypp" + case 110: /* formula: formula '=' '=' */ +#line 455 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('='); (yyvsp[-2].formula)->AddMathThing('='); } -#line 2709 "antimony.tab.cpp" +#line 2905 "antimony.tab.cpp" break; - case 97: /* formula: formula '&' '&' */ -#line 374 "antimony.ypp" + case 111: /* formula: formula '&' '&' */ +#line 456 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('&'); (yyvsp[-2].formula)->AddMathThing('&'); } -#line 2715 "antimony.tab.cpp" +#line 2911 "antimony.tab.cpp" break; - case 98: /* formula: formula '|' '|' */ -#line 375 "antimony.ypp" + case 112: /* formula: formula '|' '|' */ +#line 457 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('|'); (yyvsp[-2].formula)->AddMathThing('|'); } -#line 2721 "antimony.tab.cpp" +#line 2917 "antimony.tab.cpp" break; - case 99: /* commaformula: formula */ -#line 378 "antimony.ypp" + case 113: /* commaformula: formula */ +#line 460 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2727 "antimony.tab.cpp" +#line 2923 "antimony.tab.cpp" break; - case 100: /* commaformula: commaformula ',' formula */ -#line 379 "antimony.ypp" + case 114: /* commaformula: commaformula ',' formula */ +#line 461 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyval.formula)->AddMathThing(','); (yyval.formula)->AddFormula((yyvsp[0].formula)); } -#line 2733 "antimony.tab.cpp" +#line 2929 "antimony.tab.cpp" break; - case 101: /* mathThing: '+' */ -#line 382 "antimony.ypp" + case 115: /* mathThing: '+' */ +#line 464 "antimony.ypp" {(yyval.character) = '+';} -#line 2739 "antimony.tab.cpp" +#line 2935 "antimony.tab.cpp" break; - case 102: /* mathThing: '-' */ -#line 383 "antimony.ypp" + case 116: /* mathThing: '-' */ +#line 465 "antimony.ypp" {(yyval.character) = '-';} -#line 2745 "antimony.tab.cpp" +#line 2941 "antimony.tab.cpp" break; - case 103: /* mathThing: '*' */ -#line 384 "antimony.ypp" + case 117: /* mathThing: '*' */ +#line 466 "antimony.ypp" {(yyval.character) = '*';} -#line 2751 "antimony.tab.cpp" +#line 2947 "antimony.tab.cpp" break; - case 104: /* mathThing: '/' */ -#line 385 "antimony.ypp" + case 118: /* mathThing: '/' */ +#line 467 "antimony.ypp" {(yyval.character) = '/';} -#line 2757 "antimony.tab.cpp" +#line 2953 "antimony.tab.cpp" break; - case 105: /* mathThing: '^' */ -#line 386 "antimony.ypp" + case 119: /* mathThing: '^' */ +#line 468 "antimony.ypp" {(yyval.character) = '^';} -#line 2763 "antimony.tab.cpp" +#line 2959 "antimony.tab.cpp" break; - case 106: /* mathThing: '!' */ -#line 387 "antimony.ypp" + case 120: /* mathThing: '!' */ +#line 469 "antimony.ypp" {(yyval.character) = '!';} -#line 2769 "antimony.tab.cpp" +#line 2965 "antimony.tab.cpp" break; - case 107: /* mathThing: '%' */ -#line 388 "antimony.ypp" + case 121: /* mathThing: '%' */ +#line 470 "antimony.ypp" {(yyval.character) = '%';} -#line 2775 "antimony.tab.cpp" +#line 2971 "antimony.tab.cpp" break; - case 108: /* inequality: '<' */ -#line 391 "antimony.ypp" + case 122: /* inequality: '<' */ +#line 473 "antimony.ypp" {(yyval.inequality) = constLT;} -#line 2781 "antimony.tab.cpp" +#line 2977 "antimony.tab.cpp" break; - case 109: /* inequality: "<=" */ -#line 392 "antimony.ypp" + case 123: /* inequality: "<=" */ +#line 474 "antimony.ypp" {(yyval.inequality) = constLEQ;} -#line 2787 "antimony.tab.cpp" +#line 2983 "antimony.tab.cpp" break; - case 110: /* inequality: '>' */ -#line 393 "antimony.ypp" + case 124: /* inequality: '>' */ +#line 475 "antimony.ypp" {(yyval.inequality) = constGT;} -#line 2793 "antimony.tab.cpp" +#line 2989 "antimony.tab.cpp" break; - case 111: /* inequality: ">=" */ -#line 394 "antimony.ypp" + case 125: /* inequality: ">=" */ +#line 476 "antimony.ypp" {(yyval.inequality) = constGEQ;} -#line 2799 "antimony.tab.cpp" +#line 2995 "antimony.tab.cpp" break; - case 112: /* inequality: "!=" */ -#line 395 "antimony.ypp" + case 126: /* inequality: "!=" */ +#line 477 "antimony.ypp" {(yyval.inequality) = constNEQ;} -#line 2805 "antimony.tab.cpp" +#line 3001 "antimony.tab.cpp" break; - case 113: /* lineend: ';' */ -#line 398 "antimony.ypp" + case 127: /* lineend: ';' */ +#line 480 "antimony.ypp" {} -#line 2811 "antimony.tab.cpp" +#line 3007 "antimony.tab.cpp" break; - case 114: /* lineend: '\n' */ -#line 399 "antimony.ypp" + case 128: /* lineend: '\n' */ +#line 481 "antimony.ypp" {} -#line 2817 "antimony.tab.cpp" +#line 3013 "antimony.tab.cpp" break; - case 115: /* lineend: "end of line" */ -#line 400 "antimony.ypp" + case 129: /* lineend: "end of line" */ +#line 482 "antimony.ypp" {} -#line 2823 "antimony.tab.cpp" +#line 3019 "antimony.tab.cpp" break; - case 116: /* assignment: varmaybein ':' maxormin formula */ -#line 403 "antimony.ypp" + case 130: /* assignment: varmaybein ':' maxormin formula */ +#line 485 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[-3].variable), (yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 2829 "antimony.tab.cpp" +#line 3025 "antimony.tab.cpp" break; - case 117: /* assignment: varmaybein '=' formula */ -#line 404 "antimony.ypp" + case 131: /* assignment: varmaybein '=' formula */ +#line 486 "antimony.ypp" {if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 2835 "antimony.tab.cpp" +#line 3031 "antimony.tab.cpp" break; - case 118: /* assignment: varmaybein "'is'" variable */ -#line 405 "antimony.ypp" + case 132: /* assignment: varmaybein "'is'" variable */ +#line 487 "antimony.ypp" {if ((yyvsp[-2].variable)->Synchronize((yyvsp[0].variable), NULL)) YYABORT;} -#line 2841 "antimony.tab.cpp" +#line 3037 "antimony.tab.cpp" break; - case 119: /* assignment: varmaybein "'is'" variable '/' variable */ -#line 406 "antimony.ypp" + case 133: /* assignment: varmaybein "'is'" variable '/' variable */ +#line 488 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[-2].variable), (yyvsp[0].variable))) YYABORT;} -#line 2847 "antimony.tab.cpp" +#line 3043 "antimony.tab.cpp" break; - case 120: /* assignment: varmaybein '*' variable "'is'" variable */ -#line 407 "antimony.ypp" + case 134: /* assignment: varmaybein '*' variable "'is'" variable */ +#line 489 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[0].variable), (yyvsp[-2].variable))) YYABORT;} -#line 2853 "antimony.tab.cpp" +#line 3049 "antimony.tab.cpp" break; - case 121: /* assignment: varmaybein "'is'" "text string" */ -#line 408 "antimony.ypp" + case 135: /* assignment: varmaybein "'is'" "text string" */ +#line 490 "antimony.ypp" {if ((yyvsp[-2].variable)->SetDisplayName(*((yyvsp[0].word)))) YYABORT;} -#line 2859 "antimony.tab.cpp" +#line 3055 "antimony.tab.cpp" break; - case 122: /* assignment: varmaybein ':' '=' formula */ -#line 409 "antimony.ypp" + case 136: /* assignment: varmaybein ':' '=' formula */ +#line 491 "antimony.ypp" {if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT;} -#line 2865 "antimony.tab.cpp" +#line 3061 "antimony.tab.cpp" break; - case 123: /* assignment: varmaybein '\'' '=' formula */ -#line 410 "antimony.ypp" + case 137: /* assignment: varmaybein '\'' '=' formula */ +#line 492 "antimony.ypp" {if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT;} -#line 2871 "antimony.tab.cpp" +#line 3067 "antimony.tab.cpp" break; - case 124: /* assignment: varmaybein "'has'" unitdef */ -#line 411 "antimony.ypp" + case 138: /* assignment: varmaybein "'has'" unitdef */ +#line 493 "antimony.ypp" {if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 2877 "antimony.tab.cpp" +#line 3073 "antimony.tab.cpp" break; - case 125: /* algrule: "number" '=' formula */ -#line 415 "antimony.ypp" + case 139: /* algrule: "number" '=' formula */ +#line 497 "antimony.ypp" {if (g_registry.AddNewAlgebraicRuleToCurrent((yyvsp[-2].num), (yyvsp[0].formula))) YYABORT; } -#line 2883 "antimony.tab.cpp" +#line 3079 "antimony.tab.cpp" break; - case 126: /* algrule: varmaybein ':' "number" '=' formula */ -#line 416 "antimony.ypp" + case 140: /* algrule: varmaybein ':' "number" '=' formula */ +#line 498 "antimony.ypp" {if ((yyvsp[-4].variable)->SetAlgebraicRule((yyvsp[-2].num), (yyvsp[0].formula)) ) YYABORT;} -#line 2889 "antimony.tab.cpp" +#line 3085 "antimony.tab.cpp" break; - case 127: /* $@4: %empty */ -#line 419 "antimony.ypp" + case 141: /* $@6: %empty */ +#line 501 "antimony.ypp" {if ((yyvsp[-3].variable)->SetModule((yyvsp[-1].word))) YYABORT;} -#line 2895 "antimony.tab.cpp" +#line 3091 "antimony.tab.cpp" break; - case 128: /* submodule: varmaybein ':' "name of an existing module" '(' $@4 variableimportlist ')' submodifications maybein */ -#line 419 "antimony.ypp" + case 142: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ +#line 501 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if ((yyvsp[-8].variable)->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 2901 "antimony.tab.cpp" +#line 3097 "antimony.tab.cpp" break; - case 129: /* $@5: %empty */ -#line 420 "antimony.ypp" + case 143: /* $@7: %empty */ +#line 502 "antimony.ypp" {if(g_registry.CurrentModule()->SetModule((yyvsp[-1].word))) YYABORT;} -#line 2907 "antimony.tab.cpp" +#line 3103 "antimony.tab.cpp" break; - case 130: /* submodule: "name of an existing module" '(' $@5 variableimportlist ')' submodifications maybein */ -#line 420 "antimony.ypp" + case 144: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ +#line 502 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if (g_registry.GetCurrentSubmodel()->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 2913 "antimony.tab.cpp" +#line 3109 "antimony.tab.cpp" break; - case 131: /* variableimportlist: %empty */ -#line 424 "antimony.ypp" + case 145: /* variableimportlist: %empty */ +#line 506 "antimony.ypp" {} -#line 2919 "antimony.tab.cpp" +#line 3115 "antimony.tab.cpp" break; - case 132: /* variableimportlist: variable */ -#line 425 "antimony.ypp" + case 146: /* variableimportlist: variable */ +#line 507 "antimony.ypp" {if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 2925 "antimony.tab.cpp" +#line 3121 "antimony.tab.cpp" break; - case 133: /* variableimportlist: variableimportlist ',' variable */ -#line 426 "antimony.ypp" + case 147: /* variableimportlist: variableimportlist ',' variable */ +#line 508 "antimony.ypp" { if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 2931 "antimony.tab.cpp" +#line 3127 "antimony.tab.cpp" break; - case 134: /* variableimportlist: "number" */ -#line 427 "antimony.ypp" + case 148: /* variableimportlist: "number" */ +#line 509 "antimony.ypp" {if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 2937 "antimony.tab.cpp" +#line 3133 "antimony.tab.cpp" break; - case 135: /* variableimportlist: variableimportlist ',' "number" */ -#line 428 "antimony.ypp" + case 149: /* variableimportlist: variableimportlist ',' "number" */ +#line 510 "antimony.ypp" { if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 2943 "antimony.tab.cpp" +#line 3139 "antimony.tab.cpp" break; - case 136: /* submodifications: %empty */ -#line 432 "antimony.ypp" + case 150: /* submodifications: %empty */ +#line 514 "antimony.ypp" {} -#line 2949 "antimony.tab.cpp" +#line 3145 "antimony.tab.cpp" break; - case 137: /* submodifications: submodifications ',' "element name" '=' variable */ -#line 433 "antimony.ypp" + case 151: /* submodifications: submodifications ',' "element name" '=' variable */ +#line 515 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].variable));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].variable))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 2957 "antimony.tab.cpp" +#line 3153 "antimony.tab.cpp" break; - case 138: /* submodifications: submodifications ',' "element name" '=' "number" */ -#line 437 "antimony.ypp" + case 152: /* submodifications: submodifications ',' "element name" '=' "number" */ +#line 519 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].num));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].num))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 2965 "antimony.tab.cpp" +#line 3161 "antimony.tab.cpp" break; - case 139: /* varinitialize: specinit */ -#line 441 "antimony.ypp" + case 153: /* varinitialize: specinit */ +#line 523 "antimony.ypp" { } -#line 2971 "antimony.tab.cpp" +#line 3167 "antimony.tab.cpp" break; - case 140: /* varinitialize: formulainit */ -#line 442 "antimony.ypp" + case 154: /* varinitialize: formulainit */ +#line 524 "antimony.ypp" { } -#line 2977 "antimony.tab.cpp" +#line 3173 "antimony.tab.cpp" break; - case 141: /* varinitialize: reactioninit */ -#line 443 "antimony.ypp" + case 155: /* varinitialize: reactioninit */ +#line 525 "antimony.ypp" { } -#line 2983 "antimony.tab.cpp" +#line 3179 "antimony.tab.cpp" break; - case 142: /* varinitialize: dnainit */ -#line 444 "antimony.ypp" + case 156: /* varinitialize: dnainit */ +#line 526 "antimony.ypp" { } -#line 2989 "antimony.tab.cpp" +#line 3185 "antimony.tab.cpp" break; - case 143: /* varinitialize: geneinit */ -#line 445 "antimony.ypp" + case 157: /* varinitialize: geneinit */ +#line 527 "antimony.ypp" { } -#line 2995 "antimony.tab.cpp" +#line 3191 "antimony.tab.cpp" break; - case 144: /* varinitialize: operatorinit */ -#line 446 "antimony.ypp" + case 158: /* varinitialize: operatorinit */ +#line 528 "antimony.ypp" { } -#line 3001 "antimony.tab.cpp" +#line 3197 "antimony.tab.cpp" break; - case 145: /* varinitialize: compartmentinit */ -#line 447 "antimony.ypp" + case 159: /* varinitialize: compartmentinit */ +#line 529 "antimony.ypp" { } -#line 3007 "antimony.tab.cpp" +#line 3203 "antimony.tab.cpp" break; - case 146: /* varinitialize: varconstinit */ -#line 448 "antimony.ypp" + case 160: /* varinitialize: varconstinit */ +#line 530 "antimony.ypp" { } -#line 3013 "antimony.tab.cpp" +#line 3209 "antimony.tab.cpp" break; - case 147: /* specinit: "'species'" varmaybeis */ -#line 451 "antimony.ypp" + case 161: /* specinit: "'species'" varmaybeis */ +#line 533 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3019 "antimony.tab.cpp" +#line 3215 "antimony.tab.cpp" break; - case 148: /* specinit: "'var'" "'species'" varmaybeis */ -#line 452 "antimony.ypp" + case 162: /* specinit: "'var'" "'species'" varmaybeis */ +#line 534 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3025 "antimony.tab.cpp" +#line 3221 "antimony.tab.cpp" break; - case 149: /* specinit: "'const'" "'species'" varmaybeis */ -#line 453 "antimony.ypp" + case 163: /* specinit: "'const'" "'species'" varmaybeis */ +#line 535 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3031 "antimony.tab.cpp" +#line 3227 "antimony.tab.cpp" break; - case 150: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ -#line 454 "antimony.ypp" + case 164: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ +#line 536 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3037 "antimony.tab.cpp" +#line 3233 "antimony.tab.cpp" break; - case 151: /* specinit: "'substanceOnly'" varmaybeis */ -#line 455 "antimony.ypp" + case 165: /* specinit: "'substanceOnly'" varmaybeis */ +#line 537 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3043 "antimony.tab.cpp" +#line 3239 "antimony.tab.cpp" break; - case 152: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ -#line 456 "antimony.ypp" + case 166: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ +#line 538 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3049 "antimony.tab.cpp" +#line 3245 "antimony.tab.cpp" break; - case 153: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ -#line 457 "antimony.ypp" + case 167: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ +#line 539 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3055 "antimony.tab.cpp" +#line 3251 "antimony.tab.cpp" break; - case 154: /* specinit: specinit ',' varmaybeis */ -#line 458 "antimony.ypp" + case 168: /* specinit: specinit ',' varmaybeis */ +#line 540 "antimony.ypp" {(yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3061 "antimony.tab.cpp" +#line 3257 "antimony.tab.cpp" break; - case 155: /* formulainit: "'formula'" varmaybeis */ -#line 461 "antimony.ypp" + case 169: /* formulainit: "'formula'" varmaybeis */ +#line 543 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3067 "antimony.tab.cpp" +#line 3263 "antimony.tab.cpp" break; - case 156: /* formulainit: "'var'" "'formula'" varmaybeis */ -#line 462 "antimony.ypp" + case 170: /* formulainit: "'var'" "'formula'" varmaybeis */ +#line 544 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3073 "antimony.tab.cpp" +#line 3269 "antimony.tab.cpp" break; - case 157: /* formulainit: "'const'" "'formula'" varmaybeis */ -#line 463 "antimony.ypp" + case 171: /* formulainit: "'const'" "'formula'" varmaybeis */ +#line 545 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3079 "antimony.tab.cpp" +#line 3275 "antimony.tab.cpp" break; - case 158: /* formulainit: formulainit ',' varmaybeis */ -#line 464 "antimony.ypp" + case 172: /* formulainit: formulainit ',' varmaybeis */ +#line 546 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3085 "antimony.tab.cpp" +#line 3281 "antimony.tab.cpp" break; - case 159: /* reactioninit: "'reaction'" varmaybeis */ -#line 467 "antimony.ypp" + case 173: /* reactioninit: "'reaction'" varmaybeis */ +#line 549 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3091 "antimony.tab.cpp" +#line 3287 "antimony.tab.cpp" break; - case 160: /* reactioninit: "'var'" "'reaction'" varmaybeis */ -#line 468 "antimony.ypp" + case 174: /* reactioninit: "'var'" "'reaction'" varmaybeis */ +#line 550 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3097 "antimony.tab.cpp" +#line 3293 "antimony.tab.cpp" break; - case 161: /* reactioninit: "'const'" "'reaction'" */ -#line 469 "antimony.ypp" + case 175: /* reactioninit: "'const'" "'reaction'" */ +#line 551 "antimony.ypp" {g_registry.SetError("Reactions may not be set 'const'."); YYABORT; } -#line 3103 "antimony.tab.cpp" +#line 3299 "antimony.tab.cpp" break; - case 162: /* reactioninit: reactioninit ',' varmaybeis */ -#line 470 "antimony.ypp" + case 176: /* reactioninit: reactioninit ',' varmaybeis */ +#line 552 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3109 "antimony.tab.cpp" +#line 3305 "antimony.tab.cpp" break; - case 163: /* dnainit: "'DNA'" varmaybeis */ -#line 473 "antimony.ypp" + case 177: /* dnainit: "'DNA'" varmaybeis */ +#line 555 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3115 "antimony.tab.cpp" +#line 3311 "antimony.tab.cpp" break; - case 164: /* dnainit: "'var'" "'DNA'" varmaybeis */ -#line 474 "antimony.ypp" + case 178: /* dnainit: "'var'" "'DNA'" varmaybeis */ +#line 556 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3121 "antimony.tab.cpp" +#line 3317 "antimony.tab.cpp" break; - case 165: /* dnainit: "'const'" "'DNA'" varmaybeis */ -#line 475 "antimony.ypp" + case 179: /* dnainit: "'const'" "'DNA'" varmaybeis */ +#line 557 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3127 "antimony.tab.cpp" +#line 3323 "antimony.tab.cpp" break; - case 166: /* dnainit: dnainit ',' varmaybeis */ -#line 476 "antimony.ypp" + case 180: /* dnainit: dnainit ',' varmaybeis */ +#line 558 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3133 "antimony.tab.cpp" +#line 3329 "antimony.tab.cpp" break; - case 167: /* geneinit: "'gene'" varmaybeis */ -#line 479 "antimony.ypp" + case 181: /* geneinit: "'gene'" varmaybeis */ +#line 561 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3139 "antimony.tab.cpp" +#line 3335 "antimony.tab.cpp" break; - case 168: /* geneinit: "'var'" "'gene'" varmaybeis */ -#line 480 "antimony.ypp" + case 182: /* geneinit: "'var'" "'gene'" varmaybeis */ +#line 562 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3145 "antimony.tab.cpp" +#line 3341 "antimony.tab.cpp" break; - case 169: /* geneinit: "'const'" "'gene'" varmaybeis */ -#line 481 "antimony.ypp" + case 183: /* geneinit: "'const'" "'gene'" varmaybeis */ +#line 563 "antimony.ypp" {g_registry.SetError("Genes may not be set 'const'."); YYABORT; } -#line 3151 "antimony.tab.cpp" +#line 3347 "antimony.tab.cpp" break; - case 170: /* geneinit: geneinit ',' varmaybeis */ -#line 482 "antimony.ypp" + case 184: /* geneinit: geneinit ',' varmaybeis */ +#line 564 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3157 "antimony.tab.cpp" +#line 3353 "antimony.tab.cpp" break; - case 171: /* operatorinit: "'operator'" varmaybeis */ -#line 485 "antimony.ypp" + case 185: /* operatorinit: "'operator'" varmaybeis */ +#line 567 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3163 "antimony.tab.cpp" +#line 3359 "antimony.tab.cpp" break; - case 172: /* operatorinit: "'var'" "'operator'" varmaybeis */ -#line 486 "antimony.ypp" + case 186: /* operatorinit: "'var'" "'operator'" varmaybeis */ +#line 568 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3169 "antimony.tab.cpp" +#line 3365 "antimony.tab.cpp" break; - case 173: /* operatorinit: "'const'" "'operator'" varmaybeis */ -#line 487 "antimony.ypp" + case 187: /* operatorinit: "'const'" "'operator'" varmaybeis */ +#line 569 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3175 "antimony.tab.cpp" +#line 3371 "antimony.tab.cpp" break; - case 174: /* operatorinit: operatorinit ',' varmaybeis */ -#line 488 "antimony.ypp" + case 188: /* operatorinit: operatorinit ',' varmaybeis */ +#line 570 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3181 "antimony.tab.cpp" +#line 3377 "antimony.tab.cpp" break; - case 175: /* compartmentinit: "'compartment'" varmaybeis */ -#line 492 "antimony.ypp" + case 189: /* compartmentinit: "'compartment'" varmaybeis */ +#line 574 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3187 "antimony.tab.cpp" +#line 3383 "antimony.tab.cpp" break; - case 176: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ -#line 493 "antimony.ypp" + case 190: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ +#line 575 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3193 "antimony.tab.cpp" +#line 3389 "antimony.tab.cpp" break; - case 177: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ -#line 494 "antimony.ypp" + case 191: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ +#line 576 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3199 "antimony.tab.cpp" +#line 3395 "antimony.tab.cpp" break; - case 178: /* compartmentinit: compartmentinit ',' varmaybeis */ -#line 495 "antimony.ypp" + case 192: /* compartmentinit: compartmentinit ',' varmaybeis */ +#line 577 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3205 "antimony.tab.cpp" +#line 3401 "antimony.tab.cpp" break; - case 179: /* varconstinit: "'var'" varmaybeis */ -#line 498 "antimony.ypp" + case 193: /* varconstinit: "'var'" varmaybeis */ +#line 580 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst();} -#line 3211 "antimony.tab.cpp" +#line 3407 "antimony.tab.cpp" break; - case 180: /* varconstinit: "'const'" varmaybeis */ -#line 499 "antimony.ypp" + case 194: /* varconstinit: "'const'" varmaybeis */ +#line 581 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst();} -#line 3217 "antimony.tab.cpp" +#line 3413 "antimony.tab.cpp" break; - case 181: /* varconstinit: varconstinit ',' varmaybeis */ -#line 500 "antimony.ypp" + case 195: /* varconstinit: varconstinit ',' varmaybeis */ +#line 582 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst();} -#line 3223 "antimony.tab.cpp" +#line 3419 "antimony.tab.cpp" break; - case 182: /* unitinit: "'unit'" variable '=' formula */ -#line 503 "antimony.ypp" + case 196: /* unitinit: "'unit'" variable '=' formula */ +#line 585 "antimony.ypp" {if ((yyvsp[-2].variable)->SetType(varUnitDefinition)) YYABORT; if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[-2].variable)->GetUnitDef()->SetFromFormula((yyvsp[0].formula))) YYABORT;} -#line 3231 "antimony.tab.cpp" +#line 3427 "antimony.tab.cpp" break; - case 183: /* unitinit: "'unit'" variable */ -#line 506 "antimony.ypp" + case 197: /* unitinit: "'unit'" variable */ +#line 588 "antimony.ypp" {if ((yyvsp[0].variable)->SetType(varUnitDefinition)) YYABORT;} -#line 3237 "antimony.tab.cpp" +#line 3433 "antimony.tab.cpp" break; - case 184: /* dnadef: dnastrand */ -#line 509 "antimony.ypp" + case 198: /* dnadef: dnastrand */ +#line 591 "antimony.ypp" {if (g_registry.SaveWorkingStrand()) YYABORT;} -#line 3243 "antimony.tab.cpp" +#line 3439 "antimony.tab.cpp" break; - case 185: /* dnadef: varmaybein ':' dnastrand */ -#line 510 "antimony.ypp" + case 199: /* dnadef: varmaybein ':' dnastrand */ +#line 592 "antimony.ypp" {if (g_registry.SetStrandAs((yyvsp[-2].variable))) YYABORT;} -#line 3249 "antimony.tab.cpp" +#line 3445 "antimony.tab.cpp" break; - case 186: /* dnastrand: "--" variable */ -#line 513 "antimony.ypp" + case 200: /* dnastrand: "--" variable */ +#line 595 "antimony.ypp" {if (g_registry.SetNewUpstreamOpen((yyvsp[0].variable))) YYABORT;} -#line 3255 "antimony.tab.cpp" +#line 3451 "antimony.tab.cpp" break; - case 187: /* dnastrand: "--" dnamiddle */ -#line 514 "antimony.ypp" + case 201: /* dnastrand: "--" dnamiddle */ +#line 596 "antimony.ypp" {g_registry.SetOpenUpstream(); } -#line 3261 "antimony.tab.cpp" +#line 3457 "antimony.tab.cpp" break; - case 188: /* dnastrand: dnamiddle variable */ -#line 515 "antimony.ypp" + case 202: /* dnastrand: dnamiddle variable */ +#line 597 "antimony.ypp" {if (g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3267 "antimony.tab.cpp" +#line 3463 "antimony.tab.cpp" break; - case 189: /* dnastrand: "--" dnamiddle variable */ -#line 516 "antimony.ypp" + case 203: /* dnastrand: "--" dnamiddle variable */ +#line 598 "antimony.ypp" {g_registry.SetOpenUpstream(); if(g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3273 "antimony.tab.cpp" +#line 3469 "antimony.tab.cpp" break; - case 190: /* dnastrand: dnamiddle */ -#line 517 "antimony.ypp" + case 204: /* dnastrand: dnamiddle */ +#line 599 "antimony.ypp" { } -#line 3279 "antimony.tab.cpp" +#line 3475 "antimony.tab.cpp" break; - case 191: /* dnamiddle: variable "--" */ -#line 520 "antimony.ypp" + case 205: /* dnamiddle: variable "--" */ +#line 602 "antimony.ypp" {if (g_registry.SetNewDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3285 "antimony.tab.cpp" +#line 3481 "antimony.tab.cpp" break; - case 192: /* dnamiddle: dnamiddle variable "--" */ -#line 521 "antimony.ypp" + case 206: /* dnamiddle: dnamiddle variable "--" */ +#line 603 "antimony.ypp" {if (g_registry.SetDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3291 "antimony.tab.cpp" +#line 3487 "antimony.tab.cpp" break; - case 193: /* $@6: %empty */ -#line 524 "antimony.ypp" + case 207: /* $@8: %empty */ +#line 606 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula))) YYABORT;} -#line 3297 "antimony.tab.cpp" +#line 3493 "antimony.tab.cpp" break; - case 194: /* event: "'at'" formula $@6 eventmodifications colonret assignmentlist */ -#line 524 "antimony.ypp" + case 208: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ +#line 606 "antimony.ypp" {} -#line 3303 "antimony.tab.cpp" +#line 3499 "antimony.tab.cpp" break; - case 195: /* $@7: %empty */ -#line 525 "antimony.ypp" + case 209: /* $@9: %empty */ +#line 607 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula))) YYABORT;} -#line 3309 "antimony.tab.cpp" +#line 3505 "antimony.tab.cpp" break; - case 196: /* event: "'at'" formula "'after'" formula $@7 eventmodifications colonret assignmentlist */ -#line 525 "antimony.ypp" + case 210: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ +#line 607 "antimony.ypp" {} -#line 3315 "antimony.tab.cpp" +#line 3511 "antimony.tab.cpp" break; - case 197: /* $@8: %empty */ -#line 526 "antimony.ypp" + case 211: /* $@10: %empty */ +#line 608 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula), (yyvsp[-3].variable))) YYABORT;} -#line 3321 "antimony.tab.cpp" +#line 3517 "antimony.tab.cpp" break; - case 198: /* event: varmaybein ':' "'at'" formula $@8 eventmodifications colonret assignmentlist */ -#line 526 "antimony.ypp" + case 212: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ +#line 608 "antimony.ypp" {} -#line 3327 "antimony.tab.cpp" +#line 3523 "antimony.tab.cpp" break; - case 199: /* $@9: %empty */ -#line 527 "antimony.ypp" + case 213: /* $@11: %empty */ +#line 609 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula), (yyvsp[-5].variable))) YYABORT;} -#line 3333 "antimony.tab.cpp" +#line 3529 "antimony.tab.cpp" break; - case 200: /* event: varmaybein ':' "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ -#line 527 "antimony.ypp" + case 214: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ +#line 609 "antimony.ypp" {} -#line 3339 "antimony.tab.cpp" +#line 3535 "antimony.tab.cpp" break; - case 201: /* colonret: ':' */ -#line 530 "antimony.ypp" + case 215: /* colonret: ':' */ +#line 612 "antimony.ypp" {} -#line 3345 "antimony.tab.cpp" +#line 3541 "antimony.tab.cpp" break; - case 202: /* colonret: colonret '\n' */ -#line 531 "antimony.ypp" + case 216: /* colonret: colonret '\n' */ +#line 613 "antimony.ypp" {} -#line 3351 "antimony.tab.cpp" +#line 3547 "antimony.tab.cpp" break; - case 203: /* eventmodifications: %empty */ -#line 534 "antimony.ypp" + case 217: /* eventmodifications: %empty */ +#line 616 "antimony.ypp" {} -#line 3357 "antimony.tab.cpp" +#line 3553 "antimony.tab.cpp" break; - case 204: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ -#line 535 "antimony.ypp" + case 218: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ +#line 617 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "priority")) {g_registry.GetCurrentEvent()->SetPriority(*(yyvsp[0].formula));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "t0")) {if (g_registry.GetCurrentEvent()->SetInitialValue(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "fromTrigger")) {if (g_registry.GetCurrentEvent()->SetUseValuesFromTriggerTime(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "persistent")) {if (g_registry.GetCurrentEvent()->SetPersistent(*(yyvsp[0].formula))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in event defintion. You may use the terms 'priority', 't0', 'fromTrigger', and 'persistent' here to set those properties of an event."); YYABORT;}} -#line 3367 "antimony.tab.cpp" +#line 3563 "antimony.tab.cpp" break; - case 205: /* assignmentlist: variable '=' formula */ -#line 542 "antimony.ypp" + case 219: /* assignmentlist: variable '=' formula */ +#line 624 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3373 "antimony.tab.cpp" +#line 3569 "antimony.tab.cpp" break; - case 206: /* assignmentlist: variable '=' formula ':' assignmentlist */ -#line 543 "antimony.ypp" + case 220: /* assignmentlist: variable '=' formula ':' assignmentlist */ +#line 625 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3379 "antimony.tab.cpp" +#line 3575 "antimony.tab.cpp" break; - case 207: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ -#line 544 "antimony.ypp" + case 221: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ +#line 626 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3385 "antimony.tab.cpp" +#line 3581 "antimony.tab.cpp" break; - case 208: /* assignmentlist: variable '=' formula ',' assignmentlist */ -#line 545 "antimony.ypp" + case 222: /* assignmentlist: variable '=' formula ',' assignmentlist */ +#line 627 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3391 "antimony.tab.cpp" +#line 3587 "antimony.tab.cpp" break; - case 209: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ -#line 546 "antimony.ypp" + case 223: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ +#line 628 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3397 "antimony.tab.cpp" +#line 3593 "antimony.tab.cpp" break; - case 210: /* deletion: "'delete'" variable */ -#line 549 "antimony.ypp" + case 224: /* deletion: "'delete'" variable */ +#line 631 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3403 "antimony.tab.cpp" +#line 3599 "antimony.tab.cpp" break; - case 211: /* deletion: deletion ',' variable */ -#line 550 "antimony.ypp" + case 225: /* deletion: deletion ',' variable */ +#line 632 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3409 "antimony.tab.cpp" +#line 3605 "antimony.tab.cpp" break; - case 212: /* unitdef: formula */ -#line 553 "antimony.ypp" + case 226: /* unitdef: formula */ +#line 635 "antimony.ypp" { if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[0].formula)->IsSingleVariable()) { @@ -3423,125 +3619,125 @@ yyparse (void) (yyval.variable) = g_registry.CurrentModule()->AddOrFindUnitDef(ud); } } -#line 3427 "antimony.tab.cpp" +#line 3623 "antimony.tab.cpp" break; - case 213: /* constraint: "number" inequality formula */ -#line 568 "antimony.ypp" + case 227: /* constraint: "number" inequality formula */ +#line 650 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3433 "antimony.tab.cpp" +#line 3629 "antimony.tab.cpp" break; - case 214: /* constraint: '-' "number" inequality formula */ -#line 569 "antimony.ypp" + case 228: /* constraint: '-' "number" inequality formula */ +#line 651 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint(-(yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3439 "antimony.tab.cpp" +#line 3635 "antimony.tab.cpp" break; - case 215: /* constraint: "name of a pre-defined constant" inequality formula */ -#line 570 "antimony.ypp" + case 229: /* constraint: "name of a pre-defined constant" inequality formula */ +#line 652 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3445 "antimony.tab.cpp" +#line 3641 "antimony.tab.cpp" break; - case 216: /* constraint: "element name" inequality formula */ -#line 571 "antimony.ypp" + case 230: /* constraint: "element name" inequality formula */ +#line 653 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3451 "antimony.tab.cpp" +#line 3647 "antimony.tab.cpp" break; - case 217: /* constraint: "'constraint'" ':' formula */ -#line 572 "antimony.ypp" + case 231: /* constraint: "'constraint'" ':' formula */ +#line 654 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[0].formula))) YYABORT;} -#line 3457 "antimony.tab.cpp" +#line 3653 "antimony.tab.cpp" break; - case 218: /* constraint: "'constraint'" variable ':' formula */ -#line 573 "antimony.ypp" + case 232: /* constraint: "'constraint'" variable ':' formula */ +#line 655 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3463 "antimony.tab.cpp" +#line 3659 "antimony.tab.cpp" break; - case 219: /* objective: maxormin formula */ -#line 576 "antimony.ypp" + case 233: /* objective: maxormin formula */ +#line 658 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3469 "antimony.tab.cpp" +#line 3665 "antimony.tab.cpp" break; - case 220: /* maxormin: "'maximize'" */ -#line 579 "antimony.ypp" + case 234: /* maxormin: "'maximize'" */ +#line 661 "antimony.ypp" {(yyval.maxormin) = true;} -#line 3475 "antimony.tab.cpp" +#line 3671 "antimony.tab.cpp" break; - case 221: /* maxormin: "'minimize'" */ -#line 580 "antimony.ypp" + case 235: /* maxormin: "'minimize'" */ +#line 662 "antimony.ypp" {(yyval.maxormin) = false;} -#line 3481 "antimony.tab.cpp" +#line 3677 "antimony.tab.cpp" break; - case 222: /* stringlist: "text string" */ -#line 583 "antimony.ypp" + case 236: /* stringlist: "text string" */ +#line 665 "antimony.ypp" { (yyval.stringlist) = new std::vector(); (yyval.stringlist)->push_back(*((yyvsp[0].word))); } -#line 3487 "antimony.tab.cpp" +#line 3683 "antimony.tab.cpp" break; - case 223: /* stringlist: stringlist ',' "text string" */ -#line 584 "antimony.ypp" + case 237: /* stringlist: stringlist ',' "text string" */ +#line 666 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-2].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3493 "antimony.tab.cpp" +#line 3689 "antimony.tab.cpp" break; - case 224: /* stringlist: stringlist ',' '\n' "text string" */ -#line 585 "antimony.ypp" + case 238: /* stringlist: stringlist ',' '\n' "text string" */ +#line 667 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-3].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3499 "antimony.tab.cpp" +#line 3695 "antimony.tab.cpp" break; - case 225: /* $@10: %empty */ -#line 587 "antimony.ypp" + case 239: /* $@12: %empty */ +#line 669 "antimony.ypp" {if (g_registry.SetCurrentModuleIf((yyvsp[0].word), (yyvsp[-1].word))) YYABORT;} -#line 3505 "antimony.tab.cpp" +#line 3701 "antimony.tab.cpp" break; - case 226: /* annotationBlock: "element name" "name of an existing module" $@10 annotations "'end'" */ -#line 587 "antimony.ypp" + case 240: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ +#line 669 "antimony.ypp" {g_registry.RevertToPreviousModule();} -#line 3511 "antimony.tab.cpp" +#line 3707 "antimony.tab.cpp" break; - case 227: /* annotations: %empty */ -#line 590 "antimony.ypp" + case 241: /* annotations: %empty */ +#line 672 "antimony.ypp" {} -#line 3517 "antimony.tab.cpp" +#line 3713 "antimony.tab.cpp" break; - case 228: /* annotations: "element name" ':' stringlist */ -#line 591 "antimony.ypp" + case 242: /* annotations: "element name" ':' stringlist */ +#line 673 "antimony.ypp" {string modname = g_registry.CurrentModuleName(); g_registry.ProcessGlobalCVTerm(&modname, (yyvsp[-2].word), (yyvsp[0].stringlist));} -#line 3523 "antimony.tab.cpp" +#line 3719 "antimony.tab.cpp" break; - case 229: /* cvterm: variable "element name" stringlist */ -#line 596 "antimony.ypp" + case 243: /* cvterm: variable "element name" stringlist */ +#line 678 "antimony.ypp" {if (g_registry.CurrentModule()->ProcessCVTerm((yyvsp[-2].variable),(yyvsp[-1].word),(yyvsp[0].stringlist))) YYABORT;} -#line 3529 "antimony.tab.cpp" +#line 3725 "antimony.tab.cpp" break; - case 230: /* cvterm: variable "element name" '.' "element name" stringlist */ -#line 597 "antimony.ypp" + case 244: /* cvterm: variable "element name" '.' "element name" stringlist */ +#line 679 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].stringlist))) YYABORT;} -#line 3535 "antimony.tab.cpp" +#line 3731 "antimony.tab.cpp" break; - case 231: /* cvterm: variable "element name" '.' "element name" "number" */ -#line 598 "antimony.ypp" + case 245: /* cvterm: variable "element name" '.' "element name" "number" */ +#line 680 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].num))) YYABORT;} -#line 3541 "antimony.tab.cpp" +#line 3737 "antimony.tab.cpp" break; - case 232: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ -#line 602 "antimony.ypp" + case 246: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ +#line 684 "antimony.ypp" { Module* module = g_registry.GetModule(*(yyvsp[-4].word)); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); @@ -3551,61 +3747,143 @@ yyparse (void) YYABORT; } } -#line 3555 "antimony.tab.cpp" +#line 3751 "antimony.tab.cpp" break; - case 233: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ -#line 613 "antimony.ypp" + case 247: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ +#line 695 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { function->SetSBOTerm(lround((yyvsp[0].num))); } else { - g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can be set on '" + *((yyvsp[-4].word)) + "' this way is 'sboTerm'."); + g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set '" + *((yyvsp[-4].word)) + "' to a number is 'sboTerm'."); YYABORT; } } -#line 3569 "antimony.tab.cpp" +#line 3765 "antimony.tab.cpp" break; - case 234: /* modulename: "name of an existing module" "'is'" "text string" lineend */ -#line 625 "antimony.ypp" + case 248: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ +#line 705 "antimony.ypp" + { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); + if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { + if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set on '" + *((yyvsp[-4].word)) + "' to a string is 'autolayout'."); + YYABORT; + } + } +#line 3779 "antimony.tab.cpp" + break; + + case 249: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ +#line 715 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; + } + else if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "layout")) { + if (module->SetLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } +#line 3796 "antimony.tab.cpp" + break; + + case 250: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ +#line 728 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; + } + else if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "layout")) { + if (module->SetLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } +#line 3813 "antimony.tab.cpp" + break; + + case 251: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '[' variablelist ']' */ +#line 741 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; + } + else if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "layout")) { + if (module->SetLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } +#line 3830 "antimony.tab.cpp" + break; + + case 252: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '[' numlist ']' */ +#line 754 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; + } + else if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "layout")) { + if (module->SetLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } +#line 3847 "antimony.tab.cpp" + break; + + case 253: /* modulename: "name of an existing module" "'is'" "text string" lineend */ +#line 769 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3575 "antimony.tab.cpp" +#line 3853 "antimony.tab.cpp" break; - case 235: /* functionname: "name of an existing function" "'is'" "text string" lineend */ -#line 627 "antimony.ypp" + case 254: /* functionname: "name of an existing function" "'is'" "text string" lineend */ +#line 771 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3581 "antimony.tab.cpp" +#line 3859 "antimony.tab.cpp" break; - case 236: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ -#line 630 "antimony.ypp" + case 255: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ +#line 774 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3587 "antimony.tab.cpp" +#line 3865 "antimony.tab.cpp" break; - case 237: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ -#line 631 "antimony.ypp" + case 256: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ +#line 775 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT;} -#line 3593 "antimony.tab.cpp" +#line 3871 "antimony.tab.cpp" break; - case 238: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ -#line 632 "antimony.ypp" + case 257: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ +#line 776 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT;} -#line 3599 "antimony.tab.cpp" +#line 3877 "antimony.tab.cpp" break; - case 239: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ -#line 633 "antimony.ypp" + case 258: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ +#line 777 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3605 "antimony.tab.cpp" +#line 3883 "antimony.tab.cpp" break; -#line 3609 "antimony.tab.cpp" +#line 3887 "antimony.tab.cpp" default: break; } @@ -3829,7 +4107,7 @@ yyparse (void) return yyresult; } -#line 635 "antimony.ypp" +#line 779 "antimony.ypp" diff --git a/src/antimony.ypp b/src/antimony.ypp index de616e9c..a6d1e17c 100644 --- a/src/antimony.ypp +++ b/src/antimony.ypp @@ -81,10 +81,11 @@ using namespace libsbml; Variable* varmaybeis; Variable* maybein; Variable* unitdef; - bool maybemain; bool maxormin; constraint_type inequality; std::vector* stringlist; + std::vector variablelist; + std::vector numlist; } %type mathThing "mathematical symbol" @@ -94,9 +95,10 @@ using namespace libsbml; %type reactionDivider %type inequality %type variable variablein varmaybein varmaybeis maybein unitdef -%type maybemain %type maxormin %type stringlist +%type variablelist +%type numlist %left '&' '|' /* Boolean functions and, or */ %left '-' '+' @@ -168,6 +170,7 @@ input: /* empty */ | input functioncvterm {} | input toplevel_sbo {} | input annotationBlock {} + | input moduleannotation{} | input error {YYABORT;} | input ERROR {YYABORT;} ; @@ -175,26 +178,33 @@ input: /* empty */ import: IMPORT TEXTSTRING { if (g_registry.OpenFile(*($2))==0) YYABORT;} ; -module: MODULE maybemain ANTWORD {g_registry.NewCurrentModule($3, NULL, $2);} '(' variableexportlist ')' modulebody END +module: MODULE ANTWORD {g_registry.NewCurrentModule($2, NULL, false);} '(' variableexportlist ')' modulebody END { $$ = g_registry.CurrentModule(); if ($$->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } - | MODULE maybemain ANTWORD {g_registry.NewCurrentModule($3, NULL, $2);} modulebody END + | MODULE ANTWORD {g_registry.NewCurrentModule($2, NULL, false);} modulebody END { $$ = g_registry.CurrentModule(); if ($$->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } - | MODULE MODNAME {g_registry.SetError("module '" + *($2) + "' already defined."); YYABORT;} + | MODULE '*' ANTWORD {g_registry.NewCurrentModule($3, NULL, true);} '(' variableexportlist ')' modulebody END + { + $$ = g_registry.CurrentModule(); + if ($$->Finalize()) YYABORT; + g_registry.RevertToPreviousModule(); + } + | MODULE '*' ANTWORD {g_registry.NewCurrentModule($3, NULL, true);} modulebody END + { + $$ = g_registry.CurrentModule(); + if ($$->Finalize()) YYABORT; + g_registry.RevertToPreviousModule(); + } | MODULE MODNAME {g_registry.SetError("module '" + *($2) + "' already defined."); YYABORT;} | MODULE FUNCTION {g_registry.SetError("Cannot define '" + *($2) + "' as a module because it is already a defined function."); YYABORT;} ; -maybemain: /* empty */ {$$ = false;} - | '*' {$$ = true;} - ; - function: FUNCTIONWORD ANTWORD {g_registry.NewUserFunction($2);} '(' variableexportlist ')' spacedformula END {if (g_registry.SetUserFunction($7)) YYABORT;} | FUNCTIONWORD MODNAME {g_registry.SetError("Cannot use '" + *($2) +"' as a function name because it is already the name of a module."); YYABORT;} | FUNCTIONWORD FUNCTION {g_registry.SetError("Cannot define '" + *($2) + "' as a new function because it is already a defined function."); YYABORT;} @@ -272,12 +282,84 @@ moduleannotation: MODULE ANTWORD stringlist lineend module->SetSBOTerm(lround($5)); } else { - g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model this way is 'sboTerm'."); + g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a number is 'sboTerm'."); + YYABORT; + } + } + | MODULE '.' ANTWORD '=' ANTWORD + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + YYABORT; + } + } + | MODULE '.' ANTWORD '.' ANTWORD '=' NUM + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $7)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $7)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } + | MODULE '.' ANTWORD '.' ANTWORD '=' ANTWORD + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $7)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $7)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } + | MODULE '.' ANTWORD '.' ANTWORD '=' '[' variablelist ']' + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $8)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $8)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } + | MODULE '.' ANTWORD '.' ANTWORD '=' '[' numlist ']' + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $8)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $8)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } } ; +variablelist: variable { std::vector ret; $$ = ret; $$.push_back($1);} // need to free $1? + | variablelist ',' variable { $$ = $1; $$.push_back($3); } // need to free $3? + | variablelist ',' '\n' variable { $$ = $1; $$.push_back($4); } // eat newlines + ; + +numlist: NUM { std::vector ret; $$ = ret; $$.push_back($1); } + | numlist ',' NUM { $$ = $1; $$.push_back($3); } + | numlist ',' '\n' NUM { $$ = $1; $$.push_back($4); } // eat newlines + ; + modulepart: reaction lineend {} | assignment lineend {} | submodule lineend {} @@ -615,7 +697,69 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM function->SetSBOTerm(lround($5)); } else { - g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can be set on '" + *($1) + "' this way is 'sboTerm'."); + g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set '" + *($1) + "' to a number is 'sboTerm'."); + YYABORT; + } + } + | MODNAME '.' ANTWORD '=' ANTWORD + { Module* function = g_registry.GetModule(*$1); + if (function && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (function->SetAutoLayout($5)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set on '" + *($1) + "' to a string is 'autolayout'."); + YYABORT; + } + } + | MODNAME '.' ANTWORD '.' ANTWORD '=' NUM + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $7)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $7)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } + | MODNAME '.' ANTWORD '.' ANTWORD '=' ANTWORD + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $7)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $7)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } + | MODNAME '.' ANTWORD '.' ANTWORD '=' '[' variablelist ']' + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $8)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $8)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + } + | MODNAME '.' ANTWORD '.' ANTWORD '=' '[' numlist ']' + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $8)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $8)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } } diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 647d9e0a..70a7f8fa 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2439,10 +2439,12 @@ void Module::CreateSBMLModel(bool comp) FixPortReferencesIn(sbmlmod); } #endif //USE_COMP - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml); - //LIBSBMLNETWORK_CPP_NAMESPACE::updateLayoutCurves(&m_sbml, NULL); - LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); - //compareChar('b', 'c'); + if (m_autolayout.use) { + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, m_autolayout.lockedNodeIds); + //LIBSBMLNETWORK_CPP_NAMESPACE::updateLayoutCurves(&m_sbml, NULL); + //LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); + //compareChar('b', 'c'); + } } void Module::SetAssignmentFor(Model* sbmlmod, const Variable* var, const map& syncmap, bool comp, set > referencedVars) @@ -3055,5 +3057,4 @@ void Module::UpdateRateOf(Model* model) } } } - #endif //NSBML diff --git a/src/module.cpp b/src/module.cpp index 74fed24f..48a49531 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -25,6 +25,8 @@ #include "sbml/packages/distrib/common/DistribExtensionTypes.h" #endif +#include "libsbmlnetwork_render_helpers.h" + extern Registry g_registry; using namespace std; @@ -61,6 +63,8 @@ Module::Module(string name) m_libsbml_info(""), m_libsbml_warnings(""), m_hasFBC(false), + m_autolayout(), + m_layout(), #endif #ifndef NCELLML m_cellmlmodel(NULL), @@ -118,6 +122,8 @@ Module::Module(const Module& src, string newtopname, string modulename) m_libsbml_info(), //don't need this info for submodules--might be wrong anyway. m_libsbml_warnings(), m_hasFBC(src.m_hasFBC), + m_autolayout(), + m_layout(), #endif #ifndef NCELLML m_cellmlmodel(NULL), @@ -175,6 +181,8 @@ Module::Module(const Module& src) m_libsbml_info(src.m_libsbml_info), m_libsbml_warnings(src.m_libsbml_warnings), m_hasFBC(src.m_hasFBC), + m_autolayout(src.m_autolayout), + m_layout(src.m_layout), #endif #ifndef NCELLML m_cellmlmodel(src.m_cellmlmodel), @@ -222,6 +230,8 @@ Module& Module::operator=(const Module& src) m_libsbml_info = src.m_libsbml_info; m_libsbml_warnings = src.m_libsbml_warnings; m_hasFBC = src.m_hasFBC; + m_autolayout = src.m_autolayout; + m_layout = src.m_layout; #ifdef USE_COMP CompSBMLDocumentPlugin* compdoc = static_cast(m_sbml.getPlugin("comp")); compdoc->setRequired(true); @@ -2986,3 +2996,355 @@ void Module::SetSBOTerm(int sboTerm) model->setSBOTerm(sboTerm); } } + +bool Module::SetAutoLayout(const string* isset) +{ + if (CaselessStrCmp(true, *isset, "yes") || + CaselessStrCmp(true, *isset, "true")) { + m_autolayout.use = true; + return false; + } + else if (CaselessStrCmp(true, *isset, "no") || + CaselessStrCmp(true, *isset, "false")) { + m_autolayout.use = false; + return false; + } + g_registry.SetError("Unable to set autolayout to '" + *isset + "': the only valid options are 'true' or 'false' (or 'yes' or 'no')."); + return true; +} + +bool Module::SetAutoLayout(const std::string* argument, const std::string* value) +{ + string type = ValidateAutoLayoutArgument(argument); + if (type == "none") { + return true; + } + if (type == "double") { + g_registry.SetError("Unable to set autolayout." + *argument + " to '" + *value + "': you must set it to a number."); + return true; + } + if (type == "idlist") { + g_registry.SetError("Unable to set autolayout." + *argument + " to '" + *value + "': you must set it to a list of IDs in brackets (i.e. '[S1, S2]')."); + return true; + } + bool arg = true; + if (CaselessStrCmp(true, *value, "yes") || + CaselessStrCmp(true, *value, "true")) { + arg = true; + } + else if (CaselessStrCmp(true, *value, "no") || + CaselessStrCmp(true, *value, "false")) { + arg = false; + } + else { + g_registry.SetError("Unable to set autolayout." + *argument + " to '" + *value + "': the only valid options are 'true' or 'false' (or 'yes' or 'no')."); + return true; + } + if (CaselessStrCmp(true, *argument, "useMagnetism")) { + m_autolayout.useMagnetism = arg; + } + else if (CaselessStrCmp(true, *argument, "useBoundary")) { + m_autolayout.useBoundary = arg; + } + else if (CaselessStrCmp(true, *argument, "useGrid")) { + m_autolayout.useGrid = arg; + } + else if (CaselessStrCmp(true, *argument, "useNameAsTextLabel")) { + m_autolayout.useNameAsTextLabel = arg; + } + return false; +} + +bool Module::SetAutoLayout(const string* argument, const double& value) +{ + string type = ValidateAutoLayoutArgument(argument); + if (type == "none") { + return true; + } + stringstream val; + val << value; + if (type == "bool") { + if (value == 0.0) { + string isfalse = "false"; + return SetAutoLayout(argument, &isfalse); + } + if (value == 1.0) { + string istrue = "true"; + return SetAutoLayout(argument, &istrue); + } + g_registry.SetError("Unable to set autolayout." + *argument + " to '" + val.str() + "': you must set it to 'true' or 'false'."); + return true; + } + if (type == "idlist") { + g_registry.SetError("Unable to set autolayout." + *argument + " to '" + val.str() + "': you must set it to a list of IDs in brackets (i.e. '[S1, S2]')."); + return true; + } + if (CaselessStrCmp(true, *argument, "stiffness")) { + m_autolayout.stiffness = value; + } + if (CaselessStrCmp(true, *argument, "gravity")) { + m_autolayout.gravity = value; + } + return false; +} + +bool Module::SetAutoLayout(const std::string* argument, const std::vector values) +{ + string type = ValidateAutoLayoutArgument(argument); + if (type == "none") { + return true; + } + if (type == "bool") { + g_registry.SetError("Unable to set autolayout." + *argument + " to a list of IDs: you must set it to 'true' or 'false'."); + return true; + } + if (type == "double") { + g_registry.SetError("Unable to set autolayout." + *argument + " to a list of IDs: you must set it to a number."); + return true; + } + vector ids; + for (size_t i = 0; i < values.size(); i++) { + string id = values[i]->GetNameDelimitedBy(g_registry.GetCC()); + ids.push_back(id); + } + m_autolayout.lockedNodeIds = ids; + return false; +} + + +bool Module::SetAutoLayout(const std::string* argument, const std::vector values) +{ + string type = ValidateAutoLayoutArgument(argument); + if (type == "none") { + return true; + } + if (type == "bool") { + g_registry.SetError("Unable to set autolayout." + *argument + " to a list of numbers: you must set it to 'true' or 'false'."); + return true; + } + if (type == "double") { + g_registry.SetError("Unable to set autolayout." + *argument + " to a list of numbers: you must set it to a number."); + return true; + } + if (type == "idlist") { + g_registry.SetError("Unable to set autolayout." + *argument + " to a list of numbers: you must set it to a list of IDs."); + return true; + } + assert(false); + return true; +} + + +string Module::ValidateAutoLayoutArgument(const string* argument) +{ + if (CaselessStrCmp(true, *argument, "stiffness")) { + return "double"; + } + if (CaselessStrCmp(true, *argument, "gravity")) { + return "double"; + } + if (CaselessStrCmp(true, *argument, "useMagnetism")) { + return "bool"; + } + if (CaselessStrCmp(true, *argument, "useBoundary")) { + return "bool"; + } + if (CaselessStrCmp(true, *argument, "useGrid")) { + return "bool"; + } + if (CaselessStrCmp(true, *argument, "useNameAsTextLabel")) { + return "bool"; + } + if (CaselessStrCmp(true, *argument, "locked")) { + return "idlist"; + } + g_registry.SetError("No such setting 'autolayout." + *argument+ "': the valid autolayout settings are 'stiffness', 'gravity', 'useMagnetism', 'useBoundary', 'useGrid', 'useNameAsTextLabel', and 'locked'."); + + return "none"; +} + + + +bool Module::SetLayout(const std::string* argument, const std::string* value) +{ + string type = ValidateLayoutArgument(argument); + if (type == "none") { + return true; + } + if (type == "double") { + g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': you must set it to a number."); + return true; + } + if (type == "numlist") { + g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': you must set it to a list of numbers in brackets (i.e. '[500, 800]')."); + return true; + } + if (type == "idlist") { + g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': you must set it to a list of IDs in brackets (i.e. '[S1, S2]')."); + return true; + } + bool arg = true; + if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidBackgroundColorValue(*value)) { + g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': that's not a valid color. Try something like 'red' or 'blue' or a hex color of the form '#FF0000'."); + return true; + } + assert(type == "color"); + assert(CaselessStrCmp(true, *argument, "background")); + m_layout.background = *value; + return false; +} + +bool Module::SetLayout(const string* argument, const double& value) +{ + string type = ValidateLayoutArgument(argument); + if (type == "none") { + return true; + } + stringstream val; + val << value; + if (type == "color") { + g_registry.SetError("Unable to set layout." + *argument + " to '" + val.str() + "': you must set it to a color."); + return true; + } + if (type == "idlist") { + g_registry.SetError("Unable to set layout." + *argument + " to '" + val.str() + "': you must set it to a list of IDs in brackets (i.e. '[S1, S2]')."); + return true; + } + if (type == "numlist") { + g_registry.SetError("Unable to set layout." + *argument + " to '" + val.str() + "': you must set it to a list of numbers in brackets (i.e. '[500, 800]')."); + return true; + } + if (CaselessStrCmp(true, *argument, "height")) { + m_layout.height = value; + } + else if (CaselessStrCmp(true, *argument, "width")) { + m_layout.width = value; + } + else if (CaselessStrCmp(true, *argument, "depth")) { + m_layout.depth = value; + } + return false; +} + +bool Module::SetLayout(const std::string* argument, const std::vector values) +{ + string type = ValidateLayoutArgument(argument); + if (type == "none") { + return true; + } + if (type == "color") { + g_registry.SetError("Unable to set layout." + *argument + " to a list of IDs: you must set it to a color."); + return true; + } + if (type == "double") { + g_registry.SetError("Unable to set layout." + *argument + " to a list of IDs: you must set it to a number."); + return true; + } + if (type == "numlist") { + g_registry.SetError("Unable to set layout." + *argument + " to a list of IDs: you must set it to a list of numbers in brackets (i.e. '[500, 800]')."); + return true; + } + vector ids; + for (size_t i = 0; i < values.size(); i++) { + string id = values[i]->GetNameDelimitedBy(g_registry.GetCC()); + ids.push_back(id); + } + if (CaselessStrCmp(true, *argument, "align_top")) { + m_layout.align_top = ids; + } + else if (CaselessStrCmp(true, *argument, "align_center")) { + m_layout.align_center = ids; + } + else if (CaselessStrCmp(true, *argument, "align_bottom")) { + m_layout.align_bottom = ids; + } + else if (CaselessStrCmp(true, *argument, "align_left")) { + m_layout.align_left = ids; + } + else if (CaselessStrCmp(true, *argument, "align_middle")) { + m_layout.align_middle = ids; + } + else if (CaselessStrCmp(true, *argument, "align_right")) { + m_layout.align_right = ids; + } + else if (CaselessStrCmp(true, *argument, "align_circular")) { + m_layout.align_circular = ids; + } + return false; +} + + +bool Module::SetLayout(const std::string* argument, const std::vector values) +{ + string type = ValidateLayoutArgument(argument); + if (type == "none") { + return true; + } + if (type == "color") { + g_registry.SetError("Unable to set layout." + *argument + " to a list of numbers: you must set it to a color."); + return true; + } + if (type == "double") { + g_registry.SetError("Unable to set layout." + *argument + " to a list of numbers: you must set it to a number."); + return true; + } + if (type == "idlist") { + g_registry.SetError("Unable to set layout." + *argument + " to a list of numbers: you must set it to a list of IDs."); + return true; + } + if (values.size() < 2 || values.size() > 3) { + g_registry.SetError("Unable to set layout." + *argument + ": the list must contain exactly two or three entries, for height/width, or height/width/depth."); + return true; + } + m_layout.height = values[0]; + m_layout.width = values[1]; + if (values.size() == 3) { + m_layout.depth = values[2]; + } + return true; +} + + +string Module::ValidateLayoutArgument(const string* argument) +{ + if (CaselessStrCmp(true, *argument, "align_top")) { + return "idlist"; + } + if (CaselessStrCmp(true, *argument, "align_center")) { + return "idlist"; + } + if (CaselessStrCmp(true, *argument, "align_bottom")) { + return "idlist"; + } + if (CaselessStrCmp(true, *argument, "align_left")) { + return "idlist"; + } + if (CaselessStrCmp(true, *argument, "align_middle")) { + return "idlist"; + } + if (CaselessStrCmp(true, *argument, "align_right")) { + return "idlist"; + } + if (CaselessStrCmp(true, *argument, "align_circular")) { + return "idlist"; + } + if (CaselessStrCmp(true, *argument, "height")) { + return "double"; + } + if (CaselessStrCmp(true, *argument, "width")) { + return "double"; + } + if (CaselessStrCmp(true, *argument, "depth")) { + return "double"; + } + if (CaselessStrCmp(true, *argument, "size")) { + return "numlist"; + } + if (CaselessStrCmp(true, *argument, "background")) { + return "color"; + } + g_registry.SetError("No such setting 'layout." + *argument + "': the valid layout settings are 'align_top', 'align_center', 'align_bottom', 'align_left', 'align_middle', 'align_right', 'align_circular', 'size', 'height', 'width', 'depth' and 'background'."); + + return "none"; +} + diff --git a/src/module.h b/src/module.h index 976de6c0..cd9ab9cc 100644 --- a/src/module.h +++ b/src/module.h @@ -28,6 +28,32 @@ enum tree_direction {td_UP, td_DOWN, td_SIDEWAYS}; class ReactionList; +struct autolayout { + bool use = false; + double stiffness = 10.0; + double gravity = 15.0; + bool useMagnetism = false; + bool useBoundary = false; + bool useGrid = false; + bool useNameAsTextLabel = true; + std::vector lockedNodeIds = std::vector(); +}; + +struct layout { + std::vector align_top = std::vector(); + std::vector align_center = std::vector(); + std::vector align_bottom = std::vector(); + std::vector align_left = std::vector(); + std::vector align_middle = std::vector(); + std::vector align_right = std::vector(); + std::vector align_circular = std::vector(); + double height = 0.0; + double width = 0.0; + double depth = 0.0; + std::string background = ""; +}; + + class Module : public Annotated { protected: @@ -66,6 +92,8 @@ class Module : public Annotated std::string m_libsbml_info; std::string m_libsbml_warnings; bool m_hasFBC; + autolayout m_autolayout; + layout m_layout; #endif #ifndef NCELLML @@ -160,6 +188,17 @@ class Module : public Annotated bool GetNeedDefaultCompartment() const; virtual void SetSBOTerm(int sboTerm); + virtual bool SetAutoLayout(const std::string* isset); + virtual bool SetAutoLayout(const std::string* argument, const std::string* value); + virtual bool SetAutoLayout(const std::string* argument, const double& value); + virtual bool SetAutoLayout(const std::string* argument, const std::vector values); + virtual bool SetAutoLayout(const std::string* argument, const std::vector values); + + virtual bool SetLayout(const std::string* argument, const std::string* value); + virtual bool SetLayout(const std::string* argument, const double& value); + virtual bool SetLayout(const std::string* argument, const std::vector values); + virtual bool SetLayout(const std::string* argument, const std::vector values); + //Output for the API bool Finalize(); @@ -284,6 +323,8 @@ class Module : public Annotated void FixFunctions(const std::string& name, libsbml::Model* model); void FixUnitNames(libsbml::Model* model); void UpdateRateOf(libsbml::Model* model); + std::string ValidateAutoLayoutArgument(const std::string* argument); + std::string ValidateLayoutArgument(const std::string* argument); #endif #endif }; From 854b9092167ea23d80c424bfc84726d5bb34627b Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Mon, 15 Jul 2024 13:45:24 -0700 Subject: [PATCH 03/43] Most individual layout/render information now encodable in Antimony. --- CMakeLists.txt | 6 +- src/antimony.tab.cpp | 2520 +++++++++++++++++++++-------------------- src/antimony.ypp | 55 +- src/antimony_api.cpp | 4 +- src/enums.h | 40 + src/formula.cpp | 40 +- src/formula.h | 10 +- src/layoutWrapper.cpp | 328 ++++++ src/layoutWrapper.h | 34 + src/module-cellml.cpp | 2 + src/module-sbml.cpp | 61 +- src/module.cpp | 241 ++-- src/module.h | 16 +- src/typex.cpp | 167 ++- src/typex.h | 4 + src/uncertWrapper.h | 2 +- src/userfunction.cpp | 2 +- src/variable.cpp | 177 ++- src/variable.h | 7 + 19 files changed, 2331 insertions(+), 1385 deletions(-) create mode 100644 src/layoutWrapper.cpp create mode 100644 src/layoutWrapper.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b2be5b1f..ba56348c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -555,9 +555,9 @@ file(GLOB LIBANTIMONY_SOURCES ${ANTIMONY_SRC_DIR}cellmlx.cpp ${ANTIMONY_SRC_DIR}constraint.cpp ${ANTIMONY_SRC_DIR}dnastrand.cpp - ${ANTIMONY_SRC_DIR}uncertWrapper.cpp ${ANTIMONY_SRC_DIR}event.cpp ${ANTIMONY_SRC_DIR}formula.cpp + ${ANTIMONY_SRC_DIR}layoutWrapper.cpp ${ANTIMONY_SRC_DIR}module.cpp ${ANTIMONY_SRC_DIR}reactantlist.cpp ${ANTIMONY_SRC_DIR}reaction.cpp @@ -569,6 +569,7 @@ file(GLOB LIBANTIMONY_SOURCES ${ANTIMONY_SRC_DIR}unitdef.cpp ${ANTIMONY_SRC_DIR}unitelement.cpp ${ANTIMONY_SRC_DIR}userfunction.cpp + ${ANTIMONY_SRC_DIR}uncertWrapper.cpp ${ANTIMONY_SRC_DIR}unitdef.cpp ${ANTIMONY_SRC_DIR}unitelement.cpp ${ANTIMONY_SRC_DIR}variable.cpp @@ -591,10 +592,10 @@ file(GLOB LIBANTIMONY_HEADERS ${ANTIMONY_SRC_DIR}cellmlx.h ${ANTIMONY_SRC_DIR}constraint.h ${ANTIMONY_SRC_DIR}dnastrand.h - ${ANTIMONY_SRC_DIR}uncertWrapper.h ${ANTIMONY_SRC_DIR}enums.h ${ANTIMONY_SRC_DIR}event.h ${ANTIMONY_SRC_DIR}formula.h + ${ANTIMONY_SRC_DIR}layoutWrapper.h ${ANTIMONY_SRC_DIR}libutil.h ${ANTIMONY_SRC_DIR}module.h ${ANTIMONY_SRC_DIR}reactantlist.h @@ -604,6 +605,7 @@ file(GLOB LIBANTIMONY_HEADERS ${ANTIMONY_SRC_DIR}sboTermWrapper.h ${ANTIMONY_SRC_DIR}stringx.h ${ANTIMONY_SRC_DIR}typex.h + ${ANTIMONY_SRC_DIR}uncertWrapper.h ${ANTIMONY_SRC_DIR}unitdef.h ${ANTIMONY_SRC_DIR}unitelement.h ${ANTIMONY_SRC_DIR}userfunction.h diff --git a/src/antimony.tab.cpp b/src/antimony.tab.cpp index a8f4b945..ef5c21ad 100644 --- a/src/antimony.tab.cpp +++ b/src/antimony.tab.cpp @@ -229,8 +229,8 @@ union ANTIMONY_YYSTYPE bool maxormin; constraint_type inequality; std::vector* stringlist; - std::vector variablelist; - std::vector numlist; + std::vector* variablelist; + std::vector* numlist; #line 236 "antimony.tab.cpp" @@ -314,88 +314,86 @@ enum yysymbol_kind_t YYSYMBOL_59_ = 59, /* '=' */ YYSYMBOL_60_ = 60, /* ':' */ YYSYMBOL_61_ = 61, /* '\'' */ - YYSYMBOL_62_ = 62, /* '[' */ - YYSYMBOL_63_ = 63, /* ']' */ + YYSYMBOL_62_ = 62, /* '{' */ + YYSYMBOL_63_ = 63, /* '}' */ YYSYMBOL_64_n_ = 64, /* '\n' */ YYSYMBOL_65_ = 65, /* ';' */ - YYSYMBOL_66_ = 66, /* '{' */ - YYSYMBOL_67_ = 67, /* '}' */ - YYSYMBOL_68_ = 68, /* '!' */ - YYSYMBOL_69_ = 69, /* '<' */ - YYSYMBOL_70_ = 70, /* '>' */ - YYSYMBOL_YYACCEPT = 71, /* $accept */ - YYSYMBOL_input = 72, /* input */ - YYSYMBOL_import = 73, /* import */ - YYSYMBOL_module = 74, /* module */ - YYSYMBOL_75_1 = 75, /* $@1 */ - YYSYMBOL_76_2 = 76, /* $@2 */ - YYSYMBOL_77_3 = 77, /* $@3 */ - YYSYMBOL_78_4 = 78, /* $@4 */ - YYSYMBOL_function = 79, /* function */ - YYSYMBOL_80_5 = 80, /* $@5 */ - YYSYMBOL_spacedformula = 81, /* spacedformula */ - YYSYMBOL_variableexportlist = 82, /* variableexportlist */ - YYSYMBOL_variable = 83, /* variable */ - YYSYMBOL_variablein = 84, /* variablein */ - YYSYMBOL_varmaybein = 85, /* varmaybein */ - YYSYMBOL_varmaybeis = 86, /* varmaybeis */ - YYSYMBOL_maybein = 87, /* maybein */ - YYSYMBOL_modulebody = 88, /* modulebody */ - YYSYMBOL_moduleannotation = 89, /* moduleannotation */ - YYSYMBOL_variablelist = 90, /* variablelist */ - YYSYMBOL_numlist = 91, /* numlist */ - YYSYMBOL_modulepart = 92, /* modulepart */ - YYSYMBOL_reaction = 93, /* reaction */ - YYSYMBOL_reactantList = 94, /* reactantList */ - YYSYMBOL_reactionDivider = 95, /* reactionDivider */ - YYSYMBOL_formula = 96, /* formula */ - YYSYMBOL_commaformula = 97, /* commaformula */ - YYSYMBOL_mathThing = 98, /* mathThing */ - YYSYMBOL_inequality = 99, /* inequality */ - YYSYMBOL_lineend = 100, /* lineend */ - YYSYMBOL_assignment = 101, /* assignment */ - YYSYMBOL_algrule = 102, /* algrule */ - YYSYMBOL_submodule = 103, /* submodule */ - YYSYMBOL_104_6 = 104, /* $@6 */ - YYSYMBOL_105_7 = 105, /* $@7 */ - YYSYMBOL_variableimportlist = 106, /* variableimportlist */ - YYSYMBOL_submodifications = 107, /* submodifications */ - YYSYMBOL_varinitialize = 108, /* varinitialize */ - YYSYMBOL_specinit = 109, /* specinit */ - YYSYMBOL_formulainit = 110, /* formulainit */ - YYSYMBOL_reactioninit = 111, /* reactioninit */ - YYSYMBOL_dnainit = 112, /* dnainit */ - YYSYMBOL_geneinit = 113, /* geneinit */ - YYSYMBOL_operatorinit = 114, /* operatorinit */ - YYSYMBOL_compartmentinit = 115, /* compartmentinit */ - YYSYMBOL_varconstinit = 116, /* varconstinit */ - YYSYMBOL_unitinit = 117, /* unitinit */ - YYSYMBOL_dnadef = 118, /* dnadef */ - YYSYMBOL_dnastrand = 119, /* dnastrand */ - YYSYMBOL_dnamiddle = 120, /* dnamiddle */ - YYSYMBOL_event = 121, /* event */ - YYSYMBOL_122_8 = 122, /* $@8 */ - YYSYMBOL_123_9 = 123, /* $@9 */ - YYSYMBOL_124_10 = 124, /* $@10 */ - YYSYMBOL_125_11 = 125, /* $@11 */ - YYSYMBOL_colonret = 126, /* colonret */ - YYSYMBOL_eventmodifications = 127, /* eventmodifications */ - YYSYMBOL_assignmentlist = 128, /* assignmentlist */ - YYSYMBOL_deletion = 129, /* deletion */ - YYSYMBOL_unitdef = 130, /* unitdef */ - YYSYMBOL_constraint = 131, /* constraint */ - YYSYMBOL_objective = 132, /* objective */ - YYSYMBOL_maxormin = 133, /* maxormin */ - YYSYMBOL_stringlist = 134, /* stringlist */ - YYSYMBOL_annotationBlock = 135, /* annotationBlock */ - YYSYMBOL_136_12 = 136, /* $@12 */ - YYSYMBOL_annotations = 137, /* annotations */ - YYSYMBOL_cvterm = 138, /* cvterm */ - YYSYMBOL_toplevel_sbo = 139, /* toplevel_sbo */ - YYSYMBOL_modulename = 140, /* modulename */ - YYSYMBOL_functionname = 141, /* functionname */ - YYSYMBOL_modulecvterm = 142, /* modulecvterm */ - YYSYMBOL_functioncvterm = 143 /* functioncvterm */ + YYSYMBOL_66_ = 66, /* '!' */ + YYSYMBOL_67_ = 67, /* '<' */ + YYSYMBOL_68_ = 68, /* '>' */ + YYSYMBOL_YYACCEPT = 69, /* $accept */ + YYSYMBOL_input = 70, /* input */ + YYSYMBOL_import = 71, /* import */ + YYSYMBOL_module = 72, /* module */ + YYSYMBOL_73_1 = 73, /* $@1 */ + YYSYMBOL_74_2 = 74, /* $@2 */ + YYSYMBOL_75_3 = 75, /* $@3 */ + YYSYMBOL_76_4 = 76, /* $@4 */ + YYSYMBOL_function = 77, /* function */ + YYSYMBOL_78_5 = 78, /* $@5 */ + YYSYMBOL_spacedformula = 79, /* spacedformula */ + YYSYMBOL_variableexportlist = 80, /* variableexportlist */ + YYSYMBOL_variable = 81, /* variable */ + YYSYMBOL_variablein = 82, /* variablein */ + YYSYMBOL_varmaybein = 83, /* varmaybein */ + YYSYMBOL_varmaybeis = 84, /* varmaybeis */ + YYSYMBOL_maybein = 85, /* maybein */ + YYSYMBOL_modulebody = 86, /* modulebody */ + YYSYMBOL_moduleannotation = 87, /* moduleannotation */ + YYSYMBOL_variablelist = 88, /* variablelist */ + YYSYMBOL_numlist = 89, /* numlist */ + YYSYMBOL_modulepart = 90, /* modulepart */ + YYSYMBOL_reaction = 91, /* reaction */ + YYSYMBOL_reactantList = 92, /* reactantList */ + YYSYMBOL_reactionDivider = 93, /* reactionDivider */ + YYSYMBOL_formula = 94, /* formula */ + YYSYMBOL_commaformula = 95, /* commaformula */ + YYSYMBOL_mathThing = 96, /* mathThing */ + YYSYMBOL_inequality = 97, /* inequality */ + YYSYMBOL_lineend = 98, /* lineend */ + YYSYMBOL_assignment = 99, /* assignment */ + YYSYMBOL_algrule = 100, /* algrule */ + YYSYMBOL_submodule = 101, /* submodule */ + YYSYMBOL_102_6 = 102, /* $@6 */ + YYSYMBOL_103_7 = 103, /* $@7 */ + YYSYMBOL_variableimportlist = 104, /* variableimportlist */ + YYSYMBOL_submodifications = 105, /* submodifications */ + YYSYMBOL_varinitialize = 106, /* varinitialize */ + YYSYMBOL_specinit = 107, /* specinit */ + YYSYMBOL_formulainit = 108, /* formulainit */ + YYSYMBOL_reactioninit = 109, /* reactioninit */ + YYSYMBOL_dnainit = 110, /* dnainit */ + YYSYMBOL_geneinit = 111, /* geneinit */ + YYSYMBOL_operatorinit = 112, /* operatorinit */ + YYSYMBOL_compartmentinit = 113, /* compartmentinit */ + YYSYMBOL_varconstinit = 114, /* varconstinit */ + YYSYMBOL_unitinit = 115, /* unitinit */ + YYSYMBOL_dnadef = 116, /* dnadef */ + YYSYMBOL_dnastrand = 117, /* dnastrand */ + YYSYMBOL_dnamiddle = 118, /* dnamiddle */ + YYSYMBOL_event = 119, /* event */ + YYSYMBOL_120_8 = 120, /* $@8 */ + YYSYMBOL_121_9 = 121, /* $@9 */ + YYSYMBOL_122_10 = 122, /* $@10 */ + YYSYMBOL_123_11 = 123, /* $@11 */ + YYSYMBOL_colonret = 124, /* colonret */ + YYSYMBOL_eventmodifications = 125, /* eventmodifications */ + YYSYMBOL_assignmentlist = 126, /* assignmentlist */ + YYSYMBOL_deletion = 127, /* deletion */ + YYSYMBOL_unitdef = 128, /* unitdef */ + YYSYMBOL_constraint = 129, /* constraint */ + YYSYMBOL_objective = 130, /* objective */ + YYSYMBOL_maxormin = 131, /* maxormin */ + YYSYMBOL_stringlist = 132, /* stringlist */ + YYSYMBOL_annotationBlock = 133, /* annotationBlock */ + YYSYMBOL_134_12 = 134, /* $@12 */ + YYSYMBOL_annotations = 135, /* annotations */ + YYSYMBOL_cvterm = 136, /* cvterm */ + YYSYMBOL_toplevel_sbo = 137, /* toplevel_sbo */ + YYSYMBOL_modulename = 138, /* modulename */ + YYSYMBOL_functionname = 139, /* functionname */ + YYSYMBOL_modulecvterm = 140, /* modulecvterm */ + YYSYMBOL_functioncvterm = 141 /* functioncvterm */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -723,16 +721,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1279 +#define YYLAST 1269 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 71 +#define YYNTOKENS 69 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 73 /* YYNRULES -- Number of rules. */ -#define YYNRULES 258 +#define YYNRULES 261 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 499 +#define YYNSTATES 502 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 300 @@ -752,16 +750,16 @@ static const yytype_int8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 64, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 68, 2, 2, 12, 10, 4, 61, + 2, 2, 2, 66, 2, 2, 12, 10, 4, 61, 56, 57, 8, 7, 58, 6, 13, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 60, 65, - 69, 59, 70, 2, 2, 2, 2, 2, 2, 2, + 67, 59, 68, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 62, 2, 63, 11, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 66, 5, 67, 2, 2, 2, 2, + 2, 2, 2, 62, 5, 63, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -792,26 +790,27 @@ static const yytype_int16 yyrline[] = 210, 213, 214, 215, 225, 226, 227, 230, 231, 237, 240, 243, 244, 247, 248, 249, 250, 251, 254, 255, 258, 259, 260, 261, 264, 269, 274, 279, 289, 299, - 312, 325, 338, 353, 354, 355, 358, 359, 360, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 379, 387, 395, 403, 411, 419, 429, - 430, 431, 432, 433, 434, 438, 439, 440, 441, 442, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 460, 461, 464, 465, 466, 467, 468, - 469, 470, 473, 474, 475, 476, 477, 480, 481, 482, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 497, - 498, 501, 501, 502, 502, 506, 507, 508, 509, 510, - 514, 515, 519, 523, 524, 525, 526, 527, 528, 529, - 530, 533, 534, 535, 536, 537, 538, 539, 540, 543, - 544, 545, 546, 549, 550, 551, 552, 555, 556, 557, - 558, 561, 562, 563, 564, 567, 568, 569, 570, 574, - 575, 576, 577, 580, 581, 582, 585, 588, 591, 592, - 595, 596, 597, 598, 599, 602, 603, 606, 606, 607, - 607, 608, 608, 609, 609, 612, 613, 616, 617, 624, - 625, 626, 627, 628, 631, 632, 635, 650, 651, 652, - 653, 654, 655, 658, 661, 662, 665, 666, 667, 669, - 669, 672, 673, 678, 679, 680, 683, 694, 704, 714, - 727, 740, 753, 768, 770, 774, 775, 776, 777 + 309, 323, 337, 351, 367, 368, 369, 372, 373, 374, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 393, 401, 409, 417, 425, 433, + 443, 444, 445, 446, 447, 448, 452, 453, 454, 455, + 456, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 475, 476, 479, 480, 481, + 482, 483, 484, 485, 488, 489, 490, 491, 492, 495, + 496, 497, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 512, 513, 516, 516, 517, 517, 521, 522, 523, + 524, 525, 529, 530, 534, 538, 539, 540, 541, 542, + 543, 544, 545, 548, 549, 550, 551, 552, 553, 554, + 555, 558, 559, 560, 561, 564, 565, 566, 567, 570, + 571, 572, 573, 576, 577, 578, 579, 582, 583, 584, + 585, 589, 590, 591, 592, 595, 596, 597, 600, 603, + 606, 607, 610, 611, 612, 613, 614, 617, 618, 621, + 621, 622, 622, 623, 623, 624, 624, 627, 628, 631, + 632, 639, 640, 641, 642, 643, 646, 647, 650, 665, + 666, 667, 668, 669, 670, 673, 676, 677, 680, 681, + 682, 684, 684, 687, 688, 693, 694, 695, 698, 709, + 719, 729, 739, 753, 767, 781, 797, 799, 803, 804, + 805, 806 }; #endif @@ -841,9 +840,9 @@ static const char *const yytname[] = "\"name of an existing module\"", "\"'model' or 'module'\"", "\"'operator'\"", "\"'reaction'\"", "\"'species'\"", "\"'substanceOnly'\"", "\"text string\"", "\"'unit'\"", "\"'var'\"", - "'('", "')'", "','", "'='", "':'", "'\\''", "'['", "']'", "'\\n'", "';'", - "'{'", "'}'", "'!'", "'<'", "'>'", "$accept", "input", "import", - "module", "$@1", "$@2", "$@3", "$@4", "function", "$@5", "spacedformula", + "'('", "')'", "','", "'='", "':'", "'\\''", "'{'", "'}'", "'\\n'", "';'", + "'!'", "'<'", "'>'", "$accept", "input", "import", "module", "$@1", + "$@2", "$@3", "$@4", "function", "$@5", "spacedformula", "variableexportlist", "variable", "variablein", "varmaybein", "varmaybeis", "maybein", "modulebody", "moduleannotation", "variablelist", "numlist", "modulepart", "reaction", "reactantList", @@ -866,12 +865,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-393) +#define YYPACT_NINF (-396) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-90) +#define YYTABLE_NINF (-91) #define yytable_value_is_error(Yyn) \ 0 @@ -880,56 +879,57 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - -393, 892, -393, -393, 90, 231, -393, 34, 221, -393, - -393, -393, -393, -393, 231, 232, 169, 353, 231, 231, - 231, -393, 231, 201, 240, 231, -25, -393, -393, 181, - 237, 231, 231, 231, 210, 231, 1227, -393, -393, -393, - -393, -393, 688, 27, 82, -393, -393, 35, 292, 309, - -393, 35, 35, 35, 35, -22, -19, -16, 173, 182, - 222, 234, 258, 35, 35, -393, 231, 35, 55, 35, - 35, -393, -393, 35, -393, -393, -393, -393, -393, 232, - -393, -393, 81, -393, -393, -393, -393, -393, -393, 81, - -393, -393, -393, 589, 1, -393, 245, -393, -393, -393, - 66, 231, 231, 231, 231, 231, -393, 231, 238, -393, - 208, 231, 81, -393, -393, 337, 308, 316, -393, -393, - -393, -393, -393, 360, 105, 326, -393, 364, 366, 154, - -393, -393, -393, -393, -393, 231, -393, 16, 231, 231, - 231, 231, 231, 231, 231, 244, -393, 376, 170, -393, - 231, 81, 231, -393, 196, -393, 1213, 286, -393, 356, - 332, 41, 231, 305, 6, -393, -393, -393, -393, 231, - 231, 231, 231, 231, 231, 231, 231, -393, -393, 220, - -393, 231, -393, -393, -393, 821, -393, -393, 821, 821, - 383, 821, 403, 408, -393, -393, -393, -393, -393, -393, - -393, -393, -393, -393, -393, -393, 355, -393, -393, 81, - -393, -393, -393, -393, -393, 357, 358, 821, 821, -393, - -393, -393, -393, -393, -393, -393, 231, 220, 359, -393, - 131, 35, 367, 32, 402, 131, 35, 351, 369, 88, - 405, 371, 1162, 131, -393, -393, -393, -393, -393, -393, - -393, -393, -393, 231, -393, 411, 374, 81, 199, 821, - -393, -393, 242, 821, 180, -393, 379, -393, 269, 292, - 309, -393, -393, -393, 231, 305, -393, 15, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, 81, 821, - 380, 406, -393, -393, 821, 821, 99, -393, 44, 174, - -393, 821, -393, -393, 821, -393, 424, -37, -393, -393, - 231, 431, 249, 83, -393, -393, -393, 81, 250, 393, - 1162, 434, 262, 167, 231, 232, 399, 312, 946, -393, - -393, -393, 821, -393, 200, 231, 231, -393, 658, -393, - 821, 42, 17, 821, 821, 81, 81, 739, -393, 739, - 308, -393, -393, -393, -393, -393, 442, -393, 13, 821, - 821, -393, -393, 407, 275, 81, 410, -393, -393, 35, - 131, -393, 363, 231, 1000, 416, -393, -393, 35, 131, - 294, 172, -393, -393, -393, -393, 374, 81, 81, 821, - -393, -393, 351, -393, 19, -393, 231, -393, 739, -393, - 374, 174, 821, 417, -393, 95, -393, -393, 35, 231, - 149, -393, -393, 121, -393, 81, 328, -393, 176, -393, - -393, 1162, 821, 174, 341, 739, -393, 739, 81, -393, - 13, -393, -393, 113, 821, 35, 81, -393, -393, 377, - 444, -393, 1162, -393, -393, 377, 1054, -393, 13, -393, - -393, 739, -393, -393, 821, 517, -393, -393, 35, -393, - 81, 252, 278, 420, 1108, 297, 304, -393, 174, -393, - 121, -393, 21, 111, 112, -393, 25, -393, 394, -393, - -393, -393, 13, -393, 231, -393, 231, -393, 231, 81, - -393, 443, -393, 81, -393, -393, -393, 81, -393 + -396, 542, -396, -396, 1, 271, -396, 39, 258, -396, + -396, -396, -396, -396, 271, 313, 195, 333, 271, 271, + 271, -396, 271, 235, 11, 271, -27, -396, -396, 226, + 232, 271, 271, 271, 221, 271, 1217, -396, -396, -396, + -396, -396, 665, 28, 87, -396, -396, 150, 292, 354, + -396, 150, 150, 150, 150, -4, 86, 96, 105, 151, + 183, 192, 200, 150, 150, -396, 271, 150, 161, 150, + 150, -396, -396, 150, -396, -396, -396, -396, -396, 313, + -396, -396, 19, -396, -396, -396, -396, -396, -396, 19, + -396, -396, -396, 705, 17, -396, 231, -396, -396, -396, + 98, 271, 271, 271, 271, 271, -396, 271, 222, -396, + 26, 271, 19, -396, -396, 283, 254, 256, -396, -396, + -396, -396, -396, 298, 71, 274, -396, 329, 337, 123, + -396, -396, -396, -396, -396, 271, -396, 69, 271, 271, + 271, 271, 271, 271, 271, 328, -396, 348, 113, -396, + 271, 19, 271, -396, 234, -396, 485, 331, -396, 332, + 400, 25, 271, 401, 7, -396, -396, -396, -396, 271, + 271, 271, 271, 271, 271, 271, 271, -396, -396, 249, + -396, 271, -396, -396, -396, 900, -396, -396, 900, 900, + 375, 900, 391, 398, -396, -396, -396, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, 360, -396, -396, + 19, -396, -396, -396, -396, -396, 363, 369, 900, 900, + -396, -396, -396, -396, -396, -396, -396, 271, 249, 374, + -396, 163, 150, 381, 108, 422, 163, 150, 423, 405, + 173, 437, 407, 1173, 163, -396, -396, -396, -396, -396, + -396, -396, -396, -396, 271, -396, 447, 411, 19, 211, + 900, -396, -396, 321, 900, 177, -396, 415, -396, 306, + 292, 354, -396, -396, -396, 271, 401, -396, 14, -396, + -396, -396, -396, -396, -396, -396, -396, -396, -396, 19, + 900, 412, 442, -396, -396, 900, 900, 208, -396, 245, + 83, -396, 900, -396, -396, 900, -396, 463, -26, -396, + -396, 271, 465, 372, 170, -396, -396, -396, 19, 344, + 433, 1173, 475, 392, 181, 271, 313, 439, 351, 957, + -396, -396, -396, 900, -396, 207, 271, 271, -396, 770, + -396, 900, 196, 15, 900, 900, 19, 19, 835, -396, + 835, 254, -396, -396, -396, -396, -396, 492, -396, 74, + 900, 900, -396, -396, 464, 368, 19, 459, -396, -396, + -396, 150, 163, -396, 453, 271, 1011, 460, -396, -396, + -396, 150, 163, 385, 203, -396, -396, -396, -396, 411, + 19, 19, 900, -396, -396, 423, -396, 16, -396, 271, + -396, 835, -396, 411, 83, 900, 461, -396, 185, -396, + -396, 150, 271, 52, -396, -396, -13, -396, 19, 388, + -396, 135, -396, -396, 1173, 900, 83, 394, 835, -396, + 835, 19, -396, 74, -396, -396, 29, 900, 150, 19, + -396, -396, 481, 504, -396, 1173, -396, -396, 481, 1065, + -396, 74, -396, -396, 835, -396, -396, 900, 608, -396, + -396, 150, -396, 19, 259, 279, 466, 1119, 290, 314, + -396, 83, -396, -13, -396, 92, 128, 166, -396, 9, + -396, 499, -396, -396, -396, 74, -396, 271, -396, 271, + -396, 271, 19, -396, 508, -396, 19, -396, -396, -396, + 19, -396 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -937,81 +937,82 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 2, 0, 1, 14, 0, 0, 129, 0, 37, 100, - 95, 96, 98, 99, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 234, 235, 0, - 0, 0, 0, 0, 0, 0, 0, 128, 127, 3, - 4, 6, 41, 78, 0, 13, 5, 0, 0, 0, - 82, 0, 0, 0, 0, 153, 154, 155, 156, 157, - 158, 159, 160, 0, 0, 198, 204, 0, 0, 0, - 0, 100, 12, 0, 11, 7, 8, 9, 10, 0, - 97, 37, 39, 125, 126, 123, 100, 122, 124, 90, - 100, 239, 100, 207, 41, 42, 43, 189, 100, 100, - 0, 0, 0, 0, 0, 0, 175, 0, 0, 194, - 200, 201, 224, 177, 169, 0, 0, 0, 27, 30, - 29, 181, 16, 0, 0, 0, 143, 0, 0, 19, - 26, 25, 185, 173, 161, 0, 165, 197, 0, 0, - 0, 0, 0, 0, 0, 0, 193, 0, 37, 205, - 0, 91, 0, 100, 0, 100, 0, 0, 69, 0, - 0, 0, 0, 89, 0, 70, 81, 71, 72, 0, - 0, 0, 0, 0, 0, 0, 0, 75, 73, 202, - 74, 0, 76, 79, 80, 233, 77, 100, 139, 227, - 241, 230, 0, 0, 116, 115, 117, 118, 121, 119, - 103, 100, 104, 101, 105, 100, 0, 100, 120, 102, - 108, 109, 217, 100, 100, 0, 0, 229, 231, 100, - 191, 179, 171, 183, 187, 163, 0, 203, 0, 236, - 0, 0, 0, 0, 0, 0, 0, 145, 23, 0, - 0, 0, 0, 0, 164, 100, 190, 178, 170, 182, - 186, 174, 162, 0, 38, 0, 243, 40, 0, 226, - 138, 135, 132, 131, 0, 100, 0, 100, 89, 0, - 0, 199, 100, 100, 0, 92, 100, 0, 100, 168, - 172, 176, 180, 184, 188, 192, 195, 206, 225, 228, - 0, 0, 111, 112, 209, 113, 0, 110, 0, 0, - 47, 44, 100, 100, 232, 167, 0, 0, 258, 254, - 34, 0, 0, 0, 255, 253, 148, 146, 0, 0, - 0, 0, 0, 0, 34, 37, 0, 0, 0, 51, - 50, 54, 196, 166, 0, 0, 0, 100, 211, 141, - 136, 0, 0, 130, 137, 93, 94, 48, 100, 48, - 0, 240, 217, 106, 100, 107, 0, 215, 0, 45, - 46, 247, 237, 0, 0, 35, 0, 246, 248, 0, - 0, 150, 0, 34, 0, 0, 57, 58, 0, 0, - 0, 0, 20, 53, 52, 245, 244, 134, 133, 140, - 100, 217, 145, 100, 0, 100, 0, 85, 48, 87, - 242, 0, 114, 0, 216, 0, 208, 238, 100, 0, - 0, 257, 256, 48, 149, 147, 0, 24, 0, 56, - 55, 0, 213, 0, 0, 48, 100, 48, 49, 84, - 0, 100, 100, 0, 31, 100, 36, 249, 250, 0, - 0, 144, 0, 59, 60, 0, 0, 217, 0, 150, - 86, 48, 88, 210, 218, 219, 28, 33, 32, 66, - 63, 0, 0, 0, 0, 0, 0, 18, 0, 212, - 48, 83, 0, 0, 0, 251, 0, 252, 0, 22, - 61, 62, 0, 142, 0, 222, 0, 220, 0, 64, - 67, 0, 152, 151, 214, 223, 221, 65, 68 + 2, 0, 1, 14, 0, 0, 131, 0, 37, 101, + 96, 97, 99, 100, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 236, 237, 0, + 0, 0, 0, 0, 0, 0, 0, 130, 129, 3, + 4, 6, 41, 79, 0, 13, 5, 0, 0, 0, + 83, 0, 0, 0, 0, 155, 156, 157, 158, 159, + 160, 161, 162, 0, 0, 200, 206, 0, 0, 0, + 0, 101, 12, 0, 11, 7, 8, 9, 10, 0, + 98, 37, 39, 127, 128, 125, 101, 124, 126, 91, + 101, 241, 101, 209, 41, 42, 43, 191, 101, 101, + 0, 0, 0, 0, 0, 0, 177, 0, 0, 196, + 202, 203, 226, 179, 171, 0, 0, 0, 27, 30, + 29, 183, 16, 0, 0, 0, 145, 0, 0, 19, + 26, 25, 187, 175, 163, 0, 167, 199, 0, 0, + 0, 0, 0, 0, 0, 0, 195, 0, 37, 207, + 0, 92, 0, 101, 0, 101, 0, 0, 70, 0, + 0, 0, 0, 90, 0, 71, 82, 72, 73, 0, + 0, 0, 0, 0, 0, 0, 0, 76, 74, 204, + 75, 0, 77, 80, 81, 235, 78, 101, 141, 229, + 243, 232, 0, 0, 118, 117, 119, 120, 123, 121, + 104, 101, 105, 102, 106, 114, 101, 0, 101, 122, + 103, 109, 110, 219, 101, 101, 0, 0, 231, 233, + 101, 193, 181, 173, 185, 189, 165, 0, 205, 0, + 238, 0, 0, 0, 0, 0, 0, 0, 147, 23, + 0, 0, 0, 0, 0, 166, 101, 192, 180, 172, + 184, 188, 176, 164, 0, 38, 0, 245, 40, 0, + 228, 140, 137, 134, 133, 0, 101, 0, 101, 90, + 0, 0, 201, 101, 101, 0, 93, 101, 0, 101, + 170, 174, 178, 182, 186, 190, 194, 197, 208, 227, + 230, 0, 0, 112, 113, 211, 115, 0, 111, 0, + 0, 47, 44, 101, 101, 234, 169, 0, 0, 261, + 257, 34, 0, 0, 0, 258, 256, 150, 148, 0, + 0, 0, 0, 0, 0, 34, 37, 0, 0, 0, + 51, 50, 54, 198, 168, 0, 0, 0, 101, 213, + 143, 138, 0, 0, 132, 139, 94, 95, 48, 101, + 48, 0, 242, 219, 107, 101, 108, 0, 217, 0, + 45, 46, 249, 239, 0, 0, 35, 0, 248, 250, + 251, 0, 0, 152, 0, 34, 0, 0, 57, 58, + 59, 0, 0, 0, 0, 20, 53, 52, 247, 246, + 136, 135, 142, 101, 219, 147, 101, 0, 101, 0, + 86, 48, 88, 244, 0, 116, 0, 218, 0, 210, + 240, 101, 0, 0, 260, 259, 48, 151, 149, 0, + 24, 0, 56, 55, 0, 215, 0, 0, 48, 101, + 48, 49, 85, 0, 101, 101, 0, 31, 101, 36, + 252, 253, 0, 0, 146, 0, 60, 61, 0, 0, + 219, 0, 152, 87, 48, 89, 212, 220, 221, 28, + 33, 32, 67, 64, 0, 0, 0, 0, 0, 0, + 18, 0, 214, 48, 84, 0, 0, 0, 254, 0, + 255, 0, 22, 62, 63, 0, 144, 0, 224, 0, + 222, 0, 65, 68, 0, 154, 153, 216, 225, 223, + 66, 69 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -393, -393, -393, -393, -393, -393, -393, -393, -393, -393, - 31, -292, -1, 10, 36, 30, -330, -312, 0, 20, - 39, 22, -393, -44, -41, 344, 255, -393, -5, 441, - -393, -393, -393, -393, -393, 75, 40, -393, -393, -393, - -393, -393, -393, -393, -393, -393, -393, -393, 314, 462, - -393, -393, -393, -393, -393, -392, -331, -334, -393, 277, - -393, -393, 335, -104, -393, -393, -393, -393, -393, -393, - -393, -393, -393 + -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, + 88, -300, -1, 10, 34, 30, -331, -316, 0, 76, + 80, 32, -396, -36, -41, 307, 325, -396, -5, 49, + -396, -396, -396, -396, -396, 134, 82, -396, -396, -396, + -396, -396, -396, -396, -396, -396, -396, -396, 379, 518, + -396, -396, -396, -396, -396, -395, -345, -294, -396, 323, + -396, -396, 382, -104, -396, -396, -396, -396, -396, -396, + -396, -396, -396 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 1, 39, 40, 241, 242, 319, 320, 41, 232, - 433, 364, 94, 95, 96, 97, 397, 328, 329, 461, - 462, 330, 47, 48, 49, 259, 296, 210, 211, 50, - 51, 52, 53, 392, 237, 318, 413, 54, 55, 56, + 0, 1, 39, 40, 242, 243, 320, 321, 41, 233, + 436, 365, 94, 95, 96, 97, 400, 329, 330, 464, + 465, 331, 47, 48, 49, 260, 297, 211, 212, 50, + 51, 52, 53, 395, 238, 319, 416, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 212, 352, 391, 447, 358, 299, 406, 68, 260, - 69, 70, 71, 243, 72, 190, 291, 73, 74, 75, + 67, 213, 353, 394, 450, 359, 300, 409, 68, 261, + 69, 70, 71, 244, 72, 190, 292, 73, 74, 75, 76, 77, 78 }; @@ -1020,353 +1021,353 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 42, 45, 90, 92, 82, 164, 89, 161, 374, 430, - 98, 43, 230, 160, 147, 100, 362, 110, 112, 399, - 235, 401, 160, 46, 160, 5, 160, 363, 122, 147, - 81, 448, 380, 5, 137, -42, 169, 44, 81, 170, - 490, 151, 171, 150, 256, 311, 5, 109, 163, 6, - 113, 81, 114, 5, 5, 121, 162, 162, 81, 81, - 423, 132, 133, 134, 136, 179, 146, -42, 429, 6, - -42, 278, 83, 84, 187, 245, 482, 404, 85, 147, - 348, 416, 395, 441, 426, 484, -42, -42, -42, 491, - 152, 312, 209, 86, 147, 450, 453, 452, 369, 37, - 38, 321, 354, 87, 88, 79, 276, 393, 147, 446, - 227, 355, 269, 181, 469, 270, 468, 277, 234, 37, - 38, 471, 153, 5, 5, 154, 219, 6, 81, 81, - 464, 220, 221, 222, 223, 224, 229, 225, 485, 487, - 483, 155, 156, 157, 456, 6, 80, 322, 494, 257, - 495, 258, 496, 262, 432, 268, 353, 354, 229, 275, - 163, 89, 151, 396, 437, 244, 438, 240, 246, 247, - 248, 249, 250, 251, 252, 486, 488, 37, 38, 440, - 288, 5, 378, 255, 209, 240, 81, 209, 209, 307, - 209, 443, 5, 444, 123, 37, 38, 81, 124, 279, - 280, 281, 282, 283, 284, 285, 286, 229, 5, 370, - -17, 439, 147, 81, 115, 385, 209, 209, 116, 379, - 229, 147, 5, 229, 125, 229, 342, 81, 341, 99, - 386, 172, 356, 147, 357, 149, 317, 126, 445, 337, - 173, 42, 335, 5, 117, 127, 400, 287, 81, 261, - 128, 336, 43, 229, 129, 147, 305, 118, 209, 83, - 84, 135, 209, 89, 367, 85, 368, 151, 91, 163, - 83, 84, 130, 345, 346, 119, 85, 376, 44, 377, - 174, 5, 147, 333, 131, 213, 81, 120, 209, 226, - 87, 88, 175, 209, 209, 253, 149, 394, 159, 160, - 209, 87, 88, 209, 214, 215, 216, 371, 372, 365, - 474, 10, 11, 12, 13, 475, 176, 5, 147, 42, - 92, 5, 81, 365, 162, 128, 81, 42, 383, 381, - 43, 209, 408, 409, 387, 388, 476, 209, 43, 209, - 163, 477, 209, 209, 5, 273, 209, 274, 209, 81, - 384, 421, 409, 93, 228, 474, 44, 405, 209, 209, - 480, 229, 476, 5, 44, 5, 316, 481, 81, 231, - 81, 415, 365, 42, 383, 5, 101, 233, 414, 236, - 81, 238, 102, 239, 43, 442, 409, 103, 209, 5, - 104, 317, 459, 254, 81, 428, 384, 209, 449, 372, - 290, 209, 105, 106, 107, 108, 5, 292, 436, 492, - 44, 81, 80, 293, 297, 185, 302, 303, 306, 313, - 42, 209, 323, 310, 209, -21, 209, 324, 334, 405, - 188, 43, 307, 209, 189, 339, 191, 351, 460, 361, - 350, 42, 217, 218, 460, 42, 383, 405, 366, 373, - 209, 375, 43, 209, 209, 126, 43, 44, 498, 403, - 407, 463, 298, 42, 383, 465, 458, 424, 384, 410, - 271, 405, 405, 489, 43, 418, 431, 493, 44, 478, - 111, 405, 44, 405, 466, 405, 384, 497, 158, 470, - 300, 272, 165, 166, 167, 168, 0, 0, 0, 263, - 44, 0, 0, 0, 177, 178, 0, 0, 180, 182, - 183, 184, 0, 0, 186, 0, 0, 0, 0, 0, - 0, 192, 193, 194, 195, 196, 197, 198, 199, 5, - 0, 289, 200, 0, 81, 0, 0, 0, 0, 0, - 0, 202, 0, 0, 0, 294, 0, 203, 0, 295, - 0, 295, 204, 0, 0, 83, 84, 0, 301, 0, - 0, 85, 0, 304, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 205, 0, 472, 206, 473, 0, 0, - 0, 0, 0, 207, 0, 208, 87, 88, 0, 332, - 0, 0, 0, 192, 193, 194, 195, 196, 197, 198, - 199, 5, 0, 0, 200, 201, 81, 0, 0, 338, - 0, 340, 0, 202, 0, 0, 343, 344, 0, 203, - 347, 0, 349, 0, 204, 0, 0, 83, 84, 0, - 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 205, 359, 360, 206, 0, - 0, 0, 0, 0, 0, 207, 0, 208, 87, 88, - 0, 0, 192, 193, 194, 195, 196, 197, 198, 199, - 5, 308, 309, 200, 390, 81, 314, 315, 0, 0, - 0, 389, 202, 0, 331, 0, 0, 0, 203, 0, - 0, 0, 398, 204, -89, -89, 83, 84, 402, 0, - 5, 147, 85, 0, 0, 148, 0, -89, -89, -89, - -89, 0, 0, 0, 205, 149, 0, 206, 0, 0, - 0, 0, 0, 0, 207, 0, 208, 87, 88, 0, - 150, 0, 0, 0, 422, 0, 0, 425, 0, 427, - 0, 0, 0, 192, 193, 194, 195, 196, 197, 198, - 199, 5, 434, 0, 200, 0, 81, 0, 0, 0, - 0, 0, 0, 202, 0, 0, 0, 0, 0, 203, - 451, 0, 0, 0, 204, 454, 455, 83, 84, 434, - 0, 396, 0, 85, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 205, 0, 0, 206, 0, - 0, 0, 0, 0, 0, 207, 0, 208, 87, 88, - 411, 412, 0, 0, 0, 0, 0, 0, 0, 419, - 420, 0, 0, 0, 0, 192, 193, 194, 195, 196, - 197, 198, 199, 5, 0, 0, 200, 0, 81, 0, - 0, 0, 0, 0, 0, 202, 0, 0, 0, 435, - 0, 203, 0, 0, 0, 0, 204, 0, 0, 83, - 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, - 0, 0, 0, 0, 457, 0, 435, 205, 0, 0, - 206, 0, 0, 0, 0, 0, 0, 207, 0, 208, - 87, 88, 2, 3, 0, 0, 0, 0, 4, 457, - 0, 0, 0, 0, 5, 0, 6, 7, 0, 8, + 42, 45, 90, 92, 82, 376, 89, 161, 404, 433, + 98, 43, 231, 164, 160, 100, 79, 110, 112, 402, + 236, 160, 160, 160, 493, 383, 122, 363, 118, 399, + 147, 451, 147, 46, 137, 44, -42, 5, 364, 147, + 162, 151, 81, 6, 257, 443, 119, 109, 163, 426, + 113, 5, 114, 149, 169, 121, 81, 80, 120, 150, + 459, 132, 133, 134, 136, 179, 146, 440, -42, 441, + 432, -42, 279, 494, 187, 419, 485, 83, 84, 349, + 398, 429, 147, 85, 235, 444, 5, -42, -42, -42, + 277, 81, 210, 37, 38, 152, 158, 453, 86, 455, + 165, 166, 167, 168, 5, 471, 87, 88, 449, 81, + 228, 147, 177, 178, 442, 271, 180, 182, 183, 184, + 270, 312, 186, 474, 230, 278, 256, 153, 246, 467, + 154, 221, 222, 223, 224, 225, 241, 226, 407, 456, + 5, 357, 486, 358, 170, 81, 155, 156, 157, 258, + 446, 259, 447, 263, 171, 269, 487, 472, 220, 276, + 163, 89, 151, 172, 6, 245, 230, 313, 247, 248, + 249, 250, 251, 252, 253, 6, 230, 6, 5, -17, + 289, 488, 490, 81, 210, 371, 322, 210, 210, 5, + 210, 497, 489, 498, 81, 499, 381, 448, 147, 280, + 281, 282, 283, 284, 285, 286, 287, 5, 5, 173, + 372, 162, 81, 81, 37, 38, 241, 210, 210, 181, + 382, 308, 388, 230, 147, 37, 38, 37, 38, 342, + 491, 389, 323, 5, 230, 343, 338, 318, 81, 123, + 127, 174, 42, 124, 435, 128, 5, 403, 115, 129, + 175, 81, 116, 43, 336, 99, 230, 306, 176, 210, + 230, 396, 147, 210, 89, 354, 355, 130, 151, 125, + 163, 214, 135, 227, 346, 347, 288, 44, 117, 131, + 309, 310, 126, 5, 334, 315, 316, 262, 81, 210, + 215, 216, 217, 332, 210, 210, 83, 84, 159, 160, + 229, 210, 85, 355, 210, 91, 397, 230, 356, 232, + 366, 10, 11, 12, 13, 234, 93, 477, 5, 147, + 42, 92, 478, 81, 366, 87, 88, 237, 42, 386, + 337, 43, 210, 149, 147, 390, 391, 479, 210, 43, + 210, 163, 480, 210, 210, 5, 239, 210, 477, 210, + 81, 83, 84, 483, 240, 44, 101, 85, 408, 210, + 210, 387, 102, 44, 128, 255, 5, 103, 384, 162, + 104, 81, 479, 418, 366, 42, 386, 484, 185, 254, + 87, 88, 105, 106, 107, 108, 43, 368, 80, 369, + 274, 210, 291, 188, 318, 293, 370, 189, 431, 191, + 210, 373, 374, 294, 210, 218, 219, 378, 387, 379, + 44, 439, 5, 5, 147, 275, 380, 81, 81, 298, + 414, 415, 303, 42, 210, 411, 412, 210, 304, 210, + 422, 423, 408, 307, 43, 5, 210, 311, 317, 314, + 81, 463, 424, 412, 42, 445, 412, 463, 42, 386, + 408, 452, 374, 210, 324, 43, 210, 210, 44, 43, + 438, -21, 264, 325, 335, 5, 42, 386, 417, 308, + 81, 340, 351, 352, 408, 408, 492, 43, 362, 44, + 496, 387, 367, 44, 408, 460, 408, 438, 408, 375, + 500, 159, 377, 5, 290, 126, 462, 5, 81, 387, + 265, 44, 81, 266, 10, 11, 12, 13, 295, 406, + 460, 5, 18, 296, 495, 296, 81, 410, 413, 421, + 434, 466, 302, 501, 468, 481, 461, 305, 469, 427, + 27, 28, 267, 299, 473, 272, 111, 301, 273, 0, + 0, 0, 2, 3, 268, 0, 0, 0, 4, 0, + 0, 0, 0, 333, 5, 0, 6, 7, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 0, 0, 21, 0, 22, 23, 24, 25, - 0, 0, 0, 26, 0, 0, 0, 27, 28, 29, + 19, 20, 0, 339, 21, 341, 22, 23, 24, 25, + 344, 345, 0, 26, 348, 0, 350, 27, 28, 29, 30, 31, 32, 33, 34, 0, 35, 36, 0, 0, - 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, - 6, 7, 0, 325, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 0, 382, 0, 0, - 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, - 0, 27, 28, 326, 327, 31, 32, 33, 34, 0, - 35, 36, 0, 0, 0, 0, 4, 0, 0, 0, - 37, 38, 5, 0, 6, 7, 0, 325, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 0, 417, 0, 0, 22, 0, 0, 25, 0, 0, - 0, 0, 0, 0, 0, 27, 28, 326, 327, 31, - 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, - 4, 0, 0, 0, 37, 38, 5, 0, 6, 7, - 0, 325, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 0, 467, 0, 0, 22, 0, - 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, - 28, 326, 327, 31, 32, 33, 34, 0, 35, 36, - 0, 0, 0, 0, 4, 0, 0, 0, 37, 38, - 5, 0, 6, 7, 0, 325, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 0, 479, - 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, - 0, 0, 0, 27, 28, 326, 327, 31, 32, 33, - 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, - 0, 0, 37, 38, 5, 0, 6, 7, 0, 325, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 0, 0, 0, 0, 22, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 0, 27, 28, 326, - 327, 31, 32, 33, 34, 0, 35, 36, 0, 159, - 0, 0, 0, 0, 0, 5, 37, 38, 264, 0, - 81, 265, 10, 11, 12, 13, 0, 0, 0, 5, - 18, 0, 0, 0, 81, 0, 0, 0, 0, 0, - 138, 0, 0, 0, 0, 0, 139, 0, 27, 28, - 266, 140, 0, 0, 141, 0, 0, 0, 0, 0, - 0, 0, 267, 0, 0, 0, 142, 143, 144, 145 + 0, 0, 0, 0, 0, 0, 37, 38, 0, 0, + 360, 361, 192, 193, 194, 195, 196, 197, 198, 199, + 5, 0, 0, 200, 0, 81, 0, 0, 0, 0, + 0, 0, 202, 0, 0, 0, 0, 0, 203, 0, + 0, 0, 0, 204, 0, 392, 83, 84, 0, 0, + 0, 0, 85, 0, 0, 0, 401, 0, 0, 0, + 0, 205, 405, 0, 206, 0, 475, 207, 476, 0, + 208, -90, -90, 0, 209, 87, 88, 5, 147, 0, + 0, 0, 148, 0, -90, -90, -90, -90, 0, 0, + 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, + 425, 0, 0, 428, 0, 430, 0, 150, 0, 192, + 193, 194, 195, 196, 197, 198, 199, 5, 437, 0, + 200, 201, 81, 0, 0, 0, 0, 0, 0, 202, + 0, 0, 0, 0, 0, 203, 454, 0, 0, 0, + 204, 457, 458, 83, 84, 437, 0, 0, 0, 85, + 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, + 0, 206, 0, 0, 207, 0, 0, 208, 0, 0, + 0, 209, 87, 88, 192, 193, 194, 195, 196, 197, + 198, 199, 5, 0, 0, 200, 393, 81, 0, 0, + 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, + 203, 0, 0, 0, 0, 204, 0, 0, 83, 84, + 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, + 0, 0, 0, 205, 0, 0, 206, 0, 0, 207, + 0, 0, 208, 0, 0, 0, 209, 87, 88, 192, + 193, 194, 195, 196, 197, 198, 199, 5, 0, 0, + 200, 0, 81, 0, 0, 0, 0, 0, 0, 202, + 0, 0, 0, 0, 0, 203, 0, 0, 0, 0, + 204, 0, 0, 83, 84, 0, 0, 399, 0, 85, + 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, + 0, 206, 0, 0, 207, 0, 0, 208, 0, 0, + 0, 209, 87, 88, 192, 193, 194, 195, 196, 197, + 198, 199, 5, 0, 0, 200, 0, 81, 0, 0, + 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, + 203, 0, 0, 0, 0, 204, 0, 0, 83, 84, + 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, + 0, 0, 0, 205, 0, 0, 206, 0, 0, 207, + 0, 0, 208, 4, 0, 0, 209, 87, 88, 5, + 0, 6, 7, 0, 326, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 0, 385, 0, + 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, + 0, 0, 27, 28, 327, 328, 31, 32, 33, 34, + 0, 35, 36, 0, 0, 0, 0, 4, 0, 0, + 0, 37, 38, 5, 0, 6, 7, 0, 326, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 0, 420, 0, 0, 22, 0, 0, 25, 0, + 0, 0, 0, 0, 0, 0, 27, 28, 327, 328, + 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, + 0, 4, 0, 0, 0, 37, 38, 5, 0, 6, + 7, 0, 326, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 0, 470, 0, 0, 22, + 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, + 27, 28, 327, 328, 31, 32, 33, 34, 0, 35, + 36, 0, 0, 0, 0, 4, 0, 0, 0, 37, + 38, 5, 0, 6, 7, 0, 326, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, + 482, 0, 0, 22, 0, 0, 25, 0, 0, 0, + 0, 0, 0, 0, 27, 28, 327, 328, 31, 32, + 33, 34, 0, 35, 36, 0, 0, 0, 0, 4, + 0, 0, 0, 37, 38, 5, 0, 6, 7, 0, + 326, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 0, 0, 0, 0, 22, 0, 0, + 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, + 327, 328, 31, 32, 33, 34, 0, 35, 36, 5, + 0, 0, 0, 0, 81, 0, 0, 37, 38, 0, + 138, 0, 0, 0, 0, 0, 139, 0, 0, 0, + 0, 140, 0, 0, 141, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 142, 143, 144, 145 }; static const yytype_int16 yycheck[] = { - 1, 1, 7, 8, 5, 49, 7, 48, 320, 401, - 15, 1, 116, 7, 13, 16, 53, 18, 19, 349, - 124, 352, 7, 1, 7, 12, 7, 64, 53, 13, - 17, 423, 324, 12, 35, 8, 58, 1, 17, 58, - 15, 42, 58, 42, 148, 13, 12, 17, 49, 14, - 20, 17, 22, 12, 12, 25, 15, 15, 17, 17, - 391, 31, 32, 33, 34, 66, 36, 40, 398, 14, - 43, 65, 38, 39, 79, 59, 468, 64, 44, 13, - 65, 373, 65, 413, 65, 64, 59, 60, 61, 64, - 8, 59, 93, 59, 13, 425, 430, 427, 15, 64, - 65, 13, 58, 69, 70, 15, 65, 65, 13, 421, - 111, 67, 156, 58, 448, 156, 447, 161, 13, 64, - 65, 451, 40, 12, 12, 43, 60, 14, 17, 17, - 442, 101, 102, 103, 104, 105, 53, 107, 472, 473, - 470, 59, 60, 61, 31, 14, 56, 59, 482, 150, - 484, 152, 486, 154, 59, 156, 57, 58, 53, 160, - 161, 162, 163, 42, 15, 135, 17, 13, 138, 139, - 140, 141, 142, 143, 144, 64, 64, 64, 65, 58, - 181, 12, 15, 13, 185, 13, 17, 188, 189, 58, - 191, 15, 12, 17, 13, 64, 65, 17, 17, 169, - 170, 171, 172, 173, 174, 175, 176, 53, 12, 313, - 56, 62, 13, 17, 13, 15, 217, 218, 17, 323, - 53, 13, 12, 53, 43, 53, 270, 17, 269, 60, - 334, 58, 58, 13, 60, 27, 237, 56, 62, 59, - 58, 242, 43, 12, 43, 8, 350, 27, 17, 53, - 13, 9, 242, 53, 17, 13, 226, 17, 259, 38, - 39, 51, 263, 264, 15, 44, 17, 268, 47, 270, - 38, 39, 35, 274, 275, 35, 44, 15, 242, 17, - 58, 12, 13, 253, 47, 40, 17, 47, 289, 51, - 69, 70, 58, 294, 295, 51, 27, 341, 6, 7, - 301, 69, 70, 304, 59, 60, 61, 57, 58, 310, - 58, 19, 20, 21, 22, 63, 58, 12, 13, 320, - 325, 12, 17, 324, 15, 13, 17, 328, 328, 17, - 320, 332, 57, 58, 335, 336, 58, 338, 328, 340, - 341, 63, 343, 344, 12, 59, 347, 15, 349, 17, - 328, 57, 58, 9, 17, 58, 320, 358, 359, 360, - 63, 53, 58, 12, 328, 12, 15, 63, 17, 53, - 17, 372, 373, 374, 374, 12, 23, 17, 15, 53, - 17, 17, 29, 17, 374, 57, 58, 34, 389, 12, - 37, 392, 15, 17, 17, 396, 374, 398, 57, 58, - 17, 402, 49, 50, 51, 52, 12, 4, 409, 15, - 374, 17, 56, 5, 59, 71, 59, 59, 59, 17, - 421, 422, 17, 56, 425, 56, 427, 56, 17, 430, - 86, 421, 58, 434, 90, 56, 92, 31, 439, 15, - 60, 442, 98, 99, 445, 446, 446, 448, 17, 56, - 451, 17, 442, 454, 455, 56, 446, 421, 15, 17, - 53, 17, 207, 464, 464, 445, 435, 392, 446, 59, - 156, 472, 473, 474, 464, 59, 59, 478, 442, 59, - 18, 482, 446, 484, 445, 486, 464, 488, 47, 449, - 213, 156, 51, 52, 53, 54, -1, -1, -1, 155, - 464, -1, -1, -1, 63, 64, -1, -1, 67, 68, - 69, 70, -1, -1, 73, -1, -1, -1, -1, -1, - -1, 4, 5, 6, 7, 8, 9, 10, 11, 12, - -1, 187, 15, -1, 17, -1, -1, -1, -1, -1, - -1, 24, -1, -1, -1, 201, -1, 30, -1, 205, - -1, 207, 35, -1, -1, 38, 39, -1, 214, -1, - -1, 44, -1, 219, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 56, -1, 58, 59, 60, -1, -1, - -1, -1, -1, 66, -1, 68, 69, 70, -1, 245, - -1, -1, -1, 4, 5, 6, 7, 8, 9, 10, - 11, 12, -1, -1, 15, 16, 17, -1, -1, 265, - -1, 267, -1, 24, -1, -1, 272, 273, -1, 30, - 276, -1, 278, -1, 35, -1, -1, 38, 39, -1, - -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 56, 302, 303, 59, -1, - -1, -1, -1, -1, -1, 66, -1, 68, 69, 70, - -1, -1, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 230, 231, 15, 16, 17, 235, 236, -1, -1, - -1, 337, 24, -1, 243, -1, -1, -1, 30, -1, - -1, -1, 348, 35, 6, 7, 38, 39, 354, -1, - 12, 13, 44, -1, -1, 17, -1, 19, 20, 21, - 22, -1, -1, -1, 56, 27, -1, 59, -1, -1, - -1, -1, -1, -1, 66, -1, 68, 69, 70, -1, - 42, -1, -1, -1, 390, -1, -1, 393, -1, 395, - -1, -1, -1, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 408, -1, 15, -1, 17, -1, -1, -1, - -1, -1, -1, 24, -1, -1, -1, -1, -1, 30, - 426, -1, -1, -1, 35, 431, 432, 38, 39, 435, - -1, 42, -1, 44, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 56, -1, -1, 59, -1, - -1, -1, -1, -1, -1, 66, -1, 68, 69, 70, - 369, 370, -1, -1, -1, -1, -1, -1, -1, 378, - 379, -1, -1, -1, -1, 4, 5, 6, 7, 8, - 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, - -1, -1, -1, -1, -1, 24, -1, -1, -1, 408, - -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, - 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, - -1, -1, -1, -1, 433, -1, 435, 56, -1, -1, - 59, -1, -1, -1, -1, -1, -1, 66, -1, 68, - 69, 70, 0, 1, -1, -1, -1, -1, 6, 458, - -1, -1, -1, -1, 12, -1, 14, 15, -1, 17, + 1, 1, 7, 8, 5, 321, 7, 48, 353, 404, + 15, 1, 116, 49, 7, 16, 15, 18, 19, 350, + 124, 7, 7, 7, 15, 325, 53, 53, 17, 42, + 13, 426, 13, 1, 35, 1, 8, 12, 64, 13, + 15, 42, 17, 14, 148, 58, 35, 17, 49, 394, + 20, 12, 22, 27, 58, 25, 17, 56, 47, 42, + 31, 31, 32, 33, 34, 66, 36, 15, 40, 17, + 401, 43, 65, 64, 79, 375, 471, 38, 39, 65, + 65, 65, 13, 44, 13, 416, 12, 59, 60, 61, + 65, 17, 93, 64, 65, 8, 47, 428, 59, 430, + 51, 52, 53, 54, 12, 450, 67, 68, 424, 17, + 111, 13, 63, 64, 62, 156, 67, 68, 69, 70, + 156, 13, 73, 454, 53, 161, 13, 40, 59, 445, + 43, 101, 102, 103, 104, 105, 13, 107, 64, 433, + 12, 58, 473, 60, 58, 17, 59, 60, 61, 150, + 15, 152, 17, 154, 58, 156, 64, 451, 60, 160, + 161, 162, 163, 58, 14, 135, 53, 59, 138, 139, + 140, 141, 142, 143, 144, 14, 53, 14, 12, 56, + 181, 475, 476, 17, 185, 15, 13, 188, 189, 12, + 191, 485, 64, 487, 17, 489, 15, 62, 13, 169, + 170, 171, 172, 173, 174, 175, 176, 12, 12, 58, + 314, 15, 17, 17, 64, 65, 13, 218, 219, 58, + 324, 58, 15, 53, 13, 64, 65, 64, 65, 270, + 64, 335, 59, 12, 53, 271, 59, 238, 17, 13, + 8, 58, 243, 17, 59, 13, 12, 351, 13, 17, + 58, 17, 17, 243, 43, 60, 53, 227, 58, 260, + 53, 65, 13, 264, 265, 57, 58, 35, 269, 43, + 271, 40, 51, 51, 275, 276, 27, 243, 43, 47, + 231, 232, 56, 12, 254, 236, 237, 53, 17, 290, + 59, 60, 61, 244, 295, 296, 38, 39, 6, 7, + 17, 302, 44, 58, 305, 47, 342, 53, 63, 53, + 311, 19, 20, 21, 22, 17, 9, 58, 12, 13, + 321, 326, 63, 17, 325, 67, 68, 53, 329, 329, + 9, 321, 333, 27, 13, 336, 337, 58, 339, 329, + 341, 342, 63, 344, 345, 12, 17, 348, 58, 350, + 17, 38, 39, 63, 17, 321, 23, 44, 359, 360, + 361, 329, 29, 329, 13, 17, 12, 34, 17, 15, + 37, 17, 58, 374, 375, 376, 376, 63, 71, 51, + 67, 68, 49, 50, 51, 52, 376, 15, 56, 17, + 59, 392, 17, 86, 395, 4, 24, 90, 399, 92, + 401, 57, 58, 5, 405, 98, 99, 15, 376, 17, + 376, 412, 12, 12, 13, 15, 24, 17, 17, 59, + 371, 372, 59, 424, 425, 57, 58, 428, 59, 430, + 381, 382, 433, 59, 424, 12, 437, 56, 15, 17, + 17, 442, 57, 58, 445, 57, 58, 448, 449, 449, + 451, 57, 58, 454, 17, 445, 457, 458, 424, 449, + 411, 56, 155, 56, 17, 12, 467, 467, 15, 58, + 17, 56, 60, 31, 475, 476, 477, 467, 15, 445, + 481, 449, 17, 449, 485, 436, 487, 438, 489, 56, + 491, 6, 17, 12, 187, 56, 15, 12, 17, 467, + 15, 467, 17, 18, 19, 20, 21, 22, 201, 17, + 461, 12, 27, 206, 15, 208, 17, 53, 59, 59, + 59, 17, 215, 15, 448, 59, 438, 220, 448, 395, + 45, 46, 47, 208, 452, 156, 18, 214, 156, -1, + -1, -1, 0, 1, 59, -1, -1, -1, 6, -1, + -1, -1, -1, 246, 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, -1, -1, 32, -1, 34, 35, 36, 37, - -1, -1, -1, 41, -1, -1, -1, 45, 46, 47, + 28, 29, -1, 266, 32, 268, 34, 35, 36, 37, + 273, 274, -1, 41, 277, -1, 279, 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, - -1, -1, 6, -1, -1, -1, 64, 65, 12, -1, - 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, -1, 31, -1, -1, - 34, -1, -1, 37, -1, -1, -1, -1, -1, -1, - -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, - 54, 55, -1, -1, -1, -1, 6, -1, -1, -1, - 64, 65, 12, -1, 14, 15, -1, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - -1, 31, -1, -1, 34, -1, -1, 37, -1, -1, - -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, - 50, 51, 52, -1, 54, 55, -1, -1, -1, -1, - 6, -1, -1, -1, 64, 65, 12, -1, 14, 15, - -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, -1, 31, -1, -1, 34, -1, - -1, 37, -1, -1, -1, -1, -1, -1, -1, 45, - 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, - -1, -1, -1, -1, 6, -1, -1, -1, 64, 65, - 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, - -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, - -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, - 52, -1, 54, 55, -1, -1, -1, -1, 6, -1, - -1, -1, 64, 65, 12, -1, 14, 15, -1, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, - -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, - 48, 49, 50, 51, 52, -1, 54, 55, -1, 6, - -1, -1, -1, -1, -1, 12, 64, 65, 15, -1, - 17, 18, 19, 20, 21, 22, -1, -1, -1, 12, - 27, -1, -1, -1, 17, -1, -1, -1, -1, -1, - 23, -1, -1, -1, -1, -1, 29, -1, 45, 46, - 47, 34, -1, -1, 37, -1, -1, -1, -1, -1, - -1, -1, 59, -1, -1, -1, 49, 50, 51, 52 + -1, -1, -1, -1, -1, -1, 64, 65, -1, -1, + 303, 304, 4, 5, 6, 7, 8, 9, 10, 11, + 12, -1, -1, 15, -1, 17, -1, -1, -1, -1, + -1, -1, 24, -1, -1, -1, -1, -1, 30, -1, + -1, -1, -1, 35, -1, 338, 38, 39, -1, -1, + -1, -1, 44, -1, -1, -1, 349, -1, -1, -1, + -1, 53, 355, -1, 56, -1, 58, 59, 60, -1, + 62, 6, 7, -1, 66, 67, 68, 12, 13, -1, + -1, -1, 17, -1, 19, 20, 21, 22, -1, -1, + -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, + 393, -1, -1, 396, -1, 398, -1, 42, -1, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 411, -1, + 15, 16, 17, -1, -1, -1, -1, -1, -1, 24, + -1, -1, -1, -1, -1, 30, 429, -1, -1, -1, + 35, 434, 435, 38, 39, 438, -1, -1, -1, 44, + -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, + -1, 56, -1, -1, 59, -1, -1, 62, -1, -1, + -1, 66, 67, 68, 4, 5, 6, 7, 8, 9, + 10, 11, 12, -1, -1, 15, 16, 17, -1, -1, + -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, + 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, + -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, + -1, -1, -1, 53, -1, -1, 56, -1, -1, 59, + -1, -1, 62, -1, -1, -1, 66, 67, 68, 4, + 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, + 15, -1, 17, -1, -1, -1, -1, -1, -1, 24, + -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, + 35, -1, -1, 38, 39, -1, -1, 42, -1, 44, + -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, + -1, 56, -1, -1, 59, -1, -1, 62, -1, -1, + -1, 66, 67, 68, 4, 5, 6, 7, 8, 9, + 10, 11, 12, -1, -1, 15, -1, 17, -1, -1, + -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, + 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, + -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, + -1, -1, -1, 53, -1, -1, 56, -1, -1, 59, + -1, -1, 62, 6, -1, -1, 66, 67, 68, 12, + -1, 14, 15, -1, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 31, -1, + -1, 34, -1, -1, 37, -1, -1, -1, -1, -1, + -1, -1, 45, 46, 47, 48, 49, 50, 51, 52, + -1, 54, 55, -1, -1, -1, -1, 6, -1, -1, + -1, 64, 65, 12, -1, 14, 15, -1, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, -1, 31, -1, -1, 34, -1, -1, 37, -1, + -1, -1, -1, -1, -1, -1, 45, 46, 47, 48, + 49, 50, 51, 52, -1, 54, 55, -1, -1, -1, + -1, 6, -1, -1, -1, 64, 65, 12, -1, 14, + 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, -1, 31, -1, -1, 34, + -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, + 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, + 55, -1, -1, -1, -1, 6, -1, -1, -1, 64, + 65, 12, -1, 14, 15, -1, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 31, -1, -1, 34, -1, -1, 37, -1, -1, -1, + -1, -1, -1, -1, 45, 46, 47, 48, 49, 50, + 51, 52, -1, 54, 55, -1, -1, -1, -1, 6, + -1, -1, -1, 64, 65, 12, -1, 14, 15, -1, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, + 37, -1, -1, -1, -1, -1, -1, -1, 45, 46, + 47, 48, 49, 50, 51, 52, -1, 54, 55, 12, + -1, -1, -1, -1, 17, -1, -1, 64, 65, -1, + 23, -1, -1, -1, -1, -1, 29, -1, -1, -1, + -1, 34, -1, -1, 37, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 49, 50, 51, 52 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 72, 0, 1, 6, 12, 14, 15, 17, 18, + 0, 70, 0, 1, 6, 12, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 34, 35, 36, 37, 41, 45, 46, 47, - 48, 49, 50, 51, 52, 54, 55, 64, 65, 73, - 74, 79, 83, 84, 85, 89, 92, 93, 94, 95, - 100, 101, 102, 103, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 129, 131, - 132, 133, 135, 138, 139, 140, 141, 142, 143, 15, - 56, 17, 83, 38, 39, 44, 59, 69, 70, 83, - 99, 47, 99, 96, 83, 84, 85, 86, 99, 60, - 83, 23, 29, 34, 37, 49, 50, 51, 52, 86, - 83, 120, 83, 86, 86, 13, 17, 43, 17, 35, - 47, 86, 53, 13, 17, 43, 56, 8, 13, 17, - 35, 47, 86, 86, 86, 51, 86, 83, 23, 29, - 34, 37, 49, 50, 51, 52, 86, 13, 17, 27, - 42, 83, 8, 40, 43, 59, 60, 61, 100, 6, - 7, 95, 15, 83, 94, 100, 100, 100, 100, 58, - 58, 58, 58, 58, 58, 58, 58, 100, 100, 83, - 100, 58, 100, 100, 100, 96, 100, 99, 96, 96, - 136, 96, 4, 5, 6, 7, 8, 9, 10, 11, - 15, 16, 24, 30, 35, 56, 59, 66, 68, 83, - 98, 99, 122, 40, 59, 60, 61, 96, 96, 60, - 86, 86, 86, 86, 86, 86, 51, 83, 17, 53, - 134, 53, 80, 17, 13, 134, 53, 105, 17, 17, - 13, 75, 76, 134, 86, 59, 86, 86, 86, 86, - 86, 86, 86, 51, 17, 13, 134, 83, 83, 96, - 130, 53, 83, 96, 15, 18, 47, 59, 83, 94, - 95, 119, 133, 59, 15, 83, 65, 94, 65, 86, - 86, 86, 86, 86, 86, 86, 86, 27, 83, 96, - 17, 137, 4, 5, 96, 96, 97, 59, 97, 127, - 130, 96, 59, 59, 96, 86, 59, 58, 100, 100, - 56, 13, 59, 17, 100, 100, 15, 83, 106, 77, - 78, 13, 59, 17, 56, 17, 47, 48, 88, 89, - 92, 100, 96, 86, 17, 43, 9, 59, 96, 56, - 96, 95, 94, 96, 96, 83, 83, 96, 65, 96, - 60, 31, 123, 57, 58, 67, 58, 60, 126, 96, - 96, 15, 53, 64, 82, 83, 17, 15, 17, 15, - 134, 57, 58, 56, 88, 17, 15, 17, 15, 134, - 82, 17, 31, 89, 92, 15, 134, 83, 83, 96, - 16, 124, 104, 65, 94, 65, 42, 87, 96, 87, - 134, 127, 96, 17, 64, 83, 128, 53, 57, 58, - 59, 100, 100, 107, 15, 83, 82, 31, 59, 100, - 100, 57, 96, 127, 106, 96, 65, 96, 83, 87, - 126, 59, 59, 81, 96, 100, 83, 15, 17, 62, - 58, 87, 57, 15, 17, 62, 88, 125, 126, 57, - 87, 96, 87, 128, 96, 96, 31, 100, 81, 15, - 83, 90, 91, 17, 88, 90, 91, 31, 127, 128, - 107, 87, 58, 60, 58, 63, 58, 63, 59, 31, - 63, 63, 126, 87, 64, 128, 64, 128, 64, 83, - 15, 64, 15, 83, 128, 128, 128, 83, 15 + 48, 49, 50, 51, 52, 54, 55, 64, 65, 71, + 72, 77, 81, 82, 83, 87, 90, 91, 92, 93, + 98, 99, 100, 101, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 127, 129, + 130, 131, 133, 136, 137, 138, 139, 140, 141, 15, + 56, 17, 81, 38, 39, 44, 59, 67, 68, 81, + 97, 47, 97, 94, 81, 82, 83, 84, 97, 60, + 81, 23, 29, 34, 37, 49, 50, 51, 52, 84, + 81, 118, 81, 84, 84, 13, 17, 43, 17, 35, + 47, 84, 53, 13, 17, 43, 56, 8, 13, 17, + 35, 47, 84, 84, 84, 51, 84, 81, 23, 29, + 34, 37, 49, 50, 51, 52, 84, 13, 17, 27, + 42, 81, 8, 40, 43, 59, 60, 61, 98, 6, + 7, 93, 15, 81, 92, 98, 98, 98, 98, 58, + 58, 58, 58, 58, 58, 58, 58, 98, 98, 81, + 98, 58, 98, 98, 98, 94, 98, 97, 94, 94, + 134, 94, 4, 5, 6, 7, 8, 9, 10, 11, + 15, 16, 24, 30, 35, 53, 56, 59, 62, 66, + 81, 96, 97, 120, 40, 59, 60, 61, 94, 94, + 60, 84, 84, 84, 84, 84, 84, 51, 81, 17, + 53, 132, 53, 78, 17, 13, 132, 53, 103, 17, + 17, 13, 73, 74, 132, 84, 59, 84, 84, 84, + 84, 84, 84, 84, 51, 17, 13, 132, 81, 81, + 94, 128, 53, 81, 94, 15, 18, 47, 59, 81, + 92, 93, 117, 131, 59, 15, 81, 65, 92, 65, + 84, 84, 84, 84, 84, 84, 84, 84, 27, 81, + 94, 17, 135, 4, 5, 94, 94, 95, 59, 95, + 125, 128, 94, 59, 59, 94, 84, 59, 58, 98, + 98, 56, 13, 59, 17, 98, 98, 15, 81, 104, + 75, 76, 13, 59, 17, 56, 17, 47, 48, 86, + 87, 90, 98, 94, 84, 17, 43, 9, 59, 94, + 56, 94, 93, 92, 94, 94, 81, 81, 94, 65, + 94, 60, 31, 121, 57, 58, 63, 58, 60, 124, + 94, 94, 15, 53, 64, 80, 81, 17, 15, 17, + 24, 15, 132, 57, 58, 56, 86, 17, 15, 17, + 24, 15, 132, 80, 17, 31, 87, 90, 15, 132, + 81, 81, 94, 16, 122, 102, 65, 92, 65, 42, + 85, 94, 85, 132, 125, 94, 17, 64, 81, 126, + 53, 57, 58, 59, 98, 98, 105, 15, 81, 80, + 31, 59, 98, 98, 57, 94, 125, 104, 94, 65, + 94, 81, 85, 124, 59, 59, 79, 94, 98, 81, + 15, 17, 62, 58, 85, 57, 15, 17, 62, 86, + 123, 124, 57, 85, 94, 85, 126, 94, 94, 31, + 98, 79, 15, 81, 88, 89, 17, 86, 88, 89, + 31, 125, 126, 105, 85, 58, 60, 58, 63, 58, + 63, 59, 31, 63, 63, 124, 85, 64, 126, 64, + 126, 64, 81, 15, 64, 15, 81, 126, 126, 126, + 81, 15 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_uint8 yyr1[] = { - 0, 71, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 73, 75, 74, 76, - 74, 77, 74, 78, 74, 74, 74, 80, 79, 79, - 79, 81, 81, 81, 82, 82, 82, 83, 83, 83, - 84, 85, 85, 86, 86, 86, 86, 86, 87, 87, - 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 90, 90, 90, 91, 91, 91, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 93, 93, 93, 93, 93, 93, 94, - 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 97, 97, 98, 98, 98, 98, 98, - 98, 98, 99, 99, 99, 99, 99, 100, 100, 100, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, - 102, 104, 103, 105, 103, 106, 106, 106, 106, 106, - 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, - 108, 109, 109, 109, 109, 109, 109, 109, 109, 110, + 0, 69, 70, 70, 70, 70, 70, 70, 70, 70, + 70, 70, 70, 70, 70, 70, 71, 73, 72, 74, + 72, 75, 72, 76, 72, 72, 72, 78, 77, 77, + 77, 79, 79, 79, 80, 80, 80, 81, 81, 81, + 82, 83, 83, 84, 84, 84, 84, 84, 85, 85, + 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, + 87, 87, 87, 87, 88, 88, 88, 89, 89, 89, + 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, + 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, + 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 95, 95, 96, 96, 96, + 96, 96, 96, 96, 97, 97, 97, 97, 97, 98, + 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 100, 100, 102, 101, 103, 101, 104, 104, 104, + 104, 104, 105, 105, 105, 106, 106, 106, 106, 106, + 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, + 107, 108, 108, 108, 108, 109, 109, 109, 109, 110, 110, 110, 110, 111, 111, 111, 111, 112, 112, 112, - 112, 113, 113, 113, 113, 114, 114, 114, 114, 115, - 115, 115, 115, 116, 116, 116, 117, 117, 118, 118, - 119, 119, 119, 119, 119, 120, 120, 122, 121, 123, - 121, 124, 121, 125, 121, 126, 126, 127, 127, 128, - 128, 128, 128, 128, 129, 129, 130, 131, 131, 131, - 131, 131, 131, 132, 133, 133, 134, 134, 134, 136, - 135, 137, 137, 138, 138, 138, 139, 139, 139, 139, - 139, 139, 139, 140, 141, 142, 142, 142, 143 + 112, 113, 113, 113, 113, 114, 114, 114, 115, 115, + 116, 116, 117, 117, 117, 117, 117, 118, 118, 120, + 119, 121, 119, 122, 119, 123, 119, 124, 124, 125, + 125, 126, 126, 126, 126, 126, 127, 127, 128, 129, + 129, 129, 129, 129, 129, 130, 131, 131, 132, 132, + 132, 134, 133, 135, 135, 136, 136, 136, 137, 137, + 137, 137, 137, 137, 137, 137, 138, 139, 140, 140, + 140, 141 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1377,27 +1378,28 @@ static const yytype_int8 yyr2[] = 5, 0, 9, 0, 6, 2, 2, 0, 8, 2, 2, 1, 2, 2, 0, 1, 3, 1, 3, 2, 3, 1, 1, 1, 3, 4, 4, 3, 0, 2, - 1, 1, 2, 2, 4, 6, 6, 5, 5, 7, - 7, 9, 9, 1, 3, 4, 1, 3, 4, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, - 2, 2, 1, 8, 6, 5, 7, 5, 7, 1, - 2, 2, 3, 4, 4, 1, 1, 2, 1, 1, - 0, 2, 2, 2, 2, 2, 4, 4, 2, 2, - 3, 3, 3, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 4, 6, 6, 5, 5, 5, + 7, 7, 9, 9, 1, 3, 4, 1, 3, 4, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, + 2, 2, 2, 1, 8, 6, 5, 7, 5, 7, + 1, 2, 2, 3, 4, 4, 1, 1, 2, 1, + 1, 0, 2, 2, 2, 2, 2, 4, 4, 2, + 2, 3, 3, 3, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 3, 3, 5, 5, 3, 4, 4, 3, 3, - 5, 0, 9, 0, 7, 0, 1, 3, 1, 3, - 0, 5, 5, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 3, 3, 3, 2, 4, 4, 3, 2, - 3, 3, 3, 2, 3, 2, 3, 2, 3, 3, - 3, 2, 3, 3, 3, 2, 3, 3, 3, 2, - 3, 3, 3, 2, 2, 3, 4, 2, 1, 3, - 2, 2, 2, 3, 1, 2, 3, 0, 6, 0, - 8, 0, 8, 0, 10, 1, 2, 0, 5, 3, - 5, 6, 5, 6, 2, 3, 1, 3, 4, 3, - 3, 3, 4, 2, 1, 1, 1, 3, 4, 0, - 5, 0, 3, 3, 5, 5, 5, 5, 5, 7, - 7, 9, 9, 4, 4, 4, 6, 6, 4 + 1, 1, 4, 3, 3, 5, 5, 3, 4, 4, + 3, 3, 5, 0, 9, 0, 7, 0, 1, 3, + 1, 3, 0, 5, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 3, 3, 3, 2, 4, 4, + 3, 2, 3, 3, 3, 2, 3, 2, 3, 2, + 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, + 3, 2, 3, 3, 3, 2, 2, 3, 4, 2, + 1, 3, 2, 2, 2, 3, 1, 2, 3, 0, + 6, 0, 8, 0, 8, 0, 10, 1, 2, 0, + 5, 3, 5, 6, 5, 6, 2, 3, 1, 3, + 4, 3, 3, 3, 4, 2, 1, 1, 1, 3, + 4, 0, 5, 0, 3, 3, 5, 5, 5, 5, + 5, 5, 7, 7, 9, 9, 4, 4, 4, 6, + 6, 4 }; @@ -2133,91 +2135,91 @@ yyparse (void) case 3: /* input: input import */ #line 163 "antimony.ypp" {} -#line 2137 "antimony.tab.cpp" +#line 2139 "antimony.tab.cpp" break; case 4: /* input: input module */ #line 164 "antimony.ypp" { /*cout << endl << $2->ToString() << endl << endl;*/ } -#line 2143 "antimony.tab.cpp" +#line 2145 "antimony.tab.cpp" break; case 5: /* input: input modulepart */ #line 165 "antimony.ypp" {} -#line 2149 "antimony.tab.cpp" +#line 2151 "antimony.tab.cpp" break; case 6: /* input: input function */ #line 166 "antimony.ypp" {} -#line 2155 "antimony.tab.cpp" +#line 2157 "antimony.tab.cpp" break; case 7: /* input: input modulename */ #line 167 "antimony.ypp" {} -#line 2161 "antimony.tab.cpp" +#line 2163 "antimony.tab.cpp" break; case 8: /* input: input functionname */ #line 168 "antimony.ypp" {} -#line 2167 "antimony.tab.cpp" +#line 2169 "antimony.tab.cpp" break; case 9: /* input: input modulecvterm */ #line 169 "antimony.ypp" {} -#line 2173 "antimony.tab.cpp" +#line 2175 "antimony.tab.cpp" break; case 10: /* input: input functioncvterm */ #line 170 "antimony.ypp" {} -#line 2179 "antimony.tab.cpp" +#line 2181 "antimony.tab.cpp" break; case 11: /* input: input toplevel_sbo */ #line 171 "antimony.ypp" {} -#line 2185 "antimony.tab.cpp" +#line 2187 "antimony.tab.cpp" break; case 12: /* input: input annotationBlock */ #line 172 "antimony.ypp" {} -#line 2191 "antimony.tab.cpp" +#line 2193 "antimony.tab.cpp" break; case 13: /* input: input moduleannotation */ #line 173 "antimony.ypp" {} -#line 2197 "antimony.tab.cpp" +#line 2199 "antimony.tab.cpp" break; case 14: /* input: input error */ #line 174 "antimony.ypp" {YYABORT;} -#line 2203 "antimony.tab.cpp" +#line 2205 "antimony.tab.cpp" break; case 15: /* input: input "an error" */ #line 175 "antimony.ypp" {YYABORT;} -#line 2209 "antimony.tab.cpp" +#line 2211 "antimony.tab.cpp" break; case 16: /* import: "'import'" "text string" */ #line 178 "antimony.ypp" { if (g_registry.OpenFile(*((yyvsp[0].word)))==0) YYABORT;} -#line 2215 "antimony.tab.cpp" +#line 2217 "antimony.tab.cpp" break; case 17: /* $@1: %empty */ #line 181 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2221 "antimony.tab.cpp" +#line 2223 "antimony.tab.cpp" break; case 18: /* module: "'model' or 'module'" "element name" $@1 '(' variableexportlist ')' modulebody "'end'" */ @@ -2227,13 +2229,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2231 "antimony.tab.cpp" +#line 2233 "antimony.tab.cpp" break; case 19: /* $@2: %empty */ #line 187 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2237 "antimony.tab.cpp" +#line 2239 "antimony.tab.cpp" break; case 20: /* module: "'model' or 'module'" "element name" $@2 modulebody "'end'" */ @@ -2243,13 +2245,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2247 "antimony.tab.cpp" +#line 2249 "antimony.tab.cpp" break; case 21: /* $@3: %empty */ #line 193 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2253 "antimony.tab.cpp" +#line 2255 "antimony.tab.cpp" break; case 22: /* module: "'model' or 'module'" '*' "element name" $@3 '(' variableexportlist ')' modulebody "'end'" */ @@ -2259,13 +2261,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2263 "antimony.tab.cpp" +#line 2265 "antimony.tab.cpp" break; case 23: /* $@4: %empty */ #line 199 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2269 "antimony.tab.cpp" +#line 2271 "antimony.tab.cpp" break; case 24: /* module: "'model' or 'module'" '*' "element name" $@4 modulebody "'end'" */ @@ -2275,85 +2277,85 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2279 "antimony.tab.cpp" +#line 2281 "antimony.tab.cpp" break; case 25: /* module: "'model' or 'module'" "name of an existing module" */ #line 204 "antimony.ypp" {g_registry.SetError("module '" + *((yyvsp[0].word)) + "' already defined."); YYABORT;} -#line 2285 "antimony.tab.cpp" +#line 2287 "antimony.tab.cpp" break; case 26: /* module: "'model' or 'module'" "name of an existing function" */ #line 205 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a module because it is already a defined function."); YYABORT;} -#line 2291 "antimony.tab.cpp" +#line 2293 "antimony.tab.cpp" break; case 27: /* $@5: %empty */ #line 208 "antimony.ypp" {g_registry.NewUserFunction((yyvsp[0].word));} -#line 2297 "antimony.tab.cpp" +#line 2299 "antimony.tab.cpp" break; case 28: /* function: "'function'" "element name" $@5 '(' variableexportlist ')' spacedformula "'end'" */ #line 208 "antimony.ypp" {if (g_registry.SetUserFunction((yyvsp[-1].formula))) YYABORT;} -#line 2303 "antimony.tab.cpp" +#line 2305 "antimony.tab.cpp" break; case 29: /* function: "'function'" "name of an existing module" */ #line 209 "antimony.ypp" {g_registry.SetError("Cannot use '" + *((yyvsp[0].word)) +"' as a function name because it is already the name of a module."); YYABORT;} -#line 2309 "antimony.tab.cpp" +#line 2311 "antimony.tab.cpp" break; case 30: /* function: "'function'" "name of an existing function" */ #line 210 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a new function because it is already a defined function."); YYABORT;} -#line 2315 "antimony.tab.cpp" +#line 2317 "antimony.tab.cpp" break; case 31: /* spacedformula: formula */ #line 213 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2321 "antimony.tab.cpp" +#line 2323 "antimony.tab.cpp" break; case 32: /* spacedformula: lineend spacedformula */ #line 214 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2327 "antimony.tab.cpp" +#line 2329 "antimony.tab.cpp" break; case 33: /* spacedformula: spacedformula lineend */ #line 215 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula);} -#line 2333 "antimony.tab.cpp" +#line 2335 "antimony.tab.cpp" break; case 34: /* variableexportlist: %empty */ #line 225 "antimony.ypp" {} -#line 2339 "antimony.tab.cpp" +#line 2341 "antimony.tab.cpp" break; case 35: /* variableexportlist: variable */ #line 226 "antimony.ypp" {if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2345 "antimony.tab.cpp" +#line 2347 "antimony.tab.cpp" break; case 36: /* variableexportlist: variableexportlist ',' variable */ #line 227 "antimony.ypp" { if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2351 "antimony.tab.cpp" +#line 2353 "antimony.tab.cpp" break; case 37: /* variable: "element name" */ #line 230 "antimony.ypp" {(yyval.variable) = g_registry.AddVariableToCurrent((yyvsp[0].word)); } -#line 2357 "antimony.tab.cpp" +#line 2359 "antimony.tab.cpp" break; case 38: /* variable: variable '.' "element name" */ @@ -2364,97 +2366,97 @@ yyparse (void) YYABORT; } } -#line 2368 "antimony.tab.cpp" +#line 2370 "antimony.tab.cpp" break; case 39: /* variable: '$' variable */ #line 237 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable); if ((yyval.variable)->SetIsConst(true)) YYABORT;} -#line 2374 "antimony.tab.cpp" +#line 2376 "antimony.tab.cpp" break; case 40: /* variablein: variable "'in'" variable */ #line 240 "antimony.ypp" {if ((yyvsp[-2].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; (yyval.variable) = (yyvsp[-2].variable);} -#line 2380 "antimony.tab.cpp" +#line 2382 "antimony.tab.cpp" break; case 41: /* varmaybein: variable */ #line 243 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2386 "antimony.tab.cpp" +#line 2388 "antimony.tab.cpp" break; case 42: /* varmaybein: variablein */ #line 244 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2392 "antimony.tab.cpp" +#line 2394 "antimony.tab.cpp" break; case 43: /* varmaybeis: varmaybein */ #line 247 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2398 "antimony.tab.cpp" +#line 2400 "antimony.tab.cpp" break; case 44: /* varmaybeis: varmaybein '=' formula */ #line 248 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 2404 "antimony.tab.cpp" +#line 2406 "antimony.tab.cpp" break; case 45: /* varmaybeis: varmaybein ':' '=' formula */ #line 249 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT; } -#line 2410 "antimony.tab.cpp" +#line 2412 "antimony.tab.cpp" break; case 46: /* varmaybeis: varmaybein '\'' '=' formula */ #line 250 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT; } -#line 2416 "antimony.tab.cpp" +#line 2418 "antimony.tab.cpp" break; case 47: /* varmaybeis: varmaybein "'has'" unitdef */ #line 251 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 2422 "antimony.tab.cpp" +#line 2424 "antimony.tab.cpp" break; case 48: /* maybein: %empty */ #line 254 "antimony.ypp" {(yyval.variable) = NULL;} -#line 2428 "antimony.tab.cpp" +#line 2430 "antimony.tab.cpp" break; case 49: /* maybein: "'in'" variable */ #line 255 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2434 "antimony.tab.cpp" +#line 2436 "antimony.tab.cpp" break; case 50: /* modulebody: modulepart */ #line 258 "antimony.ypp" {} -#line 2440 "antimony.tab.cpp" +#line 2442 "antimony.tab.cpp" break; case 51: /* modulebody: moduleannotation */ #line 259 "antimony.ypp" {} -#line 2446 "antimony.tab.cpp" +#line 2448 "antimony.tab.cpp" break; case 52: /* modulebody: modulebody modulepart */ #line 260 "antimony.ypp" {} -#line 2452 "antimony.tab.cpp" +#line 2454 "antimony.tab.cpp" break; case 53: /* modulebody: modulebody moduleannotation */ #line 261 "antimony.ypp" {} -#line 2458 "antimony.tab.cpp" +#line 2460 "antimony.tab.cpp" break; case 54: /* moduleannotation: "'model' or 'module'" "element name" stringlist lineend */ @@ -2463,7 +2465,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCVTerm(&modname,(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT; } -#line 2467 "antimony.tab.cpp" +#line 2469 "antimony.tab.cpp" break; case 55: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" stringlist lineend */ @@ -2472,7 +2474,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT; } -#line 2476 "antimony.tab.cpp" +#line 2478 "antimony.tab.cpp" break; case 56: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" "number" lineend */ @@ -2481,7 +2483,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT; } -#line 2485 "antimony.tab.cpp" +#line 2487 "antimony.tab.cpp" break; case 57: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "number" */ @@ -2495,7 +2497,7 @@ yyparse (void) YYABORT; } } -#line 2499 "antimony.tab.cpp" +#line 2501 "antimony.tab.cpp" break; case 58: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "element name" */ @@ -2509,11 +2511,25 @@ yyparse (void) YYABORT; } } -#line 2513 "antimony.tab.cpp" +#line 2515 "antimony.tab.cpp" break; - case 59: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "number" */ + case 59: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "name of a pre-defined constant" */ #line 300 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[0].word))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + YYABORT; + } + } +#line 2529 "antimony.tab.cpp" + break; + + case 60: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "number" */ +#line 310 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; @@ -2525,12 +2541,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 2530 "antimony.tab.cpp" +#line 2547 "antimony.tab.cpp" break; - case 60: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "element name" */ -#line 313 "antimony.ypp" + case 61: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "element name" */ +#line 324 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; @@ -2542,12 +2559,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 2547 "antimony.tab.cpp" +#line 2565 "antimony.tab.cpp" break; - case 61: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '[' variablelist ']' */ -#line 326 "antimony.ypp" + case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ +#line 338 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -2559,12 +2577,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 2564 "antimony.tab.cpp" +#line 2583 "antimony.tab.cpp" break; - case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '[' numlist ']' */ -#line 339 "antimony.ypp" + case 63: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' numlist '}' */ +#line 352 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -2576,132 +2595,133 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 2581 "antimony.tab.cpp" +#line 2601 "antimony.tab.cpp" break; - case 63: /* variablelist: variable */ -#line 353 "antimony.ypp" - { std::vector ret; (yyval.variablelist) = ret; (yyval.variablelist).push_back((yyvsp[0].variable));} -#line 2587 "antimony.tab.cpp" + case 64: /* variablelist: variable */ +#line 367 "antimony.ypp" + { (yyval.variablelist) = new std::vector(); (yyval.variablelist)->push_back((yyvsp[0].variable));} +#line 2607 "antimony.tab.cpp" break; - case 64: /* variablelist: variablelist ',' variable */ -#line 354 "antimony.ypp" - { (yyval.variablelist) = (yyvsp[-2].variablelist); (yyval.variablelist).push_back((yyvsp[0].variable)); } -#line 2593 "antimony.tab.cpp" + case 65: /* variablelist: variablelist ',' variable */ +#line 368 "antimony.ypp" + { (yyval.variablelist) = (yyvsp[-2].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } +#line 2613 "antimony.tab.cpp" break; - case 65: /* variablelist: variablelist ',' '\n' variable */ -#line 355 "antimony.ypp" - { (yyval.variablelist) = (yyvsp[-3].variablelist); (yyval.variablelist).push_back((yyvsp[0].variable)); } -#line 2599 "antimony.tab.cpp" + case 66: /* variablelist: variablelist ',' '\n' variable */ +#line 369 "antimony.ypp" + { (yyval.variablelist) = (yyvsp[-3].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } +#line 2619 "antimony.tab.cpp" break; - case 66: /* numlist: "number" */ -#line 358 "antimony.ypp" - { std::vector ret; (yyval.numlist) = ret; (yyval.numlist).push_back((yyvsp[0].num)); } -#line 2605 "antimony.tab.cpp" + case 67: /* numlist: "number" */ +#line 372 "antimony.ypp" + { (yyval.numlist) = new std::vector(); (yyval.numlist)->push_back((yyvsp[0].num)); } +#line 2625 "antimony.tab.cpp" break; - case 67: /* numlist: numlist ',' "number" */ -#line 359 "antimony.ypp" - { (yyval.numlist) = (yyvsp[-2].numlist); (yyval.numlist).push_back((yyvsp[0].num)); } -#line 2611 "antimony.tab.cpp" + case 68: /* numlist: numlist ',' "number" */ +#line 373 "antimony.ypp" + { (yyval.numlist) = (yyvsp[-2].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } +#line 2631 "antimony.tab.cpp" break; - case 68: /* numlist: numlist ',' '\n' "number" */ -#line 360 "antimony.ypp" - { (yyval.numlist) = (yyvsp[-3].numlist); (yyval.numlist).push_back((yyvsp[0].num)); } -#line 2617 "antimony.tab.cpp" + case 69: /* numlist: numlist ',' '\n' "number" */ +#line 374 "antimony.ypp" + { (yyval.numlist) = (yyvsp[-3].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } +#line 2637 "antimony.tab.cpp" break; - case 69: /* modulepart: reaction lineend */ -#line 363 "antimony.ypp" + case 70: /* modulepart: reaction lineend */ +#line 377 "antimony.ypp" {} -#line 2623 "antimony.tab.cpp" +#line 2643 "antimony.tab.cpp" break; - case 70: /* modulepart: assignment lineend */ -#line 364 "antimony.ypp" + case 71: /* modulepart: assignment lineend */ +#line 378 "antimony.ypp" {} -#line 2629 "antimony.tab.cpp" +#line 2649 "antimony.tab.cpp" break; - case 71: /* modulepart: submodule lineend */ -#line 365 "antimony.ypp" + case 72: /* modulepart: submodule lineend */ +#line 379 "antimony.ypp" {} -#line 2635 "antimony.tab.cpp" +#line 2655 "antimony.tab.cpp" break; - case 72: /* modulepart: varinitialize lineend */ -#line 366 "antimony.ypp" + case 73: /* modulepart: varinitialize lineend */ +#line 380 "antimony.ypp" {} -#line 2641 "antimony.tab.cpp" +#line 2661 "antimony.tab.cpp" break; - case 73: /* modulepart: dnadef lineend */ -#line 367 "antimony.ypp" + case 74: /* modulepart: dnadef lineend */ +#line 381 "antimony.ypp" {} -#line 2647 "antimony.tab.cpp" +#line 2667 "antimony.tab.cpp" break; - case 74: /* modulepart: event lineend */ -#line 368 "antimony.ypp" + case 75: /* modulepart: event lineend */ +#line 382 "antimony.ypp" {} -#line 2653 "antimony.tab.cpp" +#line 2673 "antimony.tab.cpp" break; - case 75: /* modulepart: unitinit lineend */ -#line 369 "antimony.ypp" + case 76: /* modulepart: unitinit lineend */ +#line 383 "antimony.ypp" {} -#line 2659 "antimony.tab.cpp" +#line 2679 "antimony.tab.cpp" break; - case 76: /* modulepart: deletion lineend */ -#line 370 "antimony.ypp" + case 77: /* modulepart: deletion lineend */ +#line 384 "antimony.ypp" {} -#line 2665 "antimony.tab.cpp" +#line 2685 "antimony.tab.cpp" break; - case 77: /* modulepart: cvterm lineend */ -#line 371 "antimony.ypp" + case 78: /* modulepart: cvterm lineend */ +#line 385 "antimony.ypp" {} -#line 2671 "antimony.tab.cpp" +#line 2691 "antimony.tab.cpp" break; - case 78: /* modulepart: variablein */ -#line 372 "antimony.ypp" + case 79: /* modulepart: variablein */ +#line 386 "antimony.ypp" {} -#line 2677 "antimony.tab.cpp" +#line 2697 "antimony.tab.cpp" break; - case 79: /* modulepart: constraint lineend */ -#line 373 "antimony.ypp" + case 80: /* modulepart: constraint lineend */ +#line 387 "antimony.ypp" {} -#line 2683 "antimony.tab.cpp" +#line 2703 "antimony.tab.cpp" break; - case 80: /* modulepart: objective lineend */ -#line 374 "antimony.ypp" + case 81: /* modulepart: objective lineend */ +#line 388 "antimony.ypp" {} -#line 2689 "antimony.tab.cpp" +#line 2709 "antimony.tab.cpp" break; - case 81: /* modulepart: algrule lineend */ -#line 375 "antimony.ypp" + case 82: /* modulepart: algrule lineend */ +#line 389 "antimony.ypp" {} -#line 2695 "antimony.tab.cpp" +#line 2715 "antimony.tab.cpp" break; - case 82: /* modulepart: lineend */ -#line 376 "antimony.ypp" + case 83: /* modulepart: lineend */ +#line 390 "antimony.ypp" {} -#line 2701 "antimony.tab.cpp" +#line 2721 "antimony.tab.cpp" break; - case 83: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ -#line 380 "antimony.ypp" + case 84: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ +#line 394 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-7].variable), 0); if (var == NULL) YYABORT; @@ -2709,11 +2729,11 @@ yyparse (void) if ((yyvsp[-7].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2713 "antimony.tab.cpp" +#line 2733 "antimony.tab.cpp" break; - case 84: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ -#line 388 "antimony.ypp" + case 85: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ +#line 402 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 0); if (var == NULL) YYABORT; @@ -2721,11 +2741,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2725 "antimony.tab.cpp" +#line 2745 "antimony.tab.cpp" break; - case 85: /* reaction: reactantList reactionDivider ';' formula maybein */ -#line 396 "antimony.ypp" + case 86: /* reaction: reactantList reactionDivider ';' formula maybein */ +#line 410 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), 1); if (var == NULL) YYABORT; @@ -2733,11 +2753,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2737 "antimony.tab.cpp" +#line 2757 "antimony.tab.cpp" break; - case 86: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ -#line 404 "antimony.ypp" + case 87: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ +#line 418 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 1); if (var == NULL) YYABORT; @@ -2745,11 +2765,11 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2749 "antimony.tab.cpp" +#line 2769 "antimony.tab.cpp" break; - case 87: /* reaction: reactionDivider reactantList ';' formula maybein */ -#line 412 "antimony.ypp" + case 88: /* reaction: reactionDivider reactantList ';' formula maybein */ +#line 426 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 2); if (var == NULL) YYABORT; @@ -2757,11 +2777,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2761 "antimony.tab.cpp" +#line 2781 "antimony.tab.cpp" break; - case 88: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ -#line 420 "antimony.ypp" + case 89: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ +#line 434 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 2); if (var == NULL) YYABORT; @@ -2769,847 +2789,853 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2773 "antimony.tab.cpp" +#line 2793 "antimony.tab.cpp" break; - case 89: /* reactantList: variable */ -#line 429 "antimony.ypp" + case 90: /* reactantList: variable */ +#line 443 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2779 "antimony.tab.cpp" +#line 2799 "antimony.tab.cpp" break; - case 90: /* reactantList: "number" variable */ -#line 430 "antimony.ypp" + case 91: /* reactantList: "number" variable */ +#line 444 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2785 "antimony.tab.cpp" +#line 2805 "antimony.tab.cpp" break; - case 91: /* reactantList: variable variable */ -#line 431 "antimony.ypp" + case 92: /* reactantList: variable variable */ +#line 445 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2791 "antimony.tab.cpp" +#line 2811 "antimony.tab.cpp" break; - case 92: /* reactantList: reactantList '+' variable */ -#line 432 "antimony.ypp" + case 93: /* reactantList: reactantList '+' variable */ +#line 446 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-2].reactantList); if((yyvsp[-2].reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2797 "antimony.tab.cpp" +#line 2817 "antimony.tab.cpp" break; - case 93: /* reactantList: reactantList '+' "number" variable */ -#line 433 "antimony.ypp" + case 94: /* reactantList: reactantList '+' "number" variable */ +#line 447 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2803 "antimony.tab.cpp" +#line 2823 "antimony.tab.cpp" break; - case 94: /* reactantList: reactantList '+' variable variable */ -#line 434 "antimony.ypp" + case 95: /* reactantList: reactantList '+' variable variable */ +#line 448 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2809 "antimony.tab.cpp" +#line 2829 "antimony.tab.cpp" break; - case 95: /* reactionDivider: "->" */ -#line 438 "antimony.ypp" + case 96: /* reactionDivider: "->" */ +#line 452 "antimony.ypp" {(yyval.reactionDivider) = rdBecomes;} -#line 2815 "antimony.tab.cpp" +#line 2835 "antimony.tab.cpp" break; - case 96: /* reactionDivider: "-|" */ -#line 439 "antimony.ypp" + case 97: /* reactionDivider: "-|" */ +#line 453 "antimony.ypp" {(yyval.reactionDivider) = rdInhibits;} -#line 2821 "antimony.tab.cpp" +#line 2841 "antimony.tab.cpp" break; - case 97: /* reactionDivider: '-' '(' */ -#line 440 "antimony.ypp" + case 98: /* reactionDivider: '-' '(' */ +#line 454 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2827 "antimony.tab.cpp" +#line 2847 "antimony.tab.cpp" break; - case 98: /* reactionDivider: "-o" */ -#line 441 "antimony.ypp" + case 99: /* reactionDivider: "-o" */ +#line 455 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2833 "antimony.tab.cpp" +#line 2853 "antimony.tab.cpp" break; - case 99: /* reactionDivider: "=>" */ -#line 442 "antimony.ypp" + case 100: /* reactionDivider: "=>" */ +#line 456 "antimony.ypp" {(yyval.reactionDivider) = rdBecomesIrreversibly;} -#line 2839 "antimony.tab.cpp" +#line 2859 "antimony.tab.cpp" break; - case 100: /* formula: %empty */ -#line 445 "antimony.ypp" + case 101: /* formula: %empty */ +#line 459 "antimony.ypp" {(yyval.formula) = g_registry.NewBlankFormula(); } -#line 2845 "antimony.tab.cpp" +#line 2865 "antimony.tab.cpp" break; - case 101: /* formula: formula "..." */ -#line 446 "antimony.ypp" + case 102: /* formula: formula "..." */ +#line 460 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddEllipses();} -#line 2851 "antimony.tab.cpp" +#line 2871 "antimony.tab.cpp" break; - case 102: /* formula: formula variable */ -#line 447 "antimony.ypp" + case 103: /* formula: formula variable */ +#line 461 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); if((yyvsp[-1].formula)->AddVariable((yyvsp[0].variable))) YYABORT; } -#line 2857 "antimony.tab.cpp" +#line 2877 "antimony.tab.cpp" break; - case 103: /* formula: formula "number" */ -#line 448 "antimony.ypp" + case 104: /* formula: formula "number" */ +#line 462 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddNum((yyvsp[0].num)); } -#line 2863 "antimony.tab.cpp" +#line 2883 "antimony.tab.cpp" break; - case 104: /* formula: formula "name of a pre-defined constant" */ -#line 449 "antimony.ypp" + case 105: /* formula: formula "name of a pre-defined constant" */ +#line 463 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2869 "antimony.tab.cpp" +#line 2889 "antimony.tab.cpp" break; - case 105: /* formula: formula "name of an existing function" */ -#line 450 "antimony.ypp" + case 106: /* formula: formula "name of an existing function" */ +#line 464 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2875 "antimony.tab.cpp" +#line 2895 "antimony.tab.cpp" break; - case 106: /* formula: formula '(' commaformula ')' */ -#line 451 "antimony.ypp" + case 107: /* formula: formula '(' commaformula ')' */ +#line 465 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddParentheses(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2881 "antimony.tab.cpp" +#line 2901 "antimony.tab.cpp" break; - case 107: /* formula: formula '{' commaformula '}' */ -#line 452 "antimony.ypp" + case 108: /* formula: formula '{' commaformula '}' */ +#line 466 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddCurlyBrackets(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2887 "antimony.tab.cpp" +#line 2907 "antimony.tab.cpp" break; - case 108: /* formula: formula mathThing */ -#line 453 "antimony.ypp" + case 109: /* formula: formula mathThing */ +#line 467 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddMathThing((yyvsp[0].character)); } -#line 2893 "antimony.tab.cpp" +#line 2913 "antimony.tab.cpp" break; - case 109: /* formula: formula inequality */ -#line 454 "antimony.ypp" + case 110: /* formula: formula inequality */ +#line 468 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddInequality((yyvsp[0].inequality)); } -#line 2899 "antimony.tab.cpp" +#line 2919 "antimony.tab.cpp" break; - case 110: /* formula: formula '=' '=' */ -#line 455 "antimony.ypp" + case 111: /* formula: formula '=' '=' */ +#line 469 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('='); (yyvsp[-2].formula)->AddMathThing('='); } -#line 2905 "antimony.tab.cpp" +#line 2925 "antimony.tab.cpp" break; - case 111: /* formula: formula '&' '&' */ -#line 456 "antimony.ypp" + case 112: /* formula: formula '&' '&' */ +#line 470 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('&'); (yyvsp[-2].formula)->AddMathThing('&'); } -#line 2911 "antimony.tab.cpp" +#line 2931 "antimony.tab.cpp" break; - case 112: /* formula: formula '|' '|' */ -#line 457 "antimony.ypp" + case 113: /* formula: formula '|' '|' */ +#line 471 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('|'); (yyvsp[-2].formula)->AddMathThing('|'); } -#line 2917 "antimony.tab.cpp" +#line 2937 "antimony.tab.cpp" break; - case 113: /* commaformula: formula */ -#line 460 "antimony.ypp" + case 114: /* formula: formula "text string" */ +#line 472 "antimony.ypp" + {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word), true); } +#line 2943 "antimony.tab.cpp" + break; + + case 115: /* commaformula: formula */ +#line 475 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2923 "antimony.tab.cpp" +#line 2949 "antimony.tab.cpp" break; - case 114: /* commaformula: commaformula ',' formula */ -#line 461 "antimony.ypp" + case 116: /* commaformula: commaformula ',' formula */ +#line 476 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyval.formula)->AddMathThing(','); (yyval.formula)->AddFormula((yyvsp[0].formula)); } -#line 2929 "antimony.tab.cpp" +#line 2955 "antimony.tab.cpp" break; - case 115: /* mathThing: '+' */ -#line 464 "antimony.ypp" + case 117: /* mathThing: '+' */ +#line 479 "antimony.ypp" {(yyval.character) = '+';} -#line 2935 "antimony.tab.cpp" +#line 2961 "antimony.tab.cpp" break; - case 116: /* mathThing: '-' */ -#line 465 "antimony.ypp" + case 118: /* mathThing: '-' */ +#line 480 "antimony.ypp" {(yyval.character) = '-';} -#line 2941 "antimony.tab.cpp" +#line 2967 "antimony.tab.cpp" break; - case 117: /* mathThing: '*' */ -#line 466 "antimony.ypp" + case 119: /* mathThing: '*' */ +#line 481 "antimony.ypp" {(yyval.character) = '*';} -#line 2947 "antimony.tab.cpp" +#line 2973 "antimony.tab.cpp" break; - case 118: /* mathThing: '/' */ -#line 467 "antimony.ypp" + case 120: /* mathThing: '/' */ +#line 482 "antimony.ypp" {(yyval.character) = '/';} -#line 2953 "antimony.tab.cpp" +#line 2979 "antimony.tab.cpp" break; - case 119: /* mathThing: '^' */ -#line 468 "antimony.ypp" + case 121: /* mathThing: '^' */ +#line 483 "antimony.ypp" {(yyval.character) = '^';} -#line 2959 "antimony.tab.cpp" +#line 2985 "antimony.tab.cpp" break; - case 120: /* mathThing: '!' */ -#line 469 "antimony.ypp" + case 122: /* mathThing: '!' */ +#line 484 "antimony.ypp" {(yyval.character) = '!';} -#line 2965 "antimony.tab.cpp" +#line 2991 "antimony.tab.cpp" break; - case 121: /* mathThing: '%' */ -#line 470 "antimony.ypp" + case 123: /* mathThing: '%' */ +#line 485 "antimony.ypp" {(yyval.character) = '%';} -#line 2971 "antimony.tab.cpp" +#line 2997 "antimony.tab.cpp" break; - case 122: /* inequality: '<' */ -#line 473 "antimony.ypp" + case 124: /* inequality: '<' */ +#line 488 "antimony.ypp" {(yyval.inequality) = constLT;} -#line 2977 "antimony.tab.cpp" +#line 3003 "antimony.tab.cpp" break; - case 123: /* inequality: "<=" */ -#line 474 "antimony.ypp" + case 125: /* inequality: "<=" */ +#line 489 "antimony.ypp" {(yyval.inequality) = constLEQ;} -#line 2983 "antimony.tab.cpp" +#line 3009 "antimony.tab.cpp" break; - case 124: /* inequality: '>' */ -#line 475 "antimony.ypp" + case 126: /* inequality: '>' */ +#line 490 "antimony.ypp" {(yyval.inequality) = constGT;} -#line 2989 "antimony.tab.cpp" +#line 3015 "antimony.tab.cpp" break; - case 125: /* inequality: ">=" */ -#line 476 "antimony.ypp" + case 127: /* inequality: ">=" */ +#line 491 "antimony.ypp" {(yyval.inequality) = constGEQ;} -#line 2995 "antimony.tab.cpp" +#line 3021 "antimony.tab.cpp" break; - case 126: /* inequality: "!=" */ -#line 477 "antimony.ypp" + case 128: /* inequality: "!=" */ +#line 492 "antimony.ypp" {(yyval.inequality) = constNEQ;} -#line 3001 "antimony.tab.cpp" +#line 3027 "antimony.tab.cpp" break; - case 127: /* lineend: ';' */ -#line 480 "antimony.ypp" + case 129: /* lineend: ';' */ +#line 495 "antimony.ypp" {} -#line 3007 "antimony.tab.cpp" +#line 3033 "antimony.tab.cpp" break; - case 128: /* lineend: '\n' */ -#line 481 "antimony.ypp" + case 130: /* lineend: '\n' */ +#line 496 "antimony.ypp" {} -#line 3013 "antimony.tab.cpp" +#line 3039 "antimony.tab.cpp" break; - case 129: /* lineend: "end of line" */ -#line 482 "antimony.ypp" + case 131: /* lineend: "end of line" */ +#line 497 "antimony.ypp" {} -#line 3019 "antimony.tab.cpp" +#line 3045 "antimony.tab.cpp" break; - case 130: /* assignment: varmaybein ':' maxormin formula */ -#line 485 "antimony.ypp" + case 132: /* assignment: varmaybein ':' maxormin formula */ +#line 500 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[-3].variable), (yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3025 "antimony.tab.cpp" +#line 3051 "antimony.tab.cpp" break; - case 131: /* assignment: varmaybein '=' formula */ -#line 486 "antimony.ypp" + case 133: /* assignment: varmaybein '=' formula */ +#line 501 "antimony.ypp" {if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 3031 "antimony.tab.cpp" +#line 3057 "antimony.tab.cpp" break; - case 132: /* assignment: varmaybein "'is'" variable */ -#line 487 "antimony.ypp" + case 134: /* assignment: varmaybein "'is'" variable */ +#line 502 "antimony.ypp" {if ((yyvsp[-2].variable)->Synchronize((yyvsp[0].variable), NULL)) YYABORT;} -#line 3037 "antimony.tab.cpp" +#line 3063 "antimony.tab.cpp" break; - case 133: /* assignment: varmaybein "'is'" variable '/' variable */ -#line 488 "antimony.ypp" + case 135: /* assignment: varmaybein "'is'" variable '/' variable */ +#line 503 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[-2].variable), (yyvsp[0].variable))) YYABORT;} -#line 3043 "antimony.tab.cpp" +#line 3069 "antimony.tab.cpp" break; - case 134: /* assignment: varmaybein '*' variable "'is'" variable */ -#line 489 "antimony.ypp" + case 136: /* assignment: varmaybein '*' variable "'is'" variable */ +#line 504 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[0].variable), (yyvsp[-2].variable))) YYABORT;} -#line 3049 "antimony.tab.cpp" +#line 3075 "antimony.tab.cpp" break; - case 135: /* assignment: varmaybein "'is'" "text string" */ -#line 490 "antimony.ypp" + case 137: /* assignment: varmaybein "'is'" "text string" */ +#line 505 "antimony.ypp" {if ((yyvsp[-2].variable)->SetDisplayName(*((yyvsp[0].word)))) YYABORT;} -#line 3055 "antimony.tab.cpp" +#line 3081 "antimony.tab.cpp" break; - case 136: /* assignment: varmaybein ':' '=' formula */ -#line 491 "antimony.ypp" + case 138: /* assignment: varmaybein ':' '=' formula */ +#line 506 "antimony.ypp" {if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT;} -#line 3061 "antimony.tab.cpp" +#line 3087 "antimony.tab.cpp" break; - case 137: /* assignment: varmaybein '\'' '=' formula */ -#line 492 "antimony.ypp" + case 139: /* assignment: varmaybein '\'' '=' formula */ +#line 507 "antimony.ypp" {if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT;} -#line 3067 "antimony.tab.cpp" +#line 3093 "antimony.tab.cpp" break; - case 138: /* assignment: varmaybein "'has'" unitdef */ -#line 493 "antimony.ypp" + case 140: /* assignment: varmaybein "'has'" unitdef */ +#line 508 "antimony.ypp" {if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 3073 "antimony.tab.cpp" +#line 3099 "antimony.tab.cpp" break; - case 139: /* algrule: "number" '=' formula */ -#line 497 "antimony.ypp" + case 141: /* algrule: "number" '=' formula */ +#line 512 "antimony.ypp" {if (g_registry.AddNewAlgebraicRuleToCurrent((yyvsp[-2].num), (yyvsp[0].formula))) YYABORT; } -#line 3079 "antimony.tab.cpp" +#line 3105 "antimony.tab.cpp" break; - case 140: /* algrule: varmaybein ':' "number" '=' formula */ -#line 498 "antimony.ypp" + case 142: /* algrule: varmaybein ':' "number" '=' formula */ +#line 513 "antimony.ypp" {if ((yyvsp[-4].variable)->SetAlgebraicRule((yyvsp[-2].num), (yyvsp[0].formula)) ) YYABORT;} -#line 3085 "antimony.tab.cpp" +#line 3111 "antimony.tab.cpp" break; - case 141: /* $@6: %empty */ -#line 501 "antimony.ypp" + case 143: /* $@6: %empty */ +#line 516 "antimony.ypp" {if ((yyvsp[-3].variable)->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3091 "antimony.tab.cpp" +#line 3117 "antimony.tab.cpp" break; - case 142: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ -#line 501 "antimony.ypp" + case 144: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ +#line 516 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if ((yyvsp[-8].variable)->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3097 "antimony.tab.cpp" +#line 3123 "antimony.tab.cpp" break; - case 143: /* $@7: %empty */ -#line 502 "antimony.ypp" + case 145: /* $@7: %empty */ +#line 517 "antimony.ypp" {if(g_registry.CurrentModule()->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3103 "antimony.tab.cpp" +#line 3129 "antimony.tab.cpp" break; - case 144: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ -#line 502 "antimony.ypp" + case 146: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ +#line 517 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if (g_registry.GetCurrentSubmodel()->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3109 "antimony.tab.cpp" +#line 3135 "antimony.tab.cpp" break; - case 145: /* variableimportlist: %empty */ -#line 506 "antimony.ypp" + case 147: /* variableimportlist: %empty */ +#line 521 "antimony.ypp" {} -#line 3115 "antimony.tab.cpp" +#line 3141 "antimony.tab.cpp" break; - case 146: /* variableimportlist: variable */ -#line 507 "antimony.ypp" + case 148: /* variableimportlist: variable */ +#line 522 "antimony.ypp" {if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3121 "antimony.tab.cpp" +#line 3147 "antimony.tab.cpp" break; - case 147: /* variableimportlist: variableimportlist ',' variable */ -#line 508 "antimony.ypp" + case 149: /* variableimportlist: variableimportlist ',' variable */ +#line 523 "antimony.ypp" { if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3127 "antimony.tab.cpp" +#line 3153 "antimony.tab.cpp" break; - case 148: /* variableimportlist: "number" */ -#line 509 "antimony.ypp" + case 150: /* variableimportlist: "number" */ +#line 524 "antimony.ypp" {if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3133 "antimony.tab.cpp" +#line 3159 "antimony.tab.cpp" break; - case 149: /* variableimportlist: variableimportlist ',' "number" */ -#line 510 "antimony.ypp" + case 151: /* variableimportlist: variableimportlist ',' "number" */ +#line 525 "antimony.ypp" { if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3139 "antimony.tab.cpp" +#line 3165 "antimony.tab.cpp" break; - case 150: /* submodifications: %empty */ -#line 514 "antimony.ypp" + case 152: /* submodifications: %empty */ +#line 529 "antimony.ypp" {} -#line 3145 "antimony.tab.cpp" +#line 3171 "antimony.tab.cpp" break; - case 151: /* submodifications: submodifications ',' "element name" '=' variable */ -#line 515 "antimony.ypp" + case 153: /* submodifications: submodifications ',' "element name" '=' variable */ +#line 530 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].variable));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].variable))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3153 "antimony.tab.cpp" +#line 3179 "antimony.tab.cpp" break; - case 152: /* submodifications: submodifications ',' "element name" '=' "number" */ -#line 519 "antimony.ypp" + case 154: /* submodifications: submodifications ',' "element name" '=' "number" */ +#line 534 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].num));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].num))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3161 "antimony.tab.cpp" +#line 3187 "antimony.tab.cpp" break; - case 153: /* varinitialize: specinit */ -#line 523 "antimony.ypp" + case 155: /* varinitialize: specinit */ +#line 538 "antimony.ypp" { } -#line 3167 "antimony.tab.cpp" +#line 3193 "antimony.tab.cpp" break; - case 154: /* varinitialize: formulainit */ -#line 524 "antimony.ypp" + case 156: /* varinitialize: formulainit */ +#line 539 "antimony.ypp" { } -#line 3173 "antimony.tab.cpp" +#line 3199 "antimony.tab.cpp" break; - case 155: /* varinitialize: reactioninit */ -#line 525 "antimony.ypp" + case 157: /* varinitialize: reactioninit */ +#line 540 "antimony.ypp" { } -#line 3179 "antimony.tab.cpp" +#line 3205 "antimony.tab.cpp" break; - case 156: /* varinitialize: dnainit */ -#line 526 "antimony.ypp" + case 158: /* varinitialize: dnainit */ +#line 541 "antimony.ypp" { } -#line 3185 "antimony.tab.cpp" +#line 3211 "antimony.tab.cpp" break; - case 157: /* varinitialize: geneinit */ -#line 527 "antimony.ypp" + case 159: /* varinitialize: geneinit */ +#line 542 "antimony.ypp" { } -#line 3191 "antimony.tab.cpp" +#line 3217 "antimony.tab.cpp" break; - case 158: /* varinitialize: operatorinit */ -#line 528 "antimony.ypp" + case 160: /* varinitialize: operatorinit */ +#line 543 "antimony.ypp" { } -#line 3197 "antimony.tab.cpp" +#line 3223 "antimony.tab.cpp" break; - case 159: /* varinitialize: compartmentinit */ -#line 529 "antimony.ypp" + case 161: /* varinitialize: compartmentinit */ +#line 544 "antimony.ypp" { } -#line 3203 "antimony.tab.cpp" +#line 3229 "antimony.tab.cpp" break; - case 160: /* varinitialize: varconstinit */ -#line 530 "antimony.ypp" + case 162: /* varinitialize: varconstinit */ +#line 545 "antimony.ypp" { } -#line 3209 "antimony.tab.cpp" +#line 3235 "antimony.tab.cpp" break; - case 161: /* specinit: "'species'" varmaybeis */ -#line 533 "antimony.ypp" + case 163: /* specinit: "'species'" varmaybeis */ +#line 548 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3215 "antimony.tab.cpp" +#line 3241 "antimony.tab.cpp" break; - case 162: /* specinit: "'var'" "'species'" varmaybeis */ -#line 534 "antimony.ypp" + case 164: /* specinit: "'var'" "'species'" varmaybeis */ +#line 549 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3221 "antimony.tab.cpp" +#line 3247 "antimony.tab.cpp" break; - case 163: /* specinit: "'const'" "'species'" varmaybeis */ -#line 535 "antimony.ypp" + case 165: /* specinit: "'const'" "'species'" varmaybeis */ +#line 550 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3227 "antimony.tab.cpp" +#line 3253 "antimony.tab.cpp" break; - case 164: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ -#line 536 "antimony.ypp" + case 166: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ +#line 551 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3233 "antimony.tab.cpp" +#line 3259 "antimony.tab.cpp" break; - case 165: /* specinit: "'substanceOnly'" varmaybeis */ -#line 537 "antimony.ypp" + case 167: /* specinit: "'substanceOnly'" varmaybeis */ +#line 552 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3239 "antimony.tab.cpp" +#line 3265 "antimony.tab.cpp" break; - case 166: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ -#line 538 "antimony.ypp" + case 168: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ +#line 553 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3245 "antimony.tab.cpp" +#line 3271 "antimony.tab.cpp" break; - case 167: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ -#line 539 "antimony.ypp" + case 169: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ +#line 554 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3251 "antimony.tab.cpp" +#line 3277 "antimony.tab.cpp" break; - case 168: /* specinit: specinit ',' varmaybeis */ -#line 540 "antimony.ypp" + case 170: /* specinit: specinit ',' varmaybeis */ +#line 555 "antimony.ypp" {(yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3257 "antimony.tab.cpp" +#line 3283 "antimony.tab.cpp" break; - case 169: /* formulainit: "'formula'" varmaybeis */ -#line 543 "antimony.ypp" + case 171: /* formulainit: "'formula'" varmaybeis */ +#line 558 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3263 "antimony.tab.cpp" +#line 3289 "antimony.tab.cpp" break; - case 170: /* formulainit: "'var'" "'formula'" varmaybeis */ -#line 544 "antimony.ypp" + case 172: /* formulainit: "'var'" "'formula'" varmaybeis */ +#line 559 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3269 "antimony.tab.cpp" +#line 3295 "antimony.tab.cpp" break; - case 171: /* formulainit: "'const'" "'formula'" varmaybeis */ -#line 545 "antimony.ypp" + case 173: /* formulainit: "'const'" "'formula'" varmaybeis */ +#line 560 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3275 "antimony.tab.cpp" +#line 3301 "antimony.tab.cpp" break; - case 172: /* formulainit: formulainit ',' varmaybeis */ -#line 546 "antimony.ypp" + case 174: /* formulainit: formulainit ',' varmaybeis */ +#line 561 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3281 "antimony.tab.cpp" +#line 3307 "antimony.tab.cpp" break; - case 173: /* reactioninit: "'reaction'" varmaybeis */ -#line 549 "antimony.ypp" + case 175: /* reactioninit: "'reaction'" varmaybeis */ +#line 564 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3287 "antimony.tab.cpp" +#line 3313 "antimony.tab.cpp" break; - case 174: /* reactioninit: "'var'" "'reaction'" varmaybeis */ -#line 550 "antimony.ypp" + case 176: /* reactioninit: "'var'" "'reaction'" varmaybeis */ +#line 565 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3293 "antimony.tab.cpp" +#line 3319 "antimony.tab.cpp" break; - case 175: /* reactioninit: "'const'" "'reaction'" */ -#line 551 "antimony.ypp" + case 177: /* reactioninit: "'const'" "'reaction'" */ +#line 566 "antimony.ypp" {g_registry.SetError("Reactions may not be set 'const'."); YYABORT; } -#line 3299 "antimony.tab.cpp" +#line 3325 "antimony.tab.cpp" break; - case 176: /* reactioninit: reactioninit ',' varmaybeis */ -#line 552 "antimony.ypp" + case 178: /* reactioninit: reactioninit ',' varmaybeis */ +#line 567 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3305 "antimony.tab.cpp" +#line 3331 "antimony.tab.cpp" break; - case 177: /* dnainit: "'DNA'" varmaybeis */ -#line 555 "antimony.ypp" + case 179: /* dnainit: "'DNA'" varmaybeis */ +#line 570 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3311 "antimony.tab.cpp" +#line 3337 "antimony.tab.cpp" break; - case 178: /* dnainit: "'var'" "'DNA'" varmaybeis */ -#line 556 "antimony.ypp" + case 180: /* dnainit: "'var'" "'DNA'" varmaybeis */ +#line 571 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3317 "antimony.tab.cpp" +#line 3343 "antimony.tab.cpp" break; - case 179: /* dnainit: "'const'" "'DNA'" varmaybeis */ -#line 557 "antimony.ypp" + case 181: /* dnainit: "'const'" "'DNA'" varmaybeis */ +#line 572 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3323 "antimony.tab.cpp" +#line 3349 "antimony.tab.cpp" break; - case 180: /* dnainit: dnainit ',' varmaybeis */ -#line 558 "antimony.ypp" + case 182: /* dnainit: dnainit ',' varmaybeis */ +#line 573 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3329 "antimony.tab.cpp" +#line 3355 "antimony.tab.cpp" break; - case 181: /* geneinit: "'gene'" varmaybeis */ -#line 561 "antimony.ypp" + case 183: /* geneinit: "'gene'" varmaybeis */ +#line 576 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3335 "antimony.tab.cpp" +#line 3361 "antimony.tab.cpp" break; - case 182: /* geneinit: "'var'" "'gene'" varmaybeis */ -#line 562 "antimony.ypp" + case 184: /* geneinit: "'var'" "'gene'" varmaybeis */ +#line 577 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3341 "antimony.tab.cpp" +#line 3367 "antimony.tab.cpp" break; - case 183: /* geneinit: "'const'" "'gene'" varmaybeis */ -#line 563 "antimony.ypp" + case 185: /* geneinit: "'const'" "'gene'" varmaybeis */ +#line 578 "antimony.ypp" {g_registry.SetError("Genes may not be set 'const'."); YYABORT; } -#line 3347 "antimony.tab.cpp" +#line 3373 "antimony.tab.cpp" break; - case 184: /* geneinit: geneinit ',' varmaybeis */ -#line 564 "antimony.ypp" + case 186: /* geneinit: geneinit ',' varmaybeis */ +#line 579 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3353 "antimony.tab.cpp" +#line 3379 "antimony.tab.cpp" break; - case 185: /* operatorinit: "'operator'" varmaybeis */ -#line 567 "antimony.ypp" + case 187: /* operatorinit: "'operator'" varmaybeis */ +#line 582 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3359 "antimony.tab.cpp" +#line 3385 "antimony.tab.cpp" break; - case 186: /* operatorinit: "'var'" "'operator'" varmaybeis */ -#line 568 "antimony.ypp" + case 188: /* operatorinit: "'var'" "'operator'" varmaybeis */ +#line 583 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3365 "antimony.tab.cpp" +#line 3391 "antimony.tab.cpp" break; - case 187: /* operatorinit: "'const'" "'operator'" varmaybeis */ -#line 569 "antimony.ypp" + case 189: /* operatorinit: "'const'" "'operator'" varmaybeis */ +#line 584 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3371 "antimony.tab.cpp" +#line 3397 "antimony.tab.cpp" break; - case 188: /* operatorinit: operatorinit ',' varmaybeis */ -#line 570 "antimony.ypp" + case 190: /* operatorinit: operatorinit ',' varmaybeis */ +#line 585 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3377 "antimony.tab.cpp" +#line 3403 "antimony.tab.cpp" break; - case 189: /* compartmentinit: "'compartment'" varmaybeis */ -#line 574 "antimony.ypp" + case 191: /* compartmentinit: "'compartment'" varmaybeis */ +#line 589 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3383 "antimony.tab.cpp" +#line 3409 "antimony.tab.cpp" break; - case 190: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ -#line 575 "antimony.ypp" + case 192: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ +#line 590 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3389 "antimony.tab.cpp" +#line 3415 "antimony.tab.cpp" break; - case 191: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ -#line 576 "antimony.ypp" + case 193: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ +#line 591 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3395 "antimony.tab.cpp" +#line 3421 "antimony.tab.cpp" break; - case 192: /* compartmentinit: compartmentinit ',' varmaybeis */ -#line 577 "antimony.ypp" + case 194: /* compartmentinit: compartmentinit ',' varmaybeis */ +#line 592 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3401 "antimony.tab.cpp" +#line 3427 "antimony.tab.cpp" break; - case 193: /* varconstinit: "'var'" varmaybeis */ -#line 580 "antimony.ypp" + case 195: /* varconstinit: "'var'" varmaybeis */ +#line 595 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst();} -#line 3407 "antimony.tab.cpp" +#line 3433 "antimony.tab.cpp" break; - case 194: /* varconstinit: "'const'" varmaybeis */ -#line 581 "antimony.ypp" + case 196: /* varconstinit: "'const'" varmaybeis */ +#line 596 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst();} -#line 3413 "antimony.tab.cpp" +#line 3439 "antimony.tab.cpp" break; - case 195: /* varconstinit: varconstinit ',' varmaybeis */ -#line 582 "antimony.ypp" + case 197: /* varconstinit: varconstinit ',' varmaybeis */ +#line 597 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst();} -#line 3419 "antimony.tab.cpp" +#line 3445 "antimony.tab.cpp" break; - case 196: /* unitinit: "'unit'" variable '=' formula */ -#line 585 "antimony.ypp" + case 198: /* unitinit: "'unit'" variable '=' formula */ +#line 600 "antimony.ypp" {if ((yyvsp[-2].variable)->SetType(varUnitDefinition)) YYABORT; if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[-2].variable)->GetUnitDef()->SetFromFormula((yyvsp[0].formula))) YYABORT;} -#line 3427 "antimony.tab.cpp" +#line 3453 "antimony.tab.cpp" break; - case 197: /* unitinit: "'unit'" variable */ -#line 588 "antimony.ypp" + case 199: /* unitinit: "'unit'" variable */ +#line 603 "antimony.ypp" {if ((yyvsp[0].variable)->SetType(varUnitDefinition)) YYABORT;} -#line 3433 "antimony.tab.cpp" +#line 3459 "antimony.tab.cpp" break; - case 198: /* dnadef: dnastrand */ -#line 591 "antimony.ypp" + case 200: /* dnadef: dnastrand */ +#line 606 "antimony.ypp" {if (g_registry.SaveWorkingStrand()) YYABORT;} -#line 3439 "antimony.tab.cpp" +#line 3465 "antimony.tab.cpp" break; - case 199: /* dnadef: varmaybein ':' dnastrand */ -#line 592 "antimony.ypp" + case 201: /* dnadef: varmaybein ':' dnastrand */ +#line 607 "antimony.ypp" {if (g_registry.SetStrandAs((yyvsp[-2].variable))) YYABORT;} -#line 3445 "antimony.tab.cpp" +#line 3471 "antimony.tab.cpp" break; - case 200: /* dnastrand: "--" variable */ -#line 595 "antimony.ypp" + case 202: /* dnastrand: "--" variable */ +#line 610 "antimony.ypp" {if (g_registry.SetNewUpstreamOpen((yyvsp[0].variable))) YYABORT;} -#line 3451 "antimony.tab.cpp" +#line 3477 "antimony.tab.cpp" break; - case 201: /* dnastrand: "--" dnamiddle */ -#line 596 "antimony.ypp" + case 203: /* dnastrand: "--" dnamiddle */ +#line 611 "antimony.ypp" {g_registry.SetOpenUpstream(); } -#line 3457 "antimony.tab.cpp" +#line 3483 "antimony.tab.cpp" break; - case 202: /* dnastrand: dnamiddle variable */ -#line 597 "antimony.ypp" + case 204: /* dnastrand: dnamiddle variable */ +#line 612 "antimony.ypp" {if (g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3463 "antimony.tab.cpp" +#line 3489 "antimony.tab.cpp" break; - case 203: /* dnastrand: "--" dnamiddle variable */ -#line 598 "antimony.ypp" + case 205: /* dnastrand: "--" dnamiddle variable */ +#line 613 "antimony.ypp" {g_registry.SetOpenUpstream(); if(g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3469 "antimony.tab.cpp" +#line 3495 "antimony.tab.cpp" break; - case 204: /* dnastrand: dnamiddle */ -#line 599 "antimony.ypp" + case 206: /* dnastrand: dnamiddle */ +#line 614 "antimony.ypp" { } -#line 3475 "antimony.tab.cpp" +#line 3501 "antimony.tab.cpp" break; - case 205: /* dnamiddle: variable "--" */ -#line 602 "antimony.ypp" + case 207: /* dnamiddle: variable "--" */ +#line 617 "antimony.ypp" {if (g_registry.SetNewDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3481 "antimony.tab.cpp" +#line 3507 "antimony.tab.cpp" break; - case 206: /* dnamiddle: dnamiddle variable "--" */ -#line 603 "antimony.ypp" + case 208: /* dnamiddle: dnamiddle variable "--" */ +#line 618 "antimony.ypp" {if (g_registry.SetDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3487 "antimony.tab.cpp" +#line 3513 "antimony.tab.cpp" break; - case 207: /* $@8: %empty */ -#line 606 "antimony.ypp" + case 209: /* $@8: %empty */ +#line 621 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula))) YYABORT;} -#line 3493 "antimony.tab.cpp" +#line 3519 "antimony.tab.cpp" break; - case 208: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ -#line 606 "antimony.ypp" + case 210: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ +#line 621 "antimony.ypp" {} -#line 3499 "antimony.tab.cpp" +#line 3525 "antimony.tab.cpp" break; - case 209: /* $@9: %empty */ -#line 607 "antimony.ypp" + case 211: /* $@9: %empty */ +#line 622 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula))) YYABORT;} -#line 3505 "antimony.tab.cpp" +#line 3531 "antimony.tab.cpp" break; - case 210: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ -#line 607 "antimony.ypp" + case 212: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ +#line 622 "antimony.ypp" {} -#line 3511 "antimony.tab.cpp" +#line 3537 "antimony.tab.cpp" break; - case 211: /* $@10: %empty */ -#line 608 "antimony.ypp" + case 213: /* $@10: %empty */ +#line 623 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula), (yyvsp[-3].variable))) YYABORT;} -#line 3517 "antimony.tab.cpp" +#line 3543 "antimony.tab.cpp" break; - case 212: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ -#line 608 "antimony.ypp" + case 214: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ +#line 623 "antimony.ypp" {} -#line 3523 "antimony.tab.cpp" +#line 3549 "antimony.tab.cpp" break; - case 213: /* $@11: %empty */ -#line 609 "antimony.ypp" + case 215: /* $@11: %empty */ +#line 624 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula), (yyvsp[-5].variable))) YYABORT;} -#line 3529 "antimony.tab.cpp" +#line 3555 "antimony.tab.cpp" break; - case 214: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ -#line 609 "antimony.ypp" + case 216: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ +#line 624 "antimony.ypp" {} -#line 3535 "antimony.tab.cpp" +#line 3561 "antimony.tab.cpp" break; - case 215: /* colonret: ':' */ -#line 612 "antimony.ypp" + case 217: /* colonret: ':' */ +#line 627 "antimony.ypp" {} -#line 3541 "antimony.tab.cpp" +#line 3567 "antimony.tab.cpp" break; - case 216: /* colonret: colonret '\n' */ -#line 613 "antimony.ypp" + case 218: /* colonret: colonret '\n' */ +#line 628 "antimony.ypp" {} -#line 3547 "antimony.tab.cpp" +#line 3573 "antimony.tab.cpp" break; - case 217: /* eventmodifications: %empty */ -#line 616 "antimony.ypp" + case 219: /* eventmodifications: %empty */ +#line 631 "antimony.ypp" {} -#line 3553 "antimony.tab.cpp" +#line 3579 "antimony.tab.cpp" break; - case 218: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ -#line 617 "antimony.ypp" + case 220: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ +#line 632 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "priority")) {g_registry.GetCurrentEvent()->SetPriority(*(yyvsp[0].formula));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "t0")) {if (g_registry.GetCurrentEvent()->SetInitialValue(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "fromTrigger")) {if (g_registry.GetCurrentEvent()->SetUseValuesFromTriggerTime(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "persistent")) {if (g_registry.GetCurrentEvent()->SetPersistent(*(yyvsp[0].formula))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in event defintion. You may use the terms 'priority', 't0', 'fromTrigger', and 'persistent' here to set those properties of an event."); YYABORT;}} -#line 3563 "antimony.tab.cpp" +#line 3589 "antimony.tab.cpp" break; - case 219: /* assignmentlist: variable '=' formula */ -#line 624 "antimony.ypp" + case 221: /* assignmentlist: variable '=' formula */ +#line 639 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3569 "antimony.tab.cpp" +#line 3595 "antimony.tab.cpp" break; - case 220: /* assignmentlist: variable '=' formula ':' assignmentlist */ -#line 625 "antimony.ypp" + case 222: /* assignmentlist: variable '=' formula ':' assignmentlist */ +#line 640 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3575 "antimony.tab.cpp" +#line 3601 "antimony.tab.cpp" break; - case 221: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ -#line 626 "antimony.ypp" + case 223: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ +#line 641 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3581 "antimony.tab.cpp" +#line 3607 "antimony.tab.cpp" break; - case 222: /* assignmentlist: variable '=' formula ',' assignmentlist */ -#line 627 "antimony.ypp" + case 224: /* assignmentlist: variable '=' formula ',' assignmentlist */ +#line 642 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3587 "antimony.tab.cpp" +#line 3613 "antimony.tab.cpp" break; - case 223: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ -#line 628 "antimony.ypp" + case 225: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ +#line 643 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3593 "antimony.tab.cpp" +#line 3619 "antimony.tab.cpp" break; - case 224: /* deletion: "'delete'" variable */ -#line 631 "antimony.ypp" + case 226: /* deletion: "'delete'" variable */ +#line 646 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3599 "antimony.tab.cpp" +#line 3625 "antimony.tab.cpp" break; - case 225: /* deletion: deletion ',' variable */ -#line 632 "antimony.ypp" + case 227: /* deletion: deletion ',' variable */ +#line 647 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3605 "antimony.tab.cpp" +#line 3631 "antimony.tab.cpp" break; - case 226: /* unitdef: formula */ -#line 635 "antimony.ypp" + case 228: /* unitdef: formula */ +#line 650 "antimony.ypp" { if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[0].formula)->IsSingleVariable()) { - (yyval.variable) = g_registry.CurrentModule()->GetVariable(((yyvsp[0].formula)->GetVariables())[0]); + (yyval.variable) = g_registry.CurrentModule()->GetVariable(((yyvsp[0].formula)->GetVariableStrings())[0]); if ((yyval.variable)==NULL) YYABORT; } else { @@ -3619,125 +3645,125 @@ yyparse (void) (yyval.variable) = g_registry.CurrentModule()->AddOrFindUnitDef(ud); } } -#line 3623 "antimony.tab.cpp" +#line 3649 "antimony.tab.cpp" break; - case 227: /* constraint: "number" inequality formula */ -#line 650 "antimony.ypp" + case 229: /* constraint: "number" inequality formula */ +#line 665 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3629 "antimony.tab.cpp" +#line 3655 "antimony.tab.cpp" break; - case 228: /* constraint: '-' "number" inequality formula */ -#line 651 "antimony.ypp" + case 230: /* constraint: '-' "number" inequality formula */ +#line 666 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint(-(yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3635 "antimony.tab.cpp" +#line 3661 "antimony.tab.cpp" break; - case 229: /* constraint: "name of a pre-defined constant" inequality formula */ -#line 652 "antimony.ypp" + case 231: /* constraint: "name of a pre-defined constant" inequality formula */ +#line 667 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3641 "antimony.tab.cpp" +#line 3667 "antimony.tab.cpp" break; - case 230: /* constraint: "element name" inequality formula */ -#line 653 "antimony.ypp" + case 232: /* constraint: "element name" inequality formula */ +#line 668 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3647 "antimony.tab.cpp" +#line 3673 "antimony.tab.cpp" break; - case 231: /* constraint: "'constraint'" ':' formula */ -#line 654 "antimony.ypp" + case 233: /* constraint: "'constraint'" ':' formula */ +#line 669 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[0].formula))) YYABORT;} -#line 3653 "antimony.tab.cpp" +#line 3679 "antimony.tab.cpp" break; - case 232: /* constraint: "'constraint'" variable ':' formula */ -#line 655 "antimony.ypp" + case 234: /* constraint: "'constraint'" variable ':' formula */ +#line 670 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3659 "antimony.tab.cpp" +#line 3685 "antimony.tab.cpp" break; - case 233: /* objective: maxormin formula */ -#line 658 "antimony.ypp" + case 235: /* objective: maxormin formula */ +#line 673 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3665 "antimony.tab.cpp" +#line 3691 "antimony.tab.cpp" break; - case 234: /* maxormin: "'maximize'" */ -#line 661 "antimony.ypp" + case 236: /* maxormin: "'maximize'" */ +#line 676 "antimony.ypp" {(yyval.maxormin) = true;} -#line 3671 "antimony.tab.cpp" +#line 3697 "antimony.tab.cpp" break; - case 235: /* maxormin: "'minimize'" */ -#line 662 "antimony.ypp" + case 237: /* maxormin: "'minimize'" */ +#line 677 "antimony.ypp" {(yyval.maxormin) = false;} -#line 3677 "antimony.tab.cpp" +#line 3703 "antimony.tab.cpp" break; - case 236: /* stringlist: "text string" */ -#line 665 "antimony.ypp" + case 238: /* stringlist: "text string" */ +#line 680 "antimony.ypp" { (yyval.stringlist) = new std::vector(); (yyval.stringlist)->push_back(*((yyvsp[0].word))); } -#line 3683 "antimony.tab.cpp" +#line 3709 "antimony.tab.cpp" break; - case 237: /* stringlist: stringlist ',' "text string" */ -#line 666 "antimony.ypp" + case 239: /* stringlist: stringlist ',' "text string" */ +#line 681 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-2].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3689 "antimony.tab.cpp" +#line 3715 "antimony.tab.cpp" break; - case 238: /* stringlist: stringlist ',' '\n' "text string" */ -#line 667 "antimony.ypp" + case 240: /* stringlist: stringlist ',' '\n' "text string" */ +#line 682 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-3].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3695 "antimony.tab.cpp" +#line 3721 "antimony.tab.cpp" break; - case 239: /* $@12: %empty */ -#line 669 "antimony.ypp" + case 241: /* $@12: %empty */ +#line 684 "antimony.ypp" {if (g_registry.SetCurrentModuleIf((yyvsp[0].word), (yyvsp[-1].word))) YYABORT;} -#line 3701 "antimony.tab.cpp" +#line 3727 "antimony.tab.cpp" break; - case 240: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ -#line 669 "antimony.ypp" + case 242: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ +#line 684 "antimony.ypp" {g_registry.RevertToPreviousModule();} -#line 3707 "antimony.tab.cpp" +#line 3733 "antimony.tab.cpp" break; - case 241: /* annotations: %empty */ -#line 672 "antimony.ypp" + case 243: /* annotations: %empty */ +#line 687 "antimony.ypp" {} -#line 3713 "antimony.tab.cpp" +#line 3739 "antimony.tab.cpp" break; - case 242: /* annotations: "element name" ':' stringlist */ -#line 673 "antimony.ypp" + case 244: /* annotations: "element name" ':' stringlist */ +#line 688 "antimony.ypp" {string modname = g_registry.CurrentModuleName(); g_registry.ProcessGlobalCVTerm(&modname, (yyvsp[-2].word), (yyvsp[0].stringlist));} -#line 3719 "antimony.tab.cpp" +#line 3745 "antimony.tab.cpp" break; - case 243: /* cvterm: variable "element name" stringlist */ -#line 678 "antimony.ypp" + case 245: /* cvterm: variable "element name" stringlist */ +#line 693 "antimony.ypp" {if (g_registry.CurrentModule()->ProcessCVTerm((yyvsp[-2].variable),(yyvsp[-1].word),(yyvsp[0].stringlist))) YYABORT;} -#line 3725 "antimony.tab.cpp" +#line 3751 "antimony.tab.cpp" break; - case 244: /* cvterm: variable "element name" '.' "element name" stringlist */ -#line 679 "antimony.ypp" + case 246: /* cvterm: variable "element name" '.' "element name" stringlist */ +#line 694 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].stringlist))) YYABORT;} -#line 3731 "antimony.tab.cpp" +#line 3757 "antimony.tab.cpp" break; - case 245: /* cvterm: variable "element name" '.' "element name" "number" */ -#line 680 "antimony.ypp" + case 247: /* cvterm: variable "element name" '.' "element name" "number" */ +#line 695 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].num))) YYABORT;} -#line 3737 "antimony.tab.cpp" +#line 3763 "antimony.tab.cpp" break; - case 246: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ -#line 684 "antimony.ypp" + case 248: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ +#line 699 "antimony.ypp" { Module* module = g_registry.GetModule(*(yyvsp[-4].word)); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); @@ -3747,11 +3773,11 @@ yyparse (void) YYABORT; } } -#line 3751 "antimony.tab.cpp" +#line 3777 "antimony.tab.cpp" break; - case 247: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ -#line 695 "antimony.ypp" + case 249: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ +#line 710 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { function->SetSBOTerm(lround((yyvsp[0].num))); @@ -3761,11 +3787,11 @@ yyparse (void) YYABORT; } } -#line 3765 "antimony.tab.cpp" +#line 3791 "antimony.tab.cpp" break; - case 248: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ -#line 705 "antimony.ypp" + case 250: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ +#line 720 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; @@ -3775,11 +3801,25 @@ yyparse (void) YYABORT; } } -#line 3779 "antimony.tab.cpp" +#line 3805 "antimony.tab.cpp" break; - case 249: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ -#line 715 "antimony.ypp" + case 251: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "name of a pre-defined constant" */ +#line 730 "antimony.ypp" + { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); + if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { + if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set on '" + *((yyvsp[-4].word)) + "' to a string is 'autolayout'."); + YYABORT; + } + } +#line 3819 "antimony.tab.cpp" + break; + + case 252: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ +#line 740 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; @@ -3791,12 +3831,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 3796 "antimony.tab.cpp" +#line 3837 "antimony.tab.cpp" break; - case 250: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ -#line 728 "antimony.ypp" + case 253: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ +#line 754 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; @@ -3808,12 +3849,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 3813 "antimony.tab.cpp" +#line 3855 "antimony.tab.cpp" break; - case 251: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '[' variablelist ']' */ -#line 741 "antimony.ypp" + case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ +#line 768 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -3825,12 +3867,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 3830 "antimony.tab.cpp" +#line 3873 "antimony.tab.cpp" break; - case 252: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '[' numlist ']' */ -#line 754 "antimony.ypp" + case 255: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ +#line 782 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -3842,48 +3885,49 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } -#line 3847 "antimony.tab.cpp" +#line 3891 "antimony.tab.cpp" break; - case 253: /* modulename: "name of an existing module" "'is'" "text string" lineend */ -#line 769 "antimony.ypp" + case 256: /* modulename: "name of an existing module" "'is'" "text string" lineend */ +#line 798 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3853 "antimony.tab.cpp" +#line 3897 "antimony.tab.cpp" break; - case 254: /* functionname: "name of an existing function" "'is'" "text string" lineend */ -#line 771 "antimony.ypp" + case 257: /* functionname: "name of an existing function" "'is'" "text string" lineend */ +#line 800 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3859 "antimony.tab.cpp" +#line 3903 "antimony.tab.cpp" break; - case 255: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ -#line 774 "antimony.ypp" + case 258: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ +#line 803 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3865 "antimony.tab.cpp" +#line 3909 "antimony.tab.cpp" break; - case 256: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ -#line 775 "antimony.ypp" + case 259: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ +#line 804 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT;} -#line 3871 "antimony.tab.cpp" +#line 3915 "antimony.tab.cpp" break; - case 257: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ -#line 776 "antimony.ypp" + case 260: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ +#line 805 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT;} -#line 3877 "antimony.tab.cpp" +#line 3921 "antimony.tab.cpp" break; - case 258: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ -#line 777 "antimony.ypp" + case 261: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ +#line 806 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3883 "antimony.tab.cpp" +#line 3927 "antimony.tab.cpp" break; -#line 3887 "antimony.tab.cpp" +#line 3931 "antimony.tab.cpp" default: break; } @@ -4107,7 +4151,7 @@ yyparse (void) return yyresult; } -#line 779 "antimony.ypp" +#line 808 "antimony.ypp" diff --git a/src/antimony.ypp b/src/antimony.ypp index a6d1e17c..1657e59f 100644 --- a/src/antimony.ypp +++ b/src/antimony.ypp @@ -84,8 +84,8 @@ using namespace libsbml; bool maxormin; constraint_type inequality; std::vector* stringlist; - std::vector variablelist; - std::vector numlist; + std::vector* variablelist; + std::vector* numlist; } %type mathThing "mathematical symbol" @@ -296,6 +296,16 @@ moduleannotation: MODULE ANTWORD stringlist lineend YYABORT; } } + | MODULE '.' ANTWORD '=' CONSTANT + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + YYABORT; + } + } | MODULE '.' ANTWORD '.' ANTWORD '=' NUM { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { @@ -308,6 +318,7 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } | MODULE '.' ANTWORD '.' ANTWORD '=' ANTWORD { Module* module = g_registry.CurrentModule(); @@ -321,8 +332,9 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } - | MODULE '.' ANTWORD '.' ANTWORD '=' '[' variablelist ']' + | MODULE '.' ANTWORD '.' ANTWORD '=' '{' variablelist '}' { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { if (module->SetAutoLayout($5, $8)) YYABORT; @@ -334,8 +346,9 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } - | MODULE '.' ANTWORD '.' ANTWORD '=' '[' numlist ']' + | MODULE '.' ANTWORD '.' ANTWORD '=' '{' numlist '}' { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { if (module->SetAutoLayout($5, $8)) YYABORT; @@ -347,17 +360,18 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } ; -variablelist: variable { std::vector ret; $$ = ret; $$.push_back($1);} // need to free $1? - | variablelist ',' variable { $$ = $1; $$.push_back($3); } // need to free $3? - | variablelist ',' '\n' variable { $$ = $1; $$.push_back($4); } // eat newlines +variablelist: variable { $$ = new std::vector(); $$->push_back($1);} // need to free $1? + | variablelist ',' variable { $$ = $1; $$->push_back($3); } // need to free $3? + | variablelist ',' '\n' variable { $$ = $1; $$->push_back($4); } // eat newlines ; -numlist: NUM { std::vector ret; $$ = ret; $$.push_back($1); } - | numlist ',' NUM { $$ = $1; $$.push_back($3); } - | numlist ',' '\n' NUM { $$ = $1; $$.push_back($4); } // eat newlines +numlist: NUM { $$ = new std::vector(); $$->push_back($1); } + | numlist ',' NUM { $$ = $1; $$->push_back($3); } + | numlist ',' '\n' NUM { $$ = $1; $$->push_back($4); } // eat newlines ; modulepart: reaction lineend {} @@ -455,6 +469,7 @@ formula: /* empty */ {$$ = g_registry.NewBlankFormula(); } | formula '=' '=' {$$ = $1; $1->AddMathThing('='); $1->AddMathThing('='); } | formula '&' '&' {$$ = $1; $1->AddMathThing('&'); $1->AddMathThing('&'); } | formula '|' '|' {$$ = $1; $1->AddMathThing('|'); $1->AddMathThing('|'); } + | formula TEXTSTRING {$$ = $1; $1->AddText($2, true); } ; commaformula: formula {$$ = $1;} @@ -635,7 +650,7 @@ deletion: DELETEWORD variable {if (g_registry.CurrentModule()->AddDeletion unitdef: formula { if ($1->MakeAllVariablesUnits()) YYABORT; if ($1->IsSingleVariable()) { - $$ = g_registry.CurrentModule()->GetVariable(($1->GetVariables())[0]); + $$ = g_registry.CurrentModule()->GetVariable(($1->GetVariableStrings())[0]); if ($$==NULL) YYABORT; } else { @@ -711,6 +726,16 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM YYABORT; } } + | MODNAME '.' ANTWORD '=' CONSTANT + { Module* function = g_registry.GetModule(*$1); + if (function && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (function->SetAutoLayout($5)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set on '" + *($1) + "' to a string is 'autolayout'."); + YYABORT; + } + } | MODNAME '.' ANTWORD '.' ANTWORD '=' NUM { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { @@ -723,6 +748,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } | MODNAME '.' ANTWORD '.' ANTWORD '=' ANTWORD { Module* module = g_registry.CurrentModule(); @@ -736,8 +762,9 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } - | MODNAME '.' ANTWORD '.' ANTWORD '=' '[' variablelist ']' + | MODNAME '.' ANTWORD '.' ANTWORD '=' '{' variablelist '}' { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { if (module->SetAutoLayout($5, $8)) YYABORT; @@ -749,8 +776,9 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } - | MODNAME '.' ANTWORD '.' ANTWORD '=' '[' numlist ']' + | MODNAME '.' ANTWORD '.' ANTWORD '=' '{' numlist '}' { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { if (module->SetAutoLayout($5, $8)) YYABORT; @@ -762,6 +790,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } + module->SetAutoLayout("on"); } // JKM for naming modules and functions (display names) diff --git a/src/antimony_api.cpp b/src/antimony_api.cpp index 21313d55..aca04a98 100644 --- a/src/antimony_api.cpp +++ b/src/antimony_api.cpp @@ -1711,7 +1711,9 @@ LIB_EXTERN return_type getTypeOfSymbol(const char* moduleName, const char* symbo case varUndefined: case varSboTermWrapper: case varUncertWrapper: - return allUnknown; + case varLayoutWrapper: + case varLayoutColorEtc: + return allUnknown; case varModule: return subModules; case varEvent: diff --git a/src/enums.h b/src/enums.h index 1cc4f996..d476b093 100644 --- a/src/enums.h +++ b/src/enums.h @@ -53,8 +53,10 @@ enum var_type {varSpeciesUndef = 0, varConstraint, varSboTermWrapper, varUncertWrapper, + varLayoutWrapper, varStoichiometry, varAlgebraicRule, + varLayoutColorEtc, }; /** * return_types are used in the API when requesting information about different symbols. Each return_type refers to a different group of symbols, and are overlapping--i.e. a single symbol can be included in 'allGenes' and 'allReactions'. @@ -192,4 +194,42 @@ enum uncert_type { unUnknown }; +/** + * layout_types are the different types of layout information. + * - unCoefficientOfVariation: + * - unKurtosis: + * - unMean: + * - unMedian: + * - unMode: + * - unSampleSize: + * - unSkewness: + * - unStandardDeviation: + * - unStandardError: + * - unVariance: + * - unConfidenceInterval: + * - unCredibleInterval: + * - unInterquartileRange: + * - unRange: + * - unDistribution: + * - unExternalParameter: + */ +enum layout_type { + lt_position = 0, + lt_x, + lt_y, + lt_size, + lt_height, + lt_width, + lt_color, + lt_font, + lt_fontsize, + lt_fontcolor, + lt_fontstyle, + lt_fontweight, + lt_linewidth, + lt_linecolor, + lt_shape, + lt_unknown +}; + #endif // ENUMS_H diff --git a/src/formula.cpp b/src/formula.cpp index 4a92efb2..3dc56415 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -23,6 +23,16 @@ using namespace std; using namespace libsbml; extern bool CaselessStrCmp(bool caseless, const string& lhs, const string& rhs); +Formula::Formula() + : m_components() + , m_conversionFactors() + , m_timeConversionFactors() + , m_convertedVariables() + , m_module() + , m_setWithLiteralStrings(false) +{ +} + bool Formula::AddVariable(const Variable* var) { if (!var->AllowedInFormulas()) { @@ -66,12 +76,15 @@ void Formula::AddNum(double num) m_components.push_back(newvar); } -void Formula::AddText(const string* function) +void Formula::AddText(const string* function, bool literalString) { vector novar; pair > newvar; newvar = make_pair(*function, novar); m_components.push_back(newvar); + if (literalString) { + m_setWithLiteralStrings = literalString; + } } void Formula::AddMathThing(char maththing) @@ -329,6 +342,11 @@ bool Formula::IsSingleVariable() const return false; } +bool Formula::IsOneComponent() const +{ + return m_components.size() == 1; +} + bool Formula::GetIsConst() const { for (size_t comp=0; comp Formula::GetVariablesFrom(string formula, string module) return retval; } -vector > Formula::GetVariables() const +vector Formula::GetVariables() +{ + vector retval; + + for (size_t comp = 0; comp < m_components.size(); comp++) { + if (m_components[comp].second.size() > 0) { + retval.push_back(g_registry.GetModule(m_module)->GetVariable(m_components[comp].second)); + } + } + return retval; +} + +vector > Formula::GetVariableStrings() const { vector > vars; for (size_t comp=0; comp > > m_timeConversionFactors; std::vector, std::vector > > m_convertedVariables; std::string m_module; + bool m_setWithLiteralStrings; public: - Formula() {}; + Formula(); ~Formula() {}; bool AddVariable(const Variable* var); void AddNum(double num); void AddMathThing(char maththing); void AddInequality(constraint_type ineq); - void AddText(const std::string* function); + void AddText(const std::string* function, bool literalString = false); void AddFormula(const Formula* form2); void AddEllipses(); void AddParentheses(); @@ -54,6 +55,7 @@ class Formula : public Annotated bool IsOne() const; bool IsEllipsesOnly() const; bool IsSingleVariable() const; + bool IsOneComponent() const; bool GetIsConst() const; bool CheckIncludes(std::string modname, const ReactantList* rlist) const; bool ContainsVar(std::string modname, std::vector vname) const; @@ -62,6 +64,7 @@ class Formula : public Annotated bool ContainsFunction(const std::string& function) const; bool ContainsName(const std::string& name) const; bool ContainsCurlyBrackets() const; + bool SetWithLiteralStrings() const; void Clear(); @@ -72,7 +75,8 @@ class Formula : public Annotated double ToAmount() const; std::string ConvertOneSymbolToFunction(std::string formula) const; std::vector GetVariablesFrom(std::string formula, std::string module) const; - std::vector > GetVariables() const; + std::vector GetVariables(); + std::vector > GetVariableStrings() const; void FixNames(std::string modname); void ChangeTimeTo(const Variable* timeref); diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp new file mode 100644 index 00000000..b7058141 --- /dev/null +++ b/src/layoutWrapper.cpp @@ -0,0 +1,328 @@ +#include "LayoutWrapper.h" +#include "module.h" +#include "registry.h" +#include "stringx.h" +#include "regex" +#ifdef LIBSBML_HAS_PACKAGE_DISTRIB +#include +#include +#endif +#include +#include +#include +#include + +using namespace std; +using namespace libsbml; + +LayoutWrapper::LayoutWrapper(Variable* parent, layout_type type) + : Variable() + , m_parent(parent) + , m_layout_type(type) +{ + m_module = parent->GetNamespace(); + m_displayname = ""; + m_formulatype = formulaINITIAL; + m_supercomptype = varUndefined; + m_deletedunit = false; + m_replacedformrxn = false; + m_const = constDEFAULT; + m_substOnly = false; + m_sboTermWrapper = NULL; + m_type = varLayoutWrapper; + SetNamespace(parent->GetNamespace()); +} + +LayoutWrapper::~LayoutWrapper() +{ +} + +bool LayoutWrapper::IsPointer() const +{ + return false; +} + +Variable* LayoutWrapper::GetSameVariable() +{ + return m_parent; +} + +const Variable* LayoutWrapper::GetSameVariable() const +{ + return m_parent; +} + +bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) +{ + if (Variable::SetFormula(formula, isObjective)) { + return true; + } + + if (IsPair(m_layout_type)) { + //Only Vectors of length 2 are allowed for these types + //We're only going to be able to check this in SBML mode +#ifndef NSBML + ASTNode* astn = parseStringToASTNode(formula->ToSBMLString()); + if (!astn || astn->getType() != AST_LINEAR_ALGEBRA_VECTOR || astn->getNumChildren() != 2) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': an layout parameter of type " + LayoutTypeToString(m_layout_type) + " must be a vector of length two, marked with curly brackets (i.e. '{150, 200}')."); + delete astn; + return true; + } + for (unsigned int c = 0; c < 2; c++) { + ASTNodeType_t ctype = astn->getChild(c)->getType(); + if (!astn->getChild(c)->isNumber()) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': an layout parameter of type " + LayoutTypeToString(m_layout_type) + " must be a vector of length two, and each element of the vector may only be a value (i.e. '{150, 200}')."); + delete astn; + return true; + } + } + if (astn->getChild(0)->isSetUnits() || astn->getChild(1)->isSetUnits()) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': units may not be used for layout positions."); + delete astn; + return true; + } + delete astn; +#endif + return false; + } + else { + string formstring = m_valFormula.ToSBMLString(); + ASTNode* astn = parseStringToASTNode(formstring); + double lval = astn->getValue(); + string strval = ""; + if (astn->getType() == AST_NAME) { + strval = astn->getName(); + } + if (formula->IsOneComponent()) { + vector varvec = formula->GetVariables(); + if (varvec.size() > 0) { + if (varvec[0]->SetType(varLayoutColorEtc)) { + return true; + } + } + switch (m_layout_type) { + case lt_x: + case lt_y: + case lt_height: + case lt_width: + case lt_fontsize: + case lt_linewidth: + if (astn == NULL || !astn->isNumber()) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to '" + formula->ToDelimitedStringWithEllipses(".") + "'. It may only be set to a numerical value."); + return true; + } + break; + case lt_color: + case lt_fontcolor: + case lt_linecolor: + if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(formstring)) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "'. '" + formula->ToDelimitedStringWithEllipses(".") + "' is not a valid color value. Try standard color names like 'red' or 'blue', or use an RGB value of the form \"#000000\" (including the quotation marks)."); + return true; + } + return false; + case lt_font: + if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidFontFamilyValue(formstring)) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "'. '" + formula->ToDelimitedStringWithEllipses(".") + "' is not a valid font value. The predefined fonts are the general 'serif', 'sans_serif' and 'monospace', but arbitrary font names are also legal."); + return true; + } + return false; + case lt_fontstyle: + case lt_fontweight: + if (!isValidFontStyle(formstring)) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "'. '" + formula->ToDelimitedStringWithEllipses(".") + "' is not a valid font style. The valid font styles and weights are 'normal', 'bold', 'italic', and 'bold_italic'."); + return true; + } + return false; + case lt_shape: + if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidGeometricShapeName(formstring)) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "'. '" + formula->ToDelimitedStringWithEllipses(".") + "' is not a valid shape name. The valid shape names are 'rectangle', 'square', 'ellipse', 'circle', 'triangle', 'diamond', 'pentagon', 'hexagon', and 'octagon'."); + return true; + } + return false; + case lt_unknown: + break; + } + return false; + } + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': this layout parameter must only be a single value or a single variable."); + return true; + } + return false; +} + +bool LayoutWrapper::SetType(var_type newtype) +{ + if (newtype == m_type) { + return false; + } + g_registry.SetError("Unable to use the symbol '" + GetNameDelimitedBy(".") + "' in any context other than setting its value."); + return true; +} + +//bool LayoutWrapper::SetlayoutType(layout_type newtype) +//{ +// m_layout_type = newtype; +//} + +layout_type LayoutWrapper::GetLayoutType() +{ + return m_layout_type; +} + +Variable* LayoutWrapper::GetParent() +{ + return m_parent; +} + +string LayoutWrapper::GetNameDelimitedBy(string cc) const +{ + return m_parent->GetNameDelimitedBy(cc) + cc + LayoutTypeToString(m_layout_type); +} + +bool LayoutWrapper::Synchronize(Variable* clone, const Variable* conversionFactor) +{ + g_registry.SetError("Unable to synchronize two symbols when one of them ('" + GetNameDelimitedBy(".") + "') is an layout term."); + return true; +} + +string LayoutWrapper::CreatelayoutParamsAntimonySyntax(const string& indent) const +{ + string ret = ""; + if (!m_valFormula.IsEmpty()) { + ret = indent + GetNameDelimitedBy(".") + " = " + m_valFormula.ToDelimitedStringWithEllipses(".") + "\n"; + } + if (!m_displayname.empty()) { + ret += indent + GetNameDelimitedBy(".") + " is \"" + m_displayname + "\"\n"; + } + return ret; +} + +bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const +{ + string sid = m_parent->GetNameDelimitedBy("_"); + string formstring = m_valFormula.ToSBMLString(); + ASTNode* astn = parseStringToASTNode(formstring); + string error = "Unable to set " + sid + "." + LayoutTypeToString(m_layout_type) + " to " + formstring + "."; + if (IsPair(m_layout_type)) { + //The content should already be checked. + assert(astn->getNumChildren() == 2); + double xval = astn->getChild(0)->getValue(); + double yval = astn->getChild(1)->getValue(); + int ret1 = 0; + int ret2 = 0; + switch (m_layout_type) { + case lt_position: + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, xval); + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, yval); + break; + case lt_size: + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, xval); + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, yval); + break; + //case lt_start: + //case lt_end: + //case lt_mid1: + //case lt_mid2: + // assert(false); //Probably don't actually set these. + // break; + } + if (ret1 == -1 || ret2 == -1) { + g_registry.SetError(error); + return true; + } + } + else { + double lval = astn->getValue(); + int ret = 0; + switch (m_layout_type) { + case lt_x: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, lval); + break; + case lt_y: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, lval); + break; + case lt_height: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, lval); + break; + case lt_width: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, lval); + break; + case lt_color: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFillColor(sbml, sid, formstring); + break; + case lt_font: + { + std::regex underscore_re("_"); + formstring = std::regex_replace(formstring, underscore_re, "-"); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontFamily(sbml, sid, formstring); + break; + } + case lt_fontsize: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontSize(sbml, sid, lval); + break; + case lt_fontcolor: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontColor(sbml, sid, formstring); + break; + case lt_fontstyle: + case lt_fontweight: + if (CaselessStrCmp(false, formstring, "bold")) { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, sid, formstring); + } + if (CaselessStrCmp(false, formstring, "italic")) { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, sid, formstring); + } + if (CaselessStrCmp(false, formstring, "normal")) { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, sid, formstring); + if (ret == 0) { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, sid, formstring); + } + } + if (CaselessStrCmp(false, formstring, "bold_italic")) { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, sid, "bold"); + if (ret == 0) { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, sid, "italic"); + } + } + break; + case lt_linewidth: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setStrokeWidth(sbml, sid, lval); + assert(false); + break; + case lt_linecolor: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setStrokeColor(sbml, sid, formstring); + break; + case lt_shape: + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setGeometricShapeType(sbml, sid, formstring); + break; + case lt_unknown: + break; + } + } + + + return false; +} + +bool LayoutWrapper::HasLayoutPositionInfo() const +{ + switch (m_layout_type) { + case lt_position: + case lt_x: + case lt_y: + return true; + case lt_size: + case lt_height: + case lt_width: + case lt_color: + case lt_font: + case lt_fontsize: + case lt_fontcolor: + case lt_fontstyle: + case lt_fontweight: + case lt_linewidth: + case lt_linecolor: + case lt_shape: + case lt_unknown: + return false; + } +} diff --git a/src/layoutWrapper.h b/src/layoutWrapper.h new file mode 100644 index 00000000..1183b7ee --- /dev/null +++ b/src/layoutWrapper.h @@ -0,0 +1,34 @@ +#ifndef LAYOUTWRAPPER_H +#define LAYOUTWRAPPER_H + +#include "variable.h" +#include + +class Variable; +// A proxy class returned by the parser for setting layout terms +class LayoutWrapper : public Variable +{ +protected: + Variable* m_parent; + layout_type m_layout_type; +public: + LayoutWrapper(Variable* parent, layout_type type); + ~LayoutWrapper(); + + bool IsPointer() const; + virtual Variable* GetSameVariable(); + virtual const Variable* GetSameVariable() const; + virtual bool SetFormula(Formula* formula, bool isObjective=false); + virtual bool SetType(var_type newtype); + //virtual bool SetlayoutType(layout_type newtype); + virtual layout_type GetLayoutType(); + Variable* GetParent(); + virtual std::string GetNameDelimitedBy(std::string cc) const; + virtual bool Synchronize(Variable* clone, const Variable* conversionFactor); + virtual std::string CreatelayoutParamsAntimonySyntax(const std::string& indent) const; + virtual bool TransferLayoutInformationTo(libsbml::SBMLDocument* sbml) const; + virtual bool HasLayoutPositionInfo() const; +}; + + +#endif //LAYOUTWRAPPER_H diff --git a/src/module-cellml.cpp b/src/module-cellml.cpp index f869f5b3..d6a79328 100644 --- a/src/module-cellml.cpp +++ b/src/module-cellml.cpp @@ -559,8 +559,10 @@ void Module::CreateCellMLComponent(Module* topmod) case varModule: case varStrand: case varUncertWrapper: + case varLayoutWrapper: case varSboTermWrapper: case varStoichiometry: + case varLayoutColorEtc: //These all have no CellML equivalent (except Module, which is taken care of separately). break; case varAlgebraicRule: diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 70a7f8fa..a2ac6c08 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -1,6 +1,8 @@ #include "module.h" #include "sbml/Model.h" #include "libsbmlnetwork_sbmldocument.h" +#include "libsbmlnetwork_sbmldocument_layout.h" +#include "libsbmlnetwork_sbmldocument_render.h" using namespace libsbml; @@ -231,10 +233,12 @@ void Module::FindOrCreateLocalVersionOf(const Variable* var, libsbml::Model* sbm case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: case varStoichiometry: case varAlgebraicRule: - assert(false); //Unhandled type + case varLayoutColorEtc: + assert(false); //Unhandled type break; } vector varname = var->GetName(); @@ -2439,11 +2443,58 @@ void Module::CreateSBMLModel(bool comp) FixPortReferencesIn(sbmlmod); } #endif //USE_COMP + + // Layout/Render! if (m_autolayout.use) { - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, m_autolayout.lockedNodeIds); - //LIBSBMLNETWORK_CPP_NAMESPACE::updateLayoutCurves(&m_sbml, NULL); - //LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); - //compareChar('b', 'c'); + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel); // , m_autolayout.lockedNodeIds); + LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); + if (m_layout.width != 0) { + LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(&m_sbml, m_layout.width); + } + if (m_layout.height != 0) { + LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(&m_sbml, m_layout.height); + } + //if (m_layout.depth != 0) { + // LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionDepth(m_layout.sbmllayout, m_layout.depth); + //} + if (m_layout.background != "") { + //The background name has already been validated when set. + LIBSBMLNETWORK_CPP_NAMESPACE::setBackgroundColor(&m_sbml, m_layout.background); + } + if (m_layout.align_bottom.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_bottom, "bottom"); + } + if (m_layout.align_center.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_center, "center"); + } + if (m_layout.align_circular.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_circular, "circular"); + } + if (m_layout.align_left.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_left, "left"); + } + if (m_layout.align_middle.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_middle, "middle"); + } + if (m_layout.align_right.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_right, "right"); + } + if (m_layout.align_top.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top"); + } + for (size_t v = 0; v < m_uniquevars.size(); v++) { + if (m_uniquevars[v]->TransferLayoutInformationTo(&m_sbml)) { + assert(false); + //return true; + } + } + if (m_autolayout.lockedNodeIds.size() > 0) { + vector lockedids; + for (auto node = m_autolayout.lockedNodeIds.begin(); node != m_autolayout.lockedNodeIds.end(); node++) { + lockedids.push_back(*node); + } + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, lockedids); + } } } diff --git a/src/module.cpp b/src/module.cpp index 48a49531..92dbb9ea 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -619,7 +619,7 @@ bool Module::AddConstraint(Variable* newcon, Formula* formula) bool Module::AddObjective(Formula* formula, bool maximize) { if (formula->IsSingleVariable()) { - const Variable* referenced = GetVariable(formula->GetVariables()[0]); + const Variable* referenced = GetVariable(formula->GetVariableStrings()[0]); if (referenced != NULL && (referenced->GetType()==varFormulaUndef || referenced->GetType()==varUndefined) ) { @@ -843,9 +843,11 @@ void Module::AddDefaultInitialValues() case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: case varAlgebraicRule: - break; + case varLayoutColorEtc: + break; } } } @@ -1227,11 +1229,50 @@ bool Module::Finalize() } } //Or if any variable has uncertainties - for (size_t var = 0; var < m_variables.size(); var++) { - if (m_variables[var]->GetNumUncertWrappers() > 0) { - m_usedDistributions = true; - } + if (!m_usedDistributions) { + for (size_t var = 0; var < m_variables.size(); var++) { + if (m_variables[var]->GetNumUncertWrappers() > 0) { + m_usedDistributions = true; + } + } } + //Or if any variable has layout information + // Also, check to make sure the variable is allowed to have layout/render info. + for (size_t var = 0; var < m_variables.size(); var++) { + if (m_variables[var]->GetNumLayoutWrappers() > 0) { + switch (m_variables[var]->GetType()) { + case varReactionUndef: + case varReactionGene: + case varInteraction: + case varSpeciesUndef: + case varDNA: + case varCompartment: + case varStrand: + // These are all allowed to have layout information. + break; + case varFormulaUndef: + case varFormulaOperator: + case varModule: + case varEvent: + case varUndefined: + case varUnitDefinition: + case varDeleted: + case varConstraint: + case varSboTermWrapper: + case varUncertWrapper: + case varLayoutWrapper: + case varStoichiometry: + case varAlgebraicRule: + case varLayoutColorEtc: + g_registry.SetError("Unable to add layout or render information to " + m_variables[var]->GetNameDelimitedBy(".") + ": only species, reactions, and compartments can be visualized, and this element is of type '" + VarTypeToString(m_variables[var]->GetType()) + "'."); + return true; + } + m_autolayout.use = true; + if (m_variables[var]->HasLayoutPositionInfo()) { + m_autolayout.lockedNodeIds.insert(m_variables[var]->GetNameDelimitedBy("_")); + } + } + } #endif @@ -1696,10 +1737,12 @@ bool Module::AreEquivalent(return_type rtype, var_type vtype) const case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: case varStoichiometry: case varAlgebraicRule: - break; + case varLayoutColorEtc: + break; } assert(false); //uncaught return type return false; @@ -2224,9 +2267,11 @@ string Module::GetAntimony(set& usedmods, bool funcsincluded, boo case varUnitDefinition: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: case varStoichiometry: case varAlgebraicRule: + case varLayoutColorEtc: break; } } @@ -2811,6 +2856,11 @@ void Module::setUsedDistrib(bool useddistrib) m_usedDistributions = useddistrib; } +void Module::fixLayoutPositionOf(const std::string& id) +{ + m_autolayout.lockedNodeIds.insert(id); +} + void Module::Convert(Variable* conv, Variable* cf, string modulename) { Module* origmod = g_registry.GetModule(m_modulename); @@ -2867,7 +2917,9 @@ void Module::Convert(Variable* conv, Variable* cf, string modulename) case varDeleted: case varSboTermWrapper: case varUncertWrapper: - break; + case varLayoutWrapper: + case varLayoutColorEtc: + break; } } } @@ -2908,7 +2960,8 @@ void Module::ConvertTime(Variable* tcf) case varDeleted: case varSboTermWrapper: case varUncertWrapper: - break; + case varLayoutWrapper: + break; } } } @@ -2940,9 +2993,11 @@ void Module::ConvertExtent(Variable* xcf) case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: case varStoichiometry: case varAlgebraicRule: + case varLayoutColorEtc: break; } } @@ -2982,7 +3037,8 @@ void Module::UndoTimeExtentConversions(Variable* tcf, Variable* xcf) case varDeleted: case varSboTermWrapper: case varUncertWrapper: - break; + case varLayoutWrapper: + break; } } } @@ -2999,20 +3055,25 @@ void Module::SetSBOTerm(int sboTerm) bool Module::SetAutoLayout(const string* isset) { - if (CaselessStrCmp(true, *isset, "yes") || + if (CaselessStrCmp(true, *isset, "on") || CaselessStrCmp(true, *isset, "true")) { m_autolayout.use = true; return false; } - else if (CaselessStrCmp(true, *isset, "no") || + else if (CaselessStrCmp(true, *isset, "off") || CaselessStrCmp(true, *isset, "false")) { m_autolayout.use = false; return false; } - g_registry.SetError("Unable to set autolayout to '" + *isset + "': the only valid options are 'true' or 'false' (or 'yes' or 'no')."); + g_registry.SetError("Unable to set autolayout to '" + *isset + "': the only valid options are 'true' or 'false' (or 'on' or 'off')."); return true; } +bool Module::SetAutoLayout(const std::string& isset) +{ + return SetAutoLayout(&isset); +} + bool Module::SetAutoLayout(const std::string* argument, const std::string* value) { string type = ValidateAutoLayoutArgument(argument); @@ -3028,16 +3089,16 @@ bool Module::SetAutoLayout(const std::string* argument, const std::string* value return true; } bool arg = true; - if (CaselessStrCmp(true, *value, "yes") || + if (CaselessStrCmp(true, *value, "on") || CaselessStrCmp(true, *value, "true")) { arg = true; } - else if (CaselessStrCmp(true, *value, "no") || + else if (CaselessStrCmp(true, *value, "off") || CaselessStrCmp(true, *value, "false")) { arg = false; } else { - g_registry.SetError("Unable to set autolayout." + *argument + " to '" + *value + "': the only valid options are 'true' or 'false' (or 'yes' or 'no')."); + g_registry.SetError("Unable to set autolayout." + *argument + " to '" + *value + "': the only valid options are 'true' or 'false' (or 'on' or 'off')."); return true; } if (CaselessStrCmp(true, *argument, "useMagnetism")) { @@ -3088,49 +3149,46 @@ bool Module::SetAutoLayout(const string* argument, const double& value) return false; } -bool Module::SetAutoLayout(const std::string* argument, const std::vector values) +bool Module::SetAutoLayout(const std::string* argument, const std::vector* values) { string type = ValidateAutoLayoutArgument(argument); + bool ret = true; if (type == "none") { - return true; + ret = true; } - if (type == "bool") { + else if (type == "bool") { g_registry.SetError("Unable to set autolayout." + *argument + " to a list of IDs: you must set it to 'true' or 'false'."); - return true; } - if (type == "double") { + else if (type == "double") { g_registry.SetError("Unable to set autolayout." + *argument + " to a list of IDs: you must set it to a number."); - return true; } - vector ids; - for (size_t i = 0; i < values.size(); i++) { - string id = values[i]->GetNameDelimitedBy(g_registry.GetCC()); - ids.push_back(id); + else { + set ids; + for (size_t i = 0; i < values->size(); i++) { + string id = (*values)[i]->GetNameDelimitedBy(g_registry.GetCC()); + ids.insert(id); + } + m_autolayout.lockedNodeIds = ids; + ret = false; } - m_autolayout.lockedNodeIds = ids; - return false; + delete values; + return ret; } -bool Module::SetAutoLayout(const std::string* argument, const std::vector values) +bool Module::SetAutoLayout(const std::string* argument, const std::vector* values) { string type = ValidateAutoLayoutArgument(argument); - if (type == "none") { - return true; - } if (type == "bool") { g_registry.SetError("Unable to set autolayout." + *argument + " to a list of numbers: you must set it to 'true' or 'false'."); - return true; } - if (type == "double") { + else if (type == "double") { g_registry.SetError("Unable to set autolayout." + *argument + " to a list of numbers: you must set it to a number."); - return true; } - if (type == "idlist") { + else if (type == "idlist") { g_registry.SetError("Unable to set autolayout." + *argument + " to a list of numbers: you must set it to a list of IDs."); - return true; } - assert(false); + delete values; return true; } @@ -3184,7 +3242,7 @@ bool Module::SetLayout(const std::string* argument, const std::string* value) return true; } bool arg = true; - if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidBackgroundColorValue(*value)) { + if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(*value)) { g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': that's not a valid color. Try something like 'red' or 'blue' or a hex color of the form '#FF0000'."); return true; } @@ -3221,17 +3279,17 @@ bool Module::SetLayout(const string* argument, const double& value) m_layout.width = value; } else if (CaselessStrCmp(true, *argument, "depth")) { - m_layout.depth = value; + //m_layout.depth = value; + g_registry.SetError("Unable to set layout." + *argument + " to '" + val.str() + "': Antimony does not currently support 3D layouts."); + return true; } return false; } -bool Module::SetLayout(const std::string* argument, const std::vector values) +bool Module::SetLayout(const std::string* argument, const std::vector* values) { string type = ValidateLayoutArgument(argument); - if (type == "none") { - return true; - } + bool ret = true; if (type == "color") { g_registry.SetError("Unable to set layout." + *argument + " to a list of IDs: you must set it to a color."); return true; @@ -3244,64 +3302,71 @@ bool Module::SetLayout(const std::string* argument, const std::vector g_registry.SetError("Unable to set layout." + *argument + " to a list of IDs: you must set it to a list of numbers in brackets (i.e. '[500, 800]')."); return true; } - vector ids; - for (size_t i = 0; i < values.size(); i++) { - string id = values[i]->GetNameDelimitedBy(g_registry.GetCC()); - ids.push_back(id); - } - if (CaselessStrCmp(true, *argument, "align_top")) { - m_layout.align_top = ids; - } - else if (CaselessStrCmp(true, *argument, "align_center")) { - m_layout.align_center = ids; - } - else if (CaselessStrCmp(true, *argument, "align_bottom")) { - m_layout.align_bottom = ids; - } - else if (CaselessStrCmp(true, *argument, "align_left")) { - m_layout.align_left = ids; - } - else if (CaselessStrCmp(true, *argument, "align_middle")) { - m_layout.align_middle = ids; - } - else if (CaselessStrCmp(true, *argument, "align_right")) { - m_layout.align_right = ids; - } - else if (CaselessStrCmp(true, *argument, "align_circular")) { - m_layout.align_circular = ids; + else if (type == "idlist") { + vector ids; + for (size_t i = 0; i < values->size(); i++) { + string id = (*values)[i]->GetNameDelimitedBy(g_registry.GetCC()); + ids.push_back(id); + m_autolayout.lockedNodeIds.insert(id); + } + if (CaselessStrCmp(true, *argument, "align_top")) { + m_layout.align_top = ids; + } + else if (CaselessStrCmp(true, *argument, "align_center")) { + m_layout.align_center = ids; + } + else if (CaselessStrCmp(true, *argument, "align_bottom")) { + m_layout.align_bottom = ids; + } + else if (CaselessStrCmp(true, *argument, "align_left")) { + m_layout.align_left = ids; + } + else if (CaselessStrCmp(true, *argument, "align_middle")) { + m_layout.align_middle = ids; + } + else if (CaselessStrCmp(true, *argument, "align_right")) { + m_layout.align_right = ids; + } + else if (CaselessStrCmp(true, *argument, "align_circular")) { + m_layout.align_circular = ids; + } + ret = false; } - return false; + delete values; + return ret; } -bool Module::SetLayout(const std::string* argument, const std::vector values) +bool Module::SetLayout(const std::string* argument, const std::vector* values) { string type = ValidateLayoutArgument(argument); - if (type == "none") { - return true; - } + bool ret = true; if (type == "color") { g_registry.SetError("Unable to set layout." + *argument + " to a list of numbers: you must set it to a color."); - return true; } - if (type == "double") { + else if (type == "double") { g_registry.SetError("Unable to set layout." + *argument + " to a list of numbers: you must set it to a number."); - return true; } - if (type == "idlist") { + else if (type == "idlist") { g_registry.SetError("Unable to set layout." + *argument + " to a list of numbers: you must set it to a list of IDs."); - return true; } - if (values.size() < 2 || values.size() > 3) { - g_registry.SetError("Unable to set layout." + *argument + ": the list must contain exactly two or three entries, for height/width, or height/width/depth."); - return true; - } - m_layout.height = values[0]; - m_layout.width = values[1]; - if (values.size() == 3) { - m_layout.depth = values[2]; + else if (type == "numlist") { + if (values->size() < 2 || values->size() > 3) { + //g_registry.SetError("Unable to set layout." + *argument + ": the list must contain exactly two or three entries, for height/width, or height/width/depth."); + g_registry.SetError("Unable to set layout." + *argument + ": the list must contain exactly two entries, for height/width."); + } + else { + m_layout.height = (*values)[0]; + m_layout.width = (*values)[1]; + if (values->size() == 3) { + //m_layout.depth = (*values)[2]; + g_registry.SetError("Unable to set layout." + *argument + ": Antimony does not currently support 3D layouts."); + } + ret = false; + } } - return true; + delete values; + return ret; } diff --git a/src/module.h b/src/module.h index cd9ab9cc..dfd452c5 100644 --- a/src/module.h +++ b/src/module.h @@ -8,6 +8,7 @@ #ifndef NSBML #include +#include #endif #ifdef USE_COMP @@ -36,7 +37,7 @@ struct autolayout { bool useBoundary = false; bool useGrid = false; bool useNameAsTextLabel = true; - std::vector lockedNodeIds = std::vector(); + std::set lockedNodeIds = std::set(); }; struct layout { @@ -49,7 +50,7 @@ struct layout { std::vector align_circular = std::vector(); double height = 0.0; double width = 0.0; - double depth = 0.0; + //double depth = 0.0; std::string background = ""; }; @@ -189,15 +190,16 @@ class Module : public Annotated virtual void SetSBOTerm(int sboTerm); virtual bool SetAutoLayout(const std::string* isset); + virtual bool SetAutoLayout(const std::string& isset); virtual bool SetAutoLayout(const std::string* argument, const std::string* value); virtual bool SetAutoLayout(const std::string* argument, const double& value); - virtual bool SetAutoLayout(const std::string* argument, const std::vector values); - virtual bool SetAutoLayout(const std::string* argument, const std::vector values); + virtual bool SetAutoLayout(const std::string* argument, const std::vector* values); + virtual bool SetAutoLayout(const std::string* argument, const std::vector* values); virtual bool SetLayout(const std::string* argument, const std::string* value); virtual bool SetLayout(const std::string* argument, const double& value); - virtual bool SetLayout(const std::string* argument, const std::vector values); - virtual bool SetLayout(const std::string* argument, const std::vector values); + virtual bool SetLayout(const std::string* argument, const std::vector* values); + virtual bool SetLayout(const std::string* argument, const std::vector* values); //Output for the API @@ -237,6 +239,8 @@ class Module : public Annotated void setUsedDistrib(bool useddistrib); + void fixLayoutPositionOf(const std::string& id); + #ifndef NCELLML //Reading: void LoadCellMLModel(iface::cellml_api::Model* model, diff --git a/src/typex.cpp b/src/typex.cpp index 7d731a30..c6c96f98 100644 --- a/src/typex.cpp +++ b/src/typex.cpp @@ -30,8 +30,10 @@ bool IsReaction(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varStoichiometry: case varAlgebraicRule: + case varLayoutColorEtc: return false; } assert(false); //uncaught vtype @@ -74,8 +76,10 @@ bool IsSpecies(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varStoichiometry: case varAlgebraicRule: + case varLayoutColorEtc: return false; } assert(false); //uncaught vtype @@ -103,8 +107,10 @@ bool IsDNA(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varStoichiometry: case varAlgebraicRule: + case varLayoutColorEtc: return false; } assert(false); //uncaught vtype @@ -121,6 +127,7 @@ bool CanHaveRateRule(const var_type vtype) case varCompartment: case varUndefined: case varStoichiometry: + case varLayoutColorEtc: return true; case varReactionUndef: case varReactionGene: @@ -133,6 +140,7 @@ bool CanHaveRateRule(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varAlgebraicRule: return false; } @@ -153,6 +161,7 @@ bool CanHaveAssignmentRule(const var_type vtype) case varReactionGene: case varInteraction: case varStoichiometry: + case varLayoutColorEtc: return true; case varModule: case varEvent: @@ -162,6 +171,7 @@ bool CanHaveAssignmentRule(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varAlgebraicRule: return false; } @@ -174,6 +184,7 @@ bool CanHaveAlgebraicRule(const var_type vtype) switch (vtype) { case varAlgebraicRule: case varUndefined: + case varLayoutColorEtc: return true; case varFormulaUndef: case varFormulaOperator: @@ -192,6 +203,7 @@ bool CanHaveAlgebraicRule(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: return false; } assert(false); //uncaught type @@ -209,7 +221,8 @@ bool CanBeInReaction(const var_type vtype) case varReactionUndef: case varReactionGene: case varInteraction: - return true; + case varLayoutColorEtc: + return true; case varCompartment: case varModule: case varEvent: @@ -219,6 +232,7 @@ bool CanBeInReaction(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varStoichiometry: case varAlgebraicRule: return false; @@ -234,6 +248,7 @@ bool CanBeStoichiometry(const var_type vtype) case varFormulaOperator: case varUndefined: case varStoichiometry: + case varLayoutColorEtc: return true; case varReactionUndef: case varReactionGene: @@ -249,6 +264,7 @@ bool CanBeStoichiometry(const var_type vtype) case varConstraint: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varAlgebraicRule: return false; } @@ -267,6 +283,7 @@ bool HasOrIsFormula(const var_type vtype) case varUnitDefinition: case varConstraint: case varStoichiometry: + case varLayoutColorEtc: return true; case varReactionGene: case varReactionUndef: @@ -278,6 +295,7 @@ bool HasOrIsFormula(const var_type vtype) case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varAlgebraicRule: //Again, not for Jarnac, which doesn't do algebraic rules. return false; } @@ -312,6 +330,32 @@ bool IsSpan(const uncert_type utype) return false; } +bool IsPair(const layout_type ltype) +{ + switch (ltype) { + case lt_x: + case lt_y: + case lt_height: + case lt_width: + case lt_color: + case lt_font: + case lt_fontsize: + case lt_fontcolor: + case lt_fontstyle: + case lt_fontweight: + case lt_linewidth: + case lt_linecolor: + case lt_shape: + case lt_unknown: + return false; + case lt_position: + case lt_size: + return true; + } + assert(false); + return false; +} + string RDToString(rd_type type) { switch(type) { @@ -362,10 +406,14 @@ string VarTypeToString(const var_type vtype) return "SBO Term"; case varUncertWrapper: return "Uncertainty parameter"; + case varLayoutWrapper: + return "Layout or render parameter"; case varStoichiometry: return "Stoichiometry"; case varAlgebraicRule: return "Algebraic Rule"; + case varLayoutColorEtc: + return "Color or shape name"; } assert(false); return ""; @@ -547,6 +595,123 @@ uncert_type UncertStringToType(const string& uncert) return unUnknown; } +string LayoutTypeToString(const layout_type ltype) +{ + switch (ltype) { + case lt_position: + return "position"; + case lt_x: + return "x"; + case lt_y: + return "y"; + case lt_size: + return "size"; + case lt_height: + return "height"; + case lt_width: + return "width"; + case lt_color: + return "color"; + case lt_font: + return "font"; + case lt_fontsize: + return "fontSize"; + case lt_fontcolor: + return "fontColor"; + case lt_fontstyle: + return "fontStyle"; + case lt_fontweight: + return "fontWeight"; + case lt_linewidth: + return "lineWidth"; + case lt_linecolor: + return "lineColor"; + case lt_shape: + return "shape"; + case lt_unknown: + return "unknown"; + } + assert(false); //uncaught type + return "uncaught type"; +} + +layout_type LayoutStringToType(const string& ltype) +{ + if (CaselessStrCmp(false, ltype, "position") || + CaselessStrCmp(false, ltype, "pos")) { + return lt_position; + } + if (CaselessStrCmp(false, ltype, "x")) { + return lt_x; + } + if (CaselessStrCmp(false, ltype, "y")) { + return lt_y; + } + if (CaselessStrCmp(false, ltype, "size")) { + return lt_size; + } + if (CaselessStrCmp(false, ltype, "height")) { + return lt_height; + } + if (CaselessStrCmp(false, ltype, "width")) { + return lt_width; + } + if (CaselessStrCmp(false, ltype, "color")) { + return lt_color; + } + if (CaselessStrCmp(false, ltype, "font")) { + return lt_font; + } + if (CaselessStrCmp(false, ltype, "fontsize")) { + return lt_fontsize; + } + if (CaselessStrCmp(false, ltype, "fontcolor")) { + return lt_fontcolor; + } + if (CaselessStrCmp(false, ltype, "fontweight")) { + return lt_fontweight; + } + if (CaselessStrCmp(false, ltype, "fontstyle")) { + return lt_fontstyle; + } + if (CaselessStrCmp(false, ltype, "linethickness")) { + return lt_linewidth; + } + if (CaselessStrCmp(false, ltype, "linewidth")) { + return lt_linewidth; + } + if (CaselessStrCmp(false, ltype, "strokewidth")) { + return lt_linewidth; + } + if (CaselessStrCmp(false, ltype, "borderwidth")) { + return lt_linewidth; + } + if (CaselessStrCmp(false, ltype, "linecolor")) { + return lt_linecolor; + } + if (CaselessStrCmp(false, ltype, "shape")) { + return lt_shape; + } + return lt_unknown; +} + +bool isValidFontStyle(const std::string& ftype) +{ + if (CaselessStrCmp(false, ftype, "bold")) { + return true; + } + if (CaselessStrCmp(false, ftype, "italic")) { + return true; + } + if (CaselessStrCmp(false, ftype, "normal")) { + return true; + } + if (CaselessStrCmp(false, ftype, "bold_italic")) { + return true; + } + return false; +} + #ifdef LIBSBML_HAS_PACKAGE_DISTRIB UncertType_t UncertTypeToSBML(const uncert_type utype) { diff --git a/src/typex.h b/src/typex.h index e88b707a..623ecda4 100644 --- a/src/typex.h +++ b/src/typex.h @@ -18,6 +18,7 @@ bool CanBeInReaction(const var_type vtype); bool CanBeStoichiometry(const var_type vtype); bool HasOrIsFormula(const var_type vtype); bool IsSpan(const uncert_type utype); +bool IsPair(const layout_type ltype); std::string RDToString(rd_type type); std::string VarTypeToString(const var_type vtype); //std::string VarTypeToAntimony(const var_type vtype); @@ -25,6 +26,9 @@ std::string ReturnTypeToString(const return_type rtype); std::string FormulaTypeToString(const formula_type ftype); std::string UncertTypeToString(const uncert_type utype); uncert_type UncertStringToType(const std::string& uncert); +std::string LayoutTypeToString(const layout_type utype); +layout_type LayoutStringToType(const std::string& ltype); +bool isValidFontStyle(const std::string& ftype); #ifdef LIBSBML_HAS_PACKAGE_DISTRIB libsbml::UncertType_t UncertTypeToSBML(const uncert_type utype); uncert_type SBMLToUncertType(const libsbml::UncertType_t utype); diff --git a/src/uncertWrapper.h b/src/uncertWrapper.h index a4150ab8..e0ac7151 100644 --- a/src/uncertWrapper.h +++ b/src/uncertWrapper.h @@ -7,7 +7,7 @@ #endif class Variable; -// A proxy class returned by the parser for setting SBO terms +// A proxy class returned by the parser for setting Uncertainty terms class UncertWrapper : public Variable { protected: diff --git a/src/userfunction.cpp b/src/userfunction.cpp index 72413da0..14ca729f 100644 --- a/src/userfunction.cpp +++ b/src/userfunction.cpp @@ -30,7 +30,7 @@ bool UserFunction::SetFormula(const Formula& formula) #endif m_formula = formula; formstring = formula.ToDelimitedStringWithEllipses("."); - vector > formvars = formula.GetVariables(); + vector > formvars = formula.GetVariableStrings(); for (size_t fv=0; fvContainsVar(this)) { + if (m_type != varLayoutWrapper && formula->ContainsVar(this)) { g_registry.SetError("Loop detected: " + GetNameDelimitedBy(".") + "'s definition (" + formula->ToDelimitedStringWithEllipses(".") + ") either includes itself directly (i.e. 's5 = 6 + s5') or by proxy (i.e. 's5 = 8*d3' and 'd3 = 9*s5')."); return true; } - if (m_type != varUncertWrapper && formula->ContainsCurlyBrackets()) { - g_registry.SetError("Curly brackets detected in formula: '" + formula->ToDelimitedStringWithEllipses(".") + "': vectors are not supported in the current version of Antimony apart from their use in setting certain uncertainty parameters."); + if (m_type != varUncertWrapper && m_type != varLayoutWrapper && formula->ContainsCurlyBrackets()) { + g_registry.SetError("Curly brackets detected in formula: '" + formula->ToDelimitedStringWithEllipses(".") + "': vectors are not supported in the current version of Antimony apart from their use in setting certain uncertainty or layout parameters."); return true; } + + if (m_type != varLayoutWrapper && formula->SetWithLiteralStrings()) { + g_registry.SetError("Cannot set the value of " + GetNameDelimitedBy(".") + " to '" + formula->ToDelimitedStringWithEllipses(".") + "' because literal strings are not allowed in formulas for this variable."); + return true; + } bool isdeletion = false; Variable* submodel = NULL; if (!GetFormula()->IsEmpty() && formula->IsEmpty() && m_name.size()>1) { @@ -1040,12 +1086,14 @@ bool Variable::SetFormula(Formula* formula, bool isObjective) } break; case varUndefined: + case varLayoutColorEtc: m_type = varFormulaUndef; //and fall through to: case varFormulaUndef: case varCompartment: case varSpeciesUndef: case varUncertWrapper: + case varLayoutWrapper: case varStoichiometry: if (m_formulatype == formulaASSIGNMENT) { g_registry.SetError("Cannot set '" + GetNameDelimitedBy(".") + "' to have the initial value '" + formula->ToDelimitedStringWithEllipses(".") + "' because it already has an assignment rule, which applies at all times, including time=0."); @@ -1236,7 +1284,7 @@ bool Variable::SetAlgebraicRule(int val, Formula* formula) if (formula->MakeUnitVariablesUnits()) return true; //If nothing is set variable explicitly, set all default variables to non-const - vector > formvars = formula->GetVariables(); + vector > formvars = formula->GetVariableStrings(); Module* thismod = g_registry.GetModule(m_module); vector algvars; bool anyNonConst = false; @@ -1474,6 +1522,12 @@ bool Variable::SetIsConst(bool constant) return true; } break; + case varLayoutWrapper: + if (!constant) { + g_registry.SetError(error + ", as 'constantness' is undefined for layout and render parameters."); + return true; + } + break; case varConstraint: if (!constant) { g_registry.SetError(error + ", as 'constantness' is undefined for constraints."); @@ -1561,6 +1615,7 @@ bool Variable::SetSuperCompartment(Variable* var, var_type supertype) case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: case varStoichiometry: assert(false); // Those things don't have components @@ -1609,6 +1664,7 @@ void Variable::SetComponentCompartments(bool frommodule) case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: case varStoichiometry: return; //No components to set @@ -1822,6 +1878,7 @@ bool Variable::DeleteFromSubmodel(Variable* deletedvar) case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: //These types can't have rules to them. break; @@ -1932,7 +1989,7 @@ set, deletion_type> > Variable::ClearReferencesTo(Variable* //Set this variable to be a shell pointing to the clone, transferring any data we may already have. bool Variable::Synchronize(Variable* clone, const Variable* conversionFactor) { - if (clone->GetType() == varSboTermWrapper || clone->GetType() == varUncertWrapper) { + if (clone->GetType() == varSboTermWrapper || clone->GetType() == varUncertWrapper || clone->GetType() == varLayoutWrapper) { return clone->Synchronize(this, conversionFactor); //Which will give an error. } if (IsPointer()) { @@ -2133,6 +2190,24 @@ bool Variable::Synchronize(Variable* clone, const Variable* conversionFactor) } } + //Synchronize the layout parameters + for (size_t lw = 0; lw < m_layoutWrappers.size(); lw++) { + LayoutWrapper* wrapper = m_layoutWrappers[lw]; + layout_type wtype = wrapper->GetLayoutType(); + bool no_same = true; + for (size_t clw = 0; clw < clone->m_layoutWrappers.size(); clw++) { + if (clone->m_layoutWrappers[clw]->GetLayoutType() == wtype) { + no_same = false; + break; + } + } + if (no_same) { + //Move the pointer to the clone; clear the local pointer. + clone->m_layoutWrappers.push_back(wrapper); + m_layoutWrappers[lw] = NULL; + } + } + //We always synchronize the data above first, but where we store it can change based on which version is the top-level. if (clone->m_name.size() > 1 && m_name.size() == 1) { //When synchronizing a local variable to a submodule's variable, always have the local trump the submodule. @@ -2152,6 +2227,10 @@ bool Variable::IncludesSelf() if (IsPointer()) { return GetSameVariable()->IncludesSelf(); } + if (m_type == varLayoutWrapper) { + // It's fine to say that a species named 'red' has a color that's 'red'. + return false; + } Formula* form = GetFormula(); if (form != NULL) { if (form->ContainsVar(this)) { @@ -2275,7 +2354,19 @@ UncertWrapper * Variable::AddOrGetUncertWrapper(uncert_type type) return uncertWrapper; } -bool Variable::IsReplacedFormRxn() const +LayoutWrapper* Variable::AddOrGetLayoutWrapper(layout_type type) +{ + for (size_t uw = 0; uw < m_layoutWrappers.size(); uw++) { + if (m_layoutWrappers[uw]->GetLayoutType() == type) { + return m_layoutWrappers[uw]; + } + } + LayoutWrapper* layoutWrapper = new LayoutWrapper(this, type); + m_layoutWrappers.push_back(layoutWrapper); + return layoutWrapper; +} + +bool Variable::IsReplacedFormRxn() const { return m_replacedformrxn; } @@ -2314,6 +2405,15 @@ string Variable::CreateUncertParamsAntimonySyntax(const string & indent) const return retval; } +string Variable::CreateLayoutParamsAntimonySyntax(const string& indent) const +{ + string retval = ""; + for (size_t uw = 0; uw < m_layoutWrappers.size(); uw++) { + retval += m_layoutWrappers[uw]->CreateLayoutParamsAntimonySyntax(indent); + } + return retval; +} + bool Variable::AllowedInFormulas() const { switch (m_type) { @@ -2336,6 +2436,7 @@ bool Variable::AllowedInFormulas() const case varDeleted: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: case varConstraint: return false; @@ -2385,6 +2486,19 @@ bool Variable::TransferAnnotationTo(SBase * sbmlobj, string metaid) const return Annotated::TransferAnnotationTo(sbmlobj, metaid); } +bool Variable::TransferLayoutInformationTo(SBMLDocument* sbml) const +{ + if (IsPointer()) { + return GetSameVariable()->TransferLayoutInformationTo(sbml); + } + for (size_t uw = 0; uw < m_layoutWrappers.size(); uw++) { + if (m_layoutWrappers[uw]->TransferLayoutInformationTo(sbml)) { + return true; + } + } + return false; +} + void Variable::ReadAnnotationFrom(const SBase * sbmlobj) { Annotated::ReadAnnotationFrom(sbmlobj); @@ -2458,4 +2572,19 @@ size_t Variable::GetNumUncertWrappers() const return m_uncertWrappers.size(); } +size_t Variable::GetNumLayoutWrappers() const +{ + return m_layoutWrappers.size(); +} + +bool Variable::HasLayoutPositionInfo() const +{ + for (size_t l = 0; l < m_layoutWrappers.size(); l++) { + if (m_layoutWrappers[l]->HasLayoutPositionInfo()) { + return true; + } + } + return false; +} + #endif diff --git a/src/variable.h b/src/variable.h index 8d26f110..1dd00dcc 100644 --- a/src/variable.h +++ b/src/variable.h @@ -25,6 +25,7 @@ class Module; class UnitDef; class SboTermWrapper; class UncertWrapper; +class LayoutWrapper; class Variable : public Annotated { @@ -66,6 +67,7 @@ class Variable : public Annotated // Subclass which is used as a wrapper for setting SBO terms SboTermWrapper* m_sboTermWrapper; std::vector m_uncertWrappers; + std::vector m_layoutWrappers; //If we've set the compartment we're in, this tells us where we are. std::vector m_compartment; std::vector m_supercompartment; @@ -199,8 +201,11 @@ class Variable : public Annotated //bool Synchronize(Variable* clone, SBase* foo); void SetWithRule(const libsbml::Rule* rule); virtual bool TransferAnnotationTo(libsbml::SBase* sbmlobj, std::string metaid) const; + virtual bool TransferLayoutInformationTo(libsbml::SBMLDocument* sbml) const; void ReadAnnotationFrom(const libsbml::SBase* sbmlobj); virtual size_t GetNumUncertWrappers() const; + virtual size_t GetNumLayoutWrappers() const; + virtual bool HasLayoutPositionInfo() const; #endif bool IncludesSelf(); @@ -213,10 +218,12 @@ class Variable : public Annotated const Variable* GetOriginal() const; Variable* GetParentVariable(); UncertWrapper* AddOrGetUncertWrapper(uncert_type type); + LayoutWrapper* AddOrGetLayoutWrapper(layout_type type); bool IsReplacedFormRxn() const; virtual std::string CreateSBOTermsAntimonySyntax(const std::string& elt_id, const std::string& indent, std::string sboStr) const; virtual std::string CreateUncertParamsAntimonySyntax(const std::string& indent) const; + virtual std::string CreateLayoutParamsAntimonySyntax(const std::string& indent) const; bool AllowedInFormulas() const; From 7e70b52a78b884ddd18f056451b45fe777d2c1c6 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Wed, 17 Jul 2024 16:00:43 -0700 Subject: [PATCH 04/43] Add generic species/compartment/reaction layout info. --- src/antimony.tab.cpp | 1791 +++++++++++++++++++++-------------------- src/antimony.ypp | 3 + src/layoutWrapper.cpp | 235 ++++++ src/layoutWrapper.h | 2 + src/module-sbml.cpp | 9 + src/module.cpp | 69 ++ src/module.h | 8 + 7 files changed, 1242 insertions(+), 875 deletions(-) diff --git a/src/antimony.tab.cpp b/src/antimony.tab.cpp index ef5c21ad..7e4ec003 100644 --- a/src/antimony.tab.cpp +++ b/src/antimony.tab.cpp @@ -721,16 +721,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1269 +#define YYLAST 1365 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 69 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 73 /* YYNRULES -- Number of rules. */ -#define YYNRULES 261 +#define YYNRULES 264 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 502 +#define YYNSTATES 514 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 300 @@ -801,16 +801,16 @@ static const yytype_int16 yyrline[] = 508, 512, 513, 516, 516, 517, 517, 521, 522, 523, 524, 525, 529, 530, 534, 538, 539, 540, 541, 542, 543, 544, 545, 548, 549, 550, 551, 552, 553, 554, - 555, 558, 559, 560, 561, 564, 565, 566, 567, 570, - 571, 572, 573, 576, 577, 578, 579, 582, 583, 584, - 585, 589, 590, 591, 592, 595, 596, 597, 600, 603, - 606, 607, 610, 611, 612, 613, 614, 617, 618, 621, - 621, 622, 622, 623, 623, 624, 624, 627, 628, 631, - 632, 639, 640, 641, 642, 643, 646, 647, 650, 665, - 666, 667, 668, 669, 670, 673, 676, 677, 680, 681, - 682, 684, 684, 687, 688, 693, 694, 695, 698, 709, - 719, 729, 739, 753, 767, 781, 797, 799, 803, 804, - 805, 806 + 555, 556, 559, 560, 561, 562, 565, 566, 567, 568, + 569, 572, 573, 574, 575, 578, 579, 580, 581, 584, + 585, 586, 587, 591, 592, 593, 594, 595, 598, 599, + 600, 603, 606, 609, 610, 613, 614, 615, 616, 617, + 620, 621, 624, 624, 625, 625, 626, 626, 627, 627, + 630, 631, 634, 635, 642, 643, 644, 645, 646, 649, + 650, 653, 668, 669, 670, 671, 672, 673, 676, 679, + 680, 683, 684, 685, 687, 687, 690, 691, 696, 697, + 698, 701, 712, 722, 732, 742, 756, 770, 784, 800, + 802, 806, 807, 808, 809 }; #endif @@ -865,7 +865,7 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-396) +#define YYPACT_NINF (-403) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) @@ -879,57 +879,58 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - -396, 542, -396, -396, 1, 271, -396, 39, 258, -396, - -396, -396, -396, -396, 271, 313, 195, 333, 271, 271, - 271, -396, 271, 235, 11, 271, -27, -396, -396, 226, - 232, 271, 271, 271, 221, 271, 1217, -396, -396, -396, - -396, -396, 665, 28, 87, -396, -396, 150, 292, 354, - -396, 150, 150, 150, 150, -4, 86, 96, 105, 151, - 183, 192, 200, 150, 150, -396, 271, 150, 161, 150, - 150, -396, -396, 150, -396, -396, -396, -396, -396, 313, - -396, -396, 19, -396, -396, -396, -396, -396, -396, 19, - -396, -396, -396, 705, 17, -396, 231, -396, -396, -396, - 98, 271, 271, 271, 271, 271, -396, 271, 222, -396, - 26, 271, 19, -396, -396, 283, 254, 256, -396, -396, - -396, -396, -396, 298, 71, 274, -396, 329, 337, 123, - -396, -396, -396, -396, -396, 271, -396, 69, 271, 271, - 271, 271, 271, 271, 271, 328, -396, 348, 113, -396, - 271, 19, 271, -396, 234, -396, 485, 331, -396, 332, - 400, 25, 271, 401, 7, -396, -396, -396, -396, 271, - 271, 271, 271, 271, 271, 271, 271, -396, -396, 249, - -396, 271, -396, -396, -396, 900, -396, -396, 900, 900, - 375, 900, 391, 398, -396, -396, -396, -396, -396, -396, - -396, -396, -396, -396, -396, -396, -396, 360, -396, -396, - 19, -396, -396, -396, -396, -396, 363, 369, 900, 900, - -396, -396, -396, -396, -396, -396, -396, 271, 249, 374, - -396, 163, 150, 381, 108, 422, 163, 150, 423, 405, - 173, 437, 407, 1173, 163, -396, -396, -396, -396, -396, - -396, -396, -396, -396, 271, -396, 447, 411, 19, 211, - 900, -396, -396, 321, 900, 177, -396, 415, -396, 306, - 292, 354, -396, -396, -396, 271, 401, -396, 14, -396, - -396, -396, -396, -396, -396, -396, -396, -396, -396, 19, - 900, 412, 442, -396, -396, 900, 900, 208, -396, 245, - 83, -396, 900, -396, -396, 900, -396, 463, -26, -396, - -396, 271, 465, 372, 170, -396, -396, -396, 19, 344, - 433, 1173, 475, 392, 181, 271, 313, 439, 351, 957, - -396, -396, -396, 900, -396, 207, 271, 271, -396, 770, - -396, 900, 196, 15, 900, 900, 19, 19, 835, -396, - 835, 254, -396, -396, -396, -396, -396, 492, -396, 74, - 900, 900, -396, -396, 464, 368, 19, 459, -396, -396, - -396, 150, 163, -396, 453, 271, 1011, 460, -396, -396, - -396, 150, 163, 385, 203, -396, -396, -396, -396, 411, - 19, 19, 900, -396, -396, 423, -396, 16, -396, 271, - -396, 835, -396, 411, 83, 900, 461, -396, 185, -396, - -396, 150, 271, 52, -396, -396, -13, -396, 19, 388, - -396, 135, -396, -396, 1173, 900, 83, 394, 835, -396, - 835, 19, -396, 74, -396, -396, 29, 900, 150, 19, - -396, -396, 481, 504, -396, 1173, -396, -396, 481, 1065, - -396, 74, -396, -396, 835, -396, -396, 900, 608, -396, - -396, 150, -396, 19, 259, 279, 466, 1119, 290, 314, - -396, 83, -396, -13, -396, 92, 128, 166, -396, 9, - -396, 499, -396, -396, -396, 74, -396, 271, -396, 271, - -396, 271, 19, -396, 508, -396, 19, -396, -396, -396, - 19, -396 + -403, 759, -403, -403, 133, 25, -403, 240, 285, -403, + -403, -403, -403, -403, 196, 360, 143, 326, 25, 25, + 25, -403, 25, 287, 275, 25, 74, -403, -403, 250, + 278, 25, 303, 409, 286, 25, 396, -403, -403, -403, + -403, -403, 352, 107, 174, -403, -403, 61, 497, 403, + -403, 61, 61, 61, 61, -8, 72, 101, 158, 182, + 185, 251, 289, 61, 61, -403, 25, 61, 147, 61, + 61, -403, -403, 61, -403, -403, -403, -403, -403, 360, + -403, -403, 44, -403, -403, -403, -403, -403, -403, 44, + -403, -403, -403, 886, 41, 111, -403, 321, -403, -403, + -403, 126, 25, 25, 25, 25, 25, -403, 25, 282, + -403, 122, 25, 44, -403, -403, 46, 315, 336, -403, + -403, -403, -403, -403, 376, 229, 344, -403, 388, 397, + 216, -403, -403, -403, 407, -403, 414, -403, 25, -403, + 1, 25, 25, 25, 25, 25, 25, 25, 390, -403, + 438, 232, -403, 25, 44, 25, -403, 104, -403, 493, + 399, -403, 410, 417, 47, 25, 460, 3, -403, -403, + -403, -403, 25, 25, 25, 25, 25, 25, 25, 25, + -403, -403, 284, -403, 25, -403, -403, -403, 1081, -403, + -403, 1081, 1081, 463, 1081, 478, 479, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + 435, -403, -403, 44, -403, -403, -403, 436, -403, -403, + 442, 447, 1081, 1081, -403, -403, -403, -403, -403, -403, + -403, 25, 284, 450, -403, 225, 61, 441, 7, 506, + 225, 61, 510, 468, 110, 514, 481, 1300, 225, 484, + 485, -403, -403, -403, -403, -403, -403, -403, -403, -403, + 25, -403, 529, 490, 44, 13, 1081, -403, -403, 357, + 1081, 37, -403, 494, -403, 437, 497, 403, -403, -403, + -403, 25, 460, -403, 5, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, 44, 1081, 489, 520, -403, + -403, 1081, 1081, 244, -403, 293, 217, -403, -403, 1081, + -403, -403, 1081, -403, 538, 209, -403, -403, 25, 537, + 297, 191, -403, -403, -403, 44, 261, 499, 1300, 539, + 324, 211, 25, 360, 501, 374, 173, -403, -403, -403, + -403, -403, 1081, -403, 235, 25, 25, -403, 951, -403, + 1081, 105, 15, 1081, 1081, 44, 44, 1016, -403, 1016, + 315, -403, -403, -403, -403, -403, 542, -403, 28, 1081, + 1081, 1081, -403, -403, 507, 380, 44, 503, -403, -403, + -403, 61, 225, -403, 517, 25, 1138, 505, -403, -403, + -403, 61, 225, 382, 241, -403, -403, -403, 1081, 1081, + -403, 490, 44, 44, 1081, -403, -403, 510, -403, 16, + -403, 25, -403, 1016, -403, 490, 217, 1081, 508, -403, + 125, -403, -403, 61, 25, 119, -403, -403, -3, -403, + 44, 394, -403, 234, -403, -403, 1300, 1081, 217, 433, + 1016, -403, 1016, 44, -403, 28, -403, -403, 201, 1081, + 61, 44, -403, -403, 518, 548, -403, 1300, -403, -403, + 518, 1192, -403, 28, -403, -403, 1016, -403, -403, 1081, + 821, -403, -403, 61, -403, 44, 299, 337, 509, 1246, + 411, 418, -403, 217, -403, -3, -403, 34, 65, 116, + -403, 12, -403, 530, -403, -403, -403, 28, -403, 25, + -403, 25, -403, 25, 44, -403, 555, -403, 44, -403, + -403, -403, 44, -403 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -939,80 +940,81 @@ static const yytype_int16 yydefact[] = { 2, 0, 1, 14, 0, 0, 131, 0, 37, 101, 96, 97, 99, 100, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 236, 237, 0, + 0, 15, 0, 0, 0, 0, 0, 239, 240, 0, 0, 0, 0, 0, 0, 0, 0, 130, 129, 3, 4, 6, 41, 79, 0, 13, 5, 0, 0, 0, 83, 0, 0, 0, 0, 155, 156, 157, 158, 159, - 160, 161, 162, 0, 0, 200, 206, 0, 0, 0, + 160, 161, 162, 0, 0, 203, 209, 0, 0, 0, 0, 101, 12, 0, 11, 7, 8, 9, 10, 0, 98, 37, 39, 127, 128, 125, 101, 124, 126, 91, - 101, 241, 101, 209, 41, 42, 43, 191, 101, 101, - 0, 0, 0, 0, 0, 0, 177, 0, 0, 196, - 202, 203, 226, 179, 171, 0, 0, 0, 27, 30, - 29, 183, 16, 0, 0, 0, 145, 0, 0, 19, - 26, 25, 187, 175, 163, 0, 167, 199, 0, 0, - 0, 0, 0, 0, 0, 0, 195, 0, 37, 207, - 0, 92, 0, 101, 0, 101, 0, 0, 70, 0, - 0, 0, 0, 90, 0, 71, 82, 72, 73, 0, - 0, 0, 0, 0, 0, 0, 0, 76, 74, 204, - 75, 0, 77, 80, 81, 235, 78, 101, 141, 229, - 243, 232, 0, 0, 118, 117, 119, 120, 123, 121, - 104, 101, 105, 102, 106, 114, 101, 0, 101, 122, - 103, 109, 110, 219, 101, 101, 0, 0, 231, 233, - 101, 193, 181, 173, 185, 189, 165, 0, 205, 0, - 238, 0, 0, 0, 0, 0, 0, 0, 147, 23, - 0, 0, 0, 0, 0, 166, 101, 192, 180, 172, - 184, 188, 176, 164, 0, 38, 0, 245, 40, 0, - 228, 140, 137, 134, 133, 0, 101, 0, 101, 90, - 0, 0, 201, 101, 101, 0, 93, 101, 0, 101, - 170, 174, 178, 182, 186, 190, 194, 197, 208, 227, - 230, 0, 0, 112, 113, 211, 115, 0, 111, 0, - 0, 47, 44, 101, 101, 234, 169, 0, 0, 261, - 257, 34, 0, 0, 0, 258, 256, 150, 148, 0, - 0, 0, 0, 0, 0, 34, 37, 0, 0, 0, - 51, 50, 54, 198, 168, 0, 0, 0, 101, 213, - 143, 138, 0, 0, 132, 139, 94, 95, 48, 101, - 48, 0, 242, 219, 107, 101, 108, 0, 217, 0, - 45, 46, 249, 239, 0, 0, 35, 0, 248, 250, - 251, 0, 0, 152, 0, 34, 0, 0, 57, 58, - 59, 0, 0, 0, 0, 20, 53, 52, 247, 246, - 136, 135, 142, 101, 219, 147, 101, 0, 101, 0, - 86, 48, 88, 244, 0, 116, 0, 218, 0, 210, - 240, 101, 0, 0, 260, 259, 48, 151, 149, 0, - 24, 0, 56, 55, 0, 215, 0, 0, 48, 101, - 48, 49, 85, 0, 101, 101, 0, 31, 101, 36, - 252, 253, 0, 0, 146, 0, 60, 61, 0, 0, - 219, 0, 152, 87, 48, 89, 212, 220, 221, 28, - 33, 32, 67, 64, 0, 0, 0, 0, 0, 0, - 18, 0, 214, 48, 84, 0, 0, 0, 254, 0, - 255, 0, 22, 62, 63, 0, 144, 0, 224, 0, - 222, 0, 65, 68, 0, 154, 153, 216, 225, 223, - 66, 69 + 101, 244, 101, 212, 0, 41, 42, 43, 193, 101, + 101, 0, 0, 0, 0, 0, 0, 178, 0, 0, + 199, 205, 206, 229, 181, 172, 0, 0, 0, 27, + 30, 29, 185, 16, 0, 0, 0, 145, 0, 0, + 19, 26, 25, 189, 0, 176, 0, 163, 0, 167, + 202, 0, 0, 0, 0, 0, 0, 0, 0, 198, + 0, 37, 210, 0, 92, 0, 101, 0, 101, 0, + 0, 70, 0, 0, 0, 0, 90, 0, 71, 82, + 72, 73, 0, 0, 0, 0, 0, 0, 0, 0, + 76, 74, 207, 75, 0, 77, 80, 81, 238, 78, + 101, 141, 232, 246, 235, 0, 0, 118, 117, 119, + 120, 123, 121, 104, 101, 105, 102, 106, 114, 101, + 0, 101, 122, 103, 109, 110, 222, 0, 101, 101, + 0, 0, 234, 236, 101, 195, 183, 174, 187, 191, + 165, 0, 208, 0, 241, 0, 0, 0, 0, 0, + 0, 0, 147, 23, 0, 0, 0, 0, 0, 0, + 0, 166, 101, 194, 182, 173, 186, 190, 177, 164, + 0, 38, 0, 248, 40, 0, 231, 140, 137, 134, + 133, 0, 101, 0, 101, 90, 0, 0, 204, 101, + 101, 0, 93, 101, 0, 101, 170, 175, 179, 184, + 188, 192, 196, 200, 211, 230, 233, 0, 0, 112, + 113, 214, 115, 0, 111, 0, 0, 101, 47, 44, + 101, 101, 237, 169, 0, 0, 264, 260, 34, 0, + 0, 0, 261, 259, 150, 148, 0, 0, 0, 0, + 0, 0, 34, 37, 0, 0, 0, 51, 50, 54, + 101, 101, 201, 168, 0, 0, 0, 101, 216, 143, + 138, 0, 0, 132, 139, 94, 95, 48, 101, 48, + 0, 245, 222, 107, 101, 108, 0, 220, 0, 197, + 45, 46, 252, 242, 0, 0, 35, 0, 251, 253, + 254, 0, 0, 152, 0, 34, 0, 0, 57, 58, + 59, 0, 0, 0, 0, 20, 53, 52, 180, 171, + 250, 249, 136, 135, 142, 101, 222, 147, 101, 0, + 101, 0, 86, 48, 88, 247, 0, 116, 0, 221, + 0, 213, 243, 101, 0, 0, 263, 262, 48, 151, + 149, 0, 24, 0, 56, 55, 0, 218, 0, 0, + 48, 101, 48, 49, 85, 0, 101, 101, 0, 31, + 101, 36, 255, 256, 0, 0, 146, 0, 60, 61, + 0, 0, 222, 0, 152, 87, 48, 89, 215, 223, + 224, 28, 33, 32, 67, 64, 0, 0, 0, 0, + 0, 0, 18, 0, 217, 48, 84, 0, 0, 0, + 257, 0, 258, 0, 22, 62, 63, 0, 144, 0, + 227, 0, 225, 0, 65, 68, 0, 154, 153, 219, + 228, 226, 66, 69 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -396, -396, -396, -396, -396, -396, -396, -396, -396, -396, - 88, -300, -1, 10, 34, 30, -331, -316, 0, 76, - 80, 32, -396, -36, -41, 307, 325, -396, -5, 49, - -396, -396, -396, -396, -396, 134, 82, -396, -396, -396, - -396, -396, -396, -396, -396, -396, -396, -396, 379, 518, - -396, -396, -396, -396, -396, -395, -345, -294, -396, 323, - -396, -396, 382, -104, -396, -396, -396, -396, -396, -396, - -396, -396, -396 + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + 121, -294, -1, 0, 6, 541, -334, -326, 4, 118, + 120, 10, -403, -46, -40, 317, 365, -403, 21, 20, + -403, -403, -403, -403, -403, 172, 117, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, 423, 565, + -403, -403, -403, -403, -403, -369, -353, -402, -403, 366, + -403, -403, 426, -73, -403, -403, -403, -403, -403, -403, + -403, -403, -403 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 1, 39, 40, 242, 243, 320, 321, 41, 233, - 436, 365, 94, 95, 96, 97, 400, 329, 330, 464, - 465, 331, 47, 48, 49, 260, 297, 211, 212, 50, - 51, 52, 53, 395, 238, 319, 416, 54, 55, 56, + 0, 1, 39, 40, 246, 247, 327, 328, 41, 237, + 448, 375, 213, 96, 97, 98, 412, 336, 337, 476, + 477, 338, 47, 48, 49, 266, 303, 214, 215, 50, + 51, 52, 53, 407, 242, 326, 428, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 213, 353, 394, 450, 359, 300, 409, 68, 261, - 69, 70, 71, 244, 72, 190, 292, 73, 74, 75, + 67, 216, 362, 406, 462, 368, 306, 421, 68, 267, + 69, 70, 71, 248, 72, 193, 298, 73, 74, 75, 76, 77, 78 }; @@ -1021,264 +1023,284 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 42, 45, 90, 92, 82, 376, 89, 161, 404, 433, - 98, 43, 231, 164, 160, 100, 79, 110, 112, 402, - 236, 160, 160, 160, 493, 383, 122, 363, 118, 399, - 147, 451, 147, 46, 137, 44, -42, 5, 364, 147, - 162, 151, 81, 6, 257, 443, 119, 109, 163, 426, - 113, 5, 114, 149, 169, 121, 81, 80, 120, 150, - 459, 132, 133, 134, 136, 179, 146, 440, -42, 441, - 432, -42, 279, 494, 187, 419, 485, 83, 84, 349, - 398, 429, 147, 85, 235, 444, 5, -42, -42, -42, - 277, 81, 210, 37, 38, 152, 158, 453, 86, 455, - 165, 166, 167, 168, 5, 471, 87, 88, 449, 81, - 228, 147, 177, 178, 442, 271, 180, 182, 183, 184, - 270, 312, 186, 474, 230, 278, 256, 153, 246, 467, - 154, 221, 222, 223, 224, 225, 241, 226, 407, 456, - 5, 357, 486, 358, 170, 81, 155, 156, 157, 258, - 446, 259, 447, 263, 171, 269, 487, 472, 220, 276, - 163, 89, 151, 172, 6, 245, 230, 313, 247, 248, - 249, 250, 251, 252, 253, 6, 230, 6, 5, -17, - 289, 488, 490, 81, 210, 371, 322, 210, 210, 5, - 210, 497, 489, 498, 81, 499, 381, 448, 147, 280, - 281, 282, 283, 284, 285, 286, 287, 5, 5, 173, - 372, 162, 81, 81, 37, 38, 241, 210, 210, 181, - 382, 308, 388, 230, 147, 37, 38, 37, 38, 342, - 491, 389, 323, 5, 230, 343, 338, 318, 81, 123, - 127, 174, 42, 124, 435, 128, 5, 403, 115, 129, - 175, 81, 116, 43, 336, 99, 230, 306, 176, 210, - 230, 396, 147, 210, 89, 354, 355, 130, 151, 125, - 163, 214, 135, 227, 346, 347, 288, 44, 117, 131, - 309, 310, 126, 5, 334, 315, 316, 262, 81, 210, - 215, 216, 217, 332, 210, 210, 83, 84, 159, 160, - 229, 210, 85, 355, 210, 91, 397, 230, 356, 232, - 366, 10, 11, 12, 13, 234, 93, 477, 5, 147, - 42, 92, 478, 81, 366, 87, 88, 237, 42, 386, - 337, 43, 210, 149, 147, 390, 391, 479, 210, 43, - 210, 163, 480, 210, 210, 5, 239, 210, 477, 210, - 81, 83, 84, 483, 240, 44, 101, 85, 408, 210, - 210, 387, 102, 44, 128, 255, 5, 103, 384, 162, - 104, 81, 479, 418, 366, 42, 386, 484, 185, 254, - 87, 88, 105, 106, 107, 108, 43, 368, 80, 369, - 274, 210, 291, 188, 318, 293, 370, 189, 431, 191, - 210, 373, 374, 294, 210, 218, 219, 378, 387, 379, - 44, 439, 5, 5, 147, 275, 380, 81, 81, 298, - 414, 415, 303, 42, 210, 411, 412, 210, 304, 210, - 422, 423, 408, 307, 43, 5, 210, 311, 317, 314, - 81, 463, 424, 412, 42, 445, 412, 463, 42, 386, - 408, 452, 374, 210, 324, 43, 210, 210, 44, 43, - 438, -21, 264, 325, 335, 5, 42, 386, 417, 308, - 81, 340, 351, 352, 408, 408, 492, 43, 362, 44, - 496, 387, 367, 44, 408, 460, 408, 438, 408, 375, - 500, 159, 377, 5, 290, 126, 462, 5, 81, 387, - 265, 44, 81, 266, 10, 11, 12, 13, 295, 406, - 460, 5, 18, 296, 495, 296, 81, 410, 413, 421, - 434, 466, 302, 501, 468, 481, 461, 305, 469, 427, - 27, 28, 267, 299, 473, 272, 111, 301, 273, 0, - 0, 0, 2, 3, 268, 0, 0, 0, 4, 0, - 0, 0, 0, 333, 5, 0, 6, 7, 0, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 0, 339, 21, 341, 22, 23, 24, 25, - 344, 345, 0, 26, 348, 0, 350, 27, 28, 29, - 30, 31, 32, 33, 34, 0, 35, 36, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 38, 0, 0, - 360, 361, 192, 193, 194, 195, 196, 197, 198, 199, - 5, 0, 0, 200, 0, 81, 0, 0, 0, 0, - 0, 0, 202, 0, 0, 0, 0, 0, 203, 0, - 0, 0, 0, 204, 0, 392, 83, 84, 0, 0, - 0, 0, 85, 0, 0, 0, 401, 0, 0, 0, - 0, 205, 405, 0, 206, 0, 475, 207, 476, 0, - 208, -90, -90, 0, 209, 87, 88, 5, 147, 0, - 0, 0, 148, 0, -90, -90, -90, -90, 0, 0, - 0, 0, 149, 0, 0, 0, 0, 0, 0, 0, - 425, 0, 0, 428, 0, 430, 0, 150, 0, 192, - 193, 194, 195, 196, 197, 198, 199, 5, 437, 0, - 200, 201, 81, 0, 0, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 203, 454, 0, 0, 0, - 204, 457, 458, 83, 84, 437, 0, 0, 0, 85, - 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, - 0, 206, 0, 0, 207, 0, 0, 208, 0, 0, - 0, 209, 87, 88, 192, 193, 194, 195, 196, 197, - 198, 199, 5, 0, 0, 200, 393, 81, 0, 0, - 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, - 203, 0, 0, 0, 0, 204, 0, 0, 83, 84, - 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, - 0, 0, 0, 205, 0, 0, 206, 0, 0, 207, - 0, 0, 208, 0, 0, 0, 209, 87, 88, 192, - 193, 194, 195, 196, 197, 198, 199, 5, 0, 0, - 200, 0, 81, 0, 0, 0, 0, 0, 0, 202, - 0, 0, 0, 0, 0, 203, 0, 0, 0, 0, - 204, 0, 0, 83, 84, 0, 0, 399, 0, 85, - 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, - 0, 206, 0, 0, 207, 0, 0, 208, 0, 0, - 0, 209, 87, 88, 192, 193, 194, 195, 196, 197, - 198, 199, 5, 0, 0, 200, 0, 81, 0, 0, - 0, 0, 0, 0, 202, 0, 0, 0, 0, 0, - 203, 0, 0, 0, 0, 204, 0, 0, 83, 84, - 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, - 0, 0, 0, 205, 0, 0, 206, 0, 0, 207, - 0, 0, 208, 4, 0, 0, 209, 87, 88, 5, - 0, 6, 7, 0, 326, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 0, 385, 0, - 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, - 0, 0, 27, 28, 327, 328, 31, 32, 33, 34, - 0, 35, 36, 0, 0, 0, 0, 4, 0, 0, - 0, 37, 38, 5, 0, 6, 7, 0, 326, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 0, 420, 0, 0, 22, 0, 0, 25, 0, - 0, 0, 0, 0, 0, 0, 27, 28, 327, 328, - 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, - 0, 4, 0, 0, 0, 37, 38, 5, 0, 6, - 7, 0, 326, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 0, 470, 0, 0, 22, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, - 27, 28, 327, 328, 31, 32, 33, 34, 0, 35, - 36, 0, 0, 0, 0, 4, 0, 0, 0, 37, - 38, 5, 0, 6, 7, 0, 326, 9, 10, 11, + 42, 43, 386, 167, 82, 45, 89, 44, 164, 416, + 163, 46, 163, 95, 150, 101, 95, 111, 113, 95, + 319, 95, 163, 163, 95, 414, 150, 505, 90, 92, + 95, 95, 95, 95, 140, 95, 99, 5, 393, 411, + 5, 154, 81, 468, 235, 81, 5, 445, 166, 5, + 172, 81, 240, 438, 81, 455, 345, 150, 217, 5, + 252, 484, 165, 233, 81, 182, 320, 161, 285, 463, + 358, 168, 169, 170, 171, 6, 506, 5, 263, 444, + 410, 441, 81, 180, 181, 500, 502, 183, 185, 186, + 187, 431, 419, 189, 456, 509, 347, 510, 499, 511, + 190, 95, 95, 95, 95, 95, 465, 95, 467, 483, + 461, 232, 283, 276, 497, -42, 5, 5, 284, 277, + 165, 81, 81, 329, 150, 37, 38, 123, 5, 501, + 173, 479, 486, 81, 452, 150, 453, 95, 150, 150, + 95, 95, 95, 95, 95, 95, 95, -42, 79, 152, + -42, 498, 264, 153, 265, 5, 269, 268, 275, 174, + 81, 6, 282, 166, 89, 154, -42, -42, -42, 330, + 408, 95, 95, 95, 95, 95, 95, 95, 95, 4, + 503, 454, 155, 295, 447, 5, 224, 6, 7, 80, + 333, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 100, 395, 184, 381, 22, 5, 94, + 25, 37, 38, 81, 156, 6, 175, 157, 27, 28, + 334, 335, 31, 32, 33, 34, 391, 35, 36, 245, + 95, 352, 471, 158, 159, 160, 351, 37, 38, 6, + 176, 325, 239, 177, 234, 262, 42, 43, 382, 458, + 400, 459, 5, 44, 245, 316, 317, 81, 392, 95, + 322, 323, 373, 124, 234, 37, 38, 125, 339, 234, + 89, 401, -17, 374, 154, 366, 166, 367, 83, 84, + 355, 356, 234, 315, 85, 234, 128, 415, 234, 37, + 38, 129, 119, 126, 234, 130, 460, 150, 5, 86, + 116, 363, 364, 81, 117, 409, 127, 87, 88, 178, + 120, 294, 378, 131, 379, 5, 134, 376, 383, 384, + 81, 380, 121, 83, 84, 132, 93, 42, 43, 85, + 118, 376, 91, 231, 44, 42, 43, 138, 5, 388, + 396, 389, 44, 81, 402, 403, 397, 179, 390, 102, + 166, 364, 87, 88, 92, 103, 365, 489, -90, -90, + 104, 218, 490, 105, 5, 150, 346, 420, 234, 151, + 150, -90, -90, -90, -90, 106, 107, 108, 109, 152, + 219, 220, 221, 430, 376, 42, 43, 129, 188, 236, + 396, 394, 44, 238, 153, 491, 397, 241, 83, 84, + 492, 426, 427, 191, 85, 243, 325, 192, 5, 194, + 443, 434, 435, 81, 244, 5, 222, 223, 165, 141, + 81, 5, 136, 451, 249, 142, 81, 87, 88, 5, + 143, 250, 281, 144, 81, 42, 43, 423, 424, 436, + 424, 260, 44, 450, 420, 145, 146, 147, 148, 5, + 150, 457, 424, 475, 81, 261, 42, 43, 280, 475, + 42, 43, 420, 44, 152, 396, 80, 44, 472, 489, + 450, 397, 5, 150, 495, 270, 491, 81, 42, 43, + 297, 496, 299, 396, 300, 44, 420, 420, 504, 397, + 464, 384, 508, 472, 304, 307, 420, 318, 420, 162, + 420, 310, 512, 162, 163, 5, 311, 296, 271, 314, + 81, 272, 10, 11, 12, 13, 10, 11, 12, 13, + 18, 301, 5, 321, -21, 324, 302, 81, 302, 5, + 5, 331, 429, 474, 81, 81, 309, 332, 27, 28, + 273, 312, 5, 340, 341, 507, 344, 81, 315, 360, + 349, 361, 274, 372, 377, 385, 387, 127, 110, 418, + 422, 114, 425, 115, 433, 478, 122, 446, 493, 342, + 513, 473, 133, 135, 137, 139, 305, 149, 480, 439, + 481, 485, 278, 112, 308, 279, 0, 0, 0, 348, + 0, 350, 0, 0, 0, 0, 353, 354, 0, 0, + 357, 0, 359, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 369, 0, 0, 370, 371, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 225, 226, 227, 228, 229, 0, 230, + 0, 0, 0, 0, 0, 0, 0, 398, 399, 0, + 0, 0, 0, 0, 404, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 413, 0, 0, 0, 251, + 0, 417, 253, 254, 255, 256, 257, 258, 259, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 286, 287, 288, 289, 290, 291, 292, + 293, 0, 437, 0, 0, 440, 0, 442, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 466, 2, + 3, 0, 0, 469, 470, 4, 0, 449, 0, 0, + 0, 5, 313, 6, 7, 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, - 482, 0, 0, 22, 0, 0, 25, 0, 0, 0, - 0, 0, 0, 0, 27, 28, 327, 328, 31, 32, - 33, 34, 0, 35, 36, 0, 0, 0, 0, 4, - 0, 0, 0, 37, 38, 5, 0, 6, 7, 0, - 326, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 0, 0, 0, 0, 22, 0, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, - 327, 328, 31, 32, 33, 34, 0, 35, 36, 5, - 0, 0, 0, 0, 81, 0, 0, 37, 38, 0, - 138, 0, 0, 0, 0, 0, 139, 0, 0, 0, - 0, 140, 0, 0, 141, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 142, 143, 144, 145 + 0, 21, 0, 22, 23, 24, 25, 0, 0, 0, + 26, 343, 0, 0, 27, 28, 29, 30, 31, 32, + 33, 34, 0, 35, 36, 0, 0, 0, 0, 0, + 0, 0, 0, 37, 38, 195, 196, 197, 198, 199, + 200, 201, 202, 5, 0, 0, 203, 0, 81, 0, + 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, + 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, + 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, + 0, 0, 0, 0, 208, 0, 0, 209, 0, 487, + 210, 488, 0, 211, 0, 0, 0, 212, 87, 88, + 195, 196, 197, 198, 199, 200, 201, 202, 5, 0, + 0, 203, 204, 81, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 0, 0, 206, 0, 0, 0, + 0, 207, 0, 0, 83, 84, 0, 0, 0, 0, + 85, 0, 0, 0, 0, 0, 0, 0, 0, 208, + 0, 0, 209, 0, 0, 210, 0, 0, 211, 0, + 0, 0, 212, 87, 88, 195, 196, 197, 198, 199, + 200, 201, 202, 5, 0, 0, 203, 405, 81, 0, + 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, + 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, + 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, + 0, 0, 0, 0, 208, 0, 0, 209, 0, 0, + 210, 0, 0, 211, 0, 0, 0, 212, 87, 88, + 195, 196, 197, 198, 199, 200, 201, 202, 5, 0, + 0, 203, 0, 81, 0, 0, 0, 0, 0, 0, + 205, 0, 0, 0, 0, 0, 206, 0, 0, 0, + 0, 207, 0, 0, 83, 84, 0, 0, 411, 0, + 85, 0, 0, 0, 0, 0, 0, 0, 0, 208, + 0, 0, 209, 0, 0, 210, 0, 0, 211, 0, + 0, 0, 212, 87, 88, 195, 196, 197, 198, 199, + 200, 201, 202, 5, 0, 0, 203, 0, 81, 0, + 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, + 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, + 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, + 0, 0, 0, 0, 208, 0, 0, 209, 0, 0, + 210, 0, 0, 211, 4, 0, 0, 212, 87, 88, + 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 0, 432, + 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, + 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, + 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, + 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 0, 482, 0, 0, 22, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, + 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, + 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, + 6, 7, 0, 333, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 0, 494, 0, 0, + 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, + 0, 27, 28, 334, 335, 31, 32, 33, 34, 0, + 35, 36, 0, 0, 0, 0, 4, 0, 0, 0, + 37, 38, 5, 0, 6, 7, 0, 333, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 0, 0, 0, 0, 22, 0, 0, 25, 0, 0, + 0, 0, 0, 0, 0, 27, 28, 334, 335, 31, + 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, + 0, 0, 0, 0, 37, 38 }; static const yytype_int16 yycheck[] = { - 1, 1, 7, 8, 5, 321, 7, 48, 353, 404, - 15, 1, 116, 49, 7, 16, 15, 18, 19, 350, - 124, 7, 7, 7, 15, 325, 53, 53, 17, 42, - 13, 426, 13, 1, 35, 1, 8, 12, 64, 13, - 15, 42, 17, 14, 148, 58, 35, 17, 49, 394, - 20, 12, 22, 27, 58, 25, 17, 56, 47, 42, - 31, 31, 32, 33, 34, 66, 36, 15, 40, 17, - 401, 43, 65, 64, 79, 375, 471, 38, 39, 65, - 65, 65, 13, 44, 13, 416, 12, 59, 60, 61, - 65, 17, 93, 64, 65, 8, 47, 428, 59, 430, - 51, 52, 53, 54, 12, 450, 67, 68, 424, 17, - 111, 13, 63, 64, 62, 156, 67, 68, 69, 70, - 156, 13, 73, 454, 53, 161, 13, 40, 59, 445, - 43, 101, 102, 103, 104, 105, 13, 107, 64, 433, - 12, 58, 473, 60, 58, 17, 59, 60, 61, 150, - 15, 152, 17, 154, 58, 156, 64, 451, 60, 160, - 161, 162, 163, 58, 14, 135, 53, 59, 138, 139, - 140, 141, 142, 143, 144, 14, 53, 14, 12, 56, - 181, 475, 476, 17, 185, 15, 13, 188, 189, 12, - 191, 485, 64, 487, 17, 489, 15, 62, 13, 169, - 170, 171, 172, 173, 174, 175, 176, 12, 12, 58, - 314, 15, 17, 17, 64, 65, 13, 218, 219, 58, - 324, 58, 15, 53, 13, 64, 65, 64, 65, 270, - 64, 335, 59, 12, 53, 271, 59, 238, 17, 13, - 8, 58, 243, 17, 59, 13, 12, 351, 13, 17, - 58, 17, 17, 243, 43, 60, 53, 227, 58, 260, - 53, 65, 13, 264, 265, 57, 58, 35, 269, 43, - 271, 40, 51, 51, 275, 276, 27, 243, 43, 47, - 231, 232, 56, 12, 254, 236, 237, 53, 17, 290, - 59, 60, 61, 244, 295, 296, 38, 39, 6, 7, - 17, 302, 44, 58, 305, 47, 342, 53, 63, 53, - 311, 19, 20, 21, 22, 17, 9, 58, 12, 13, - 321, 326, 63, 17, 325, 67, 68, 53, 329, 329, - 9, 321, 333, 27, 13, 336, 337, 58, 339, 329, - 341, 342, 63, 344, 345, 12, 17, 348, 58, 350, - 17, 38, 39, 63, 17, 321, 23, 44, 359, 360, - 361, 329, 29, 329, 13, 17, 12, 34, 17, 15, - 37, 17, 58, 374, 375, 376, 376, 63, 71, 51, - 67, 68, 49, 50, 51, 52, 376, 15, 56, 17, - 59, 392, 17, 86, 395, 4, 24, 90, 399, 92, - 401, 57, 58, 5, 405, 98, 99, 15, 376, 17, - 376, 412, 12, 12, 13, 15, 24, 17, 17, 59, - 371, 372, 59, 424, 425, 57, 58, 428, 59, 430, - 381, 382, 433, 59, 424, 12, 437, 56, 15, 17, - 17, 442, 57, 58, 445, 57, 58, 448, 449, 449, - 451, 57, 58, 454, 17, 445, 457, 458, 424, 449, - 411, 56, 155, 56, 17, 12, 467, 467, 15, 58, - 17, 56, 60, 31, 475, 476, 477, 467, 15, 445, - 481, 449, 17, 449, 485, 436, 487, 438, 489, 56, - 491, 6, 17, 12, 187, 56, 15, 12, 17, 467, - 15, 467, 17, 18, 19, 20, 21, 22, 201, 17, - 461, 12, 27, 206, 15, 208, 17, 53, 59, 59, - 59, 17, 215, 15, 448, 59, 438, 220, 448, 395, - 45, 46, 47, 208, 452, 156, 18, 214, 156, -1, - -1, -1, 0, 1, 59, -1, -1, -1, 6, -1, - -1, -1, -1, 246, 12, -1, 14, 15, -1, 17, + 1, 1, 328, 49, 5, 1, 7, 1, 48, 362, + 7, 1, 7, 14, 13, 16, 17, 18, 19, 20, + 13, 22, 7, 7, 25, 359, 13, 15, 7, 8, + 31, 32, 33, 34, 35, 36, 15, 12, 332, 42, + 12, 42, 17, 445, 117, 17, 12, 416, 49, 12, + 58, 17, 125, 406, 17, 58, 43, 13, 17, 12, + 59, 463, 15, 17, 17, 66, 59, 47, 65, 438, + 65, 51, 52, 53, 54, 14, 64, 12, 151, 413, + 65, 65, 17, 63, 64, 487, 488, 67, 68, 69, + 70, 385, 64, 73, 428, 497, 59, 499, 64, 501, + 79, 102, 103, 104, 105, 106, 440, 108, 442, 462, + 436, 112, 65, 159, 483, 8, 12, 12, 164, 159, + 15, 17, 17, 13, 13, 64, 65, 53, 12, 64, + 58, 457, 466, 17, 15, 13, 17, 138, 13, 13, + 141, 142, 143, 144, 145, 146, 147, 40, 15, 27, + 43, 485, 153, 42, 155, 12, 157, 53, 159, 58, + 17, 14, 163, 164, 165, 166, 59, 60, 61, 59, + 65, 172, 173, 174, 175, 176, 177, 178, 179, 6, + 64, 62, 8, 184, 59, 12, 60, 14, 15, 56, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 60, 31, 58, 15, 34, 12, 13, + 37, 64, 65, 17, 40, 14, 58, 43, 45, 46, + 47, 48, 49, 50, 51, 52, 15, 54, 55, 13, + 231, 277, 31, 59, 60, 61, 276, 64, 65, 14, + 58, 242, 13, 58, 53, 13, 247, 247, 321, 15, + 15, 17, 12, 247, 13, 235, 236, 17, 331, 260, + 240, 241, 53, 13, 53, 64, 65, 17, 248, 53, + 271, 344, 56, 64, 275, 58, 277, 60, 38, 39, + 281, 282, 53, 58, 44, 53, 8, 360, 53, 64, + 65, 13, 17, 43, 53, 17, 62, 13, 12, 59, + 13, 57, 58, 17, 17, 351, 56, 67, 68, 58, + 35, 27, 15, 35, 17, 12, 13, 318, 57, 58, + 17, 24, 47, 38, 39, 47, 9, 328, 328, 44, + 43, 332, 47, 51, 328, 336, 336, 51, 12, 15, + 336, 17, 336, 17, 345, 346, 336, 58, 24, 23, + 351, 58, 67, 68, 333, 29, 63, 58, 6, 7, + 34, 40, 63, 37, 12, 13, 9, 368, 53, 17, + 13, 19, 20, 21, 22, 49, 50, 51, 52, 27, + 59, 60, 61, 384, 385, 386, 386, 13, 71, 53, + 386, 17, 386, 17, 42, 58, 386, 53, 38, 39, + 63, 381, 382, 86, 44, 17, 407, 90, 12, 92, + 411, 391, 392, 17, 17, 12, 99, 100, 15, 23, + 17, 12, 13, 424, 17, 29, 17, 67, 68, 12, + 34, 17, 15, 37, 17, 436, 436, 57, 58, 57, + 58, 51, 436, 423, 445, 49, 50, 51, 52, 12, + 13, 57, 58, 454, 17, 17, 457, 457, 59, 460, + 461, 461, 463, 457, 27, 461, 56, 461, 448, 58, + 450, 461, 12, 13, 63, 158, 58, 17, 479, 479, + 17, 63, 4, 479, 5, 479, 487, 488, 489, 479, + 57, 58, 493, 473, 59, 59, 497, 56, 499, 6, + 501, 59, 503, 6, 7, 12, 59, 190, 15, 59, + 17, 18, 19, 20, 21, 22, 19, 20, 21, 22, + 27, 204, 12, 17, 56, 15, 209, 17, 211, 12, + 12, 17, 15, 15, 17, 17, 219, 56, 45, 46, + 47, 224, 12, 59, 59, 15, 17, 17, 58, 60, + 56, 31, 59, 15, 17, 56, 17, 56, 17, 17, + 53, 20, 59, 22, 59, 17, 25, 59, 59, 252, + 15, 450, 31, 32, 33, 34, 211, 36, 460, 407, + 460, 464, 159, 18, 218, 159, -1, -1, -1, 272, + -1, 274, -1, -1, -1, -1, 279, 280, -1, -1, + 283, -1, 285, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 307, -1, -1, 310, 311, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 102, 103, 104, 105, 106, -1, 108, + -1, -1, -1, -1, -1, -1, -1, 340, 341, -1, + -1, -1, -1, -1, 347, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 358, -1, -1, -1, 138, + -1, 364, 141, 142, 143, 144, 145, 146, 147, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 172, 173, 174, 175, 176, 177, 178, + 179, -1, 405, -1, -1, 408, -1, 410, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 423, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 441, 0, + 1, -1, -1, 446, 447, 6, -1, 450, -1, -1, + -1, 12, 231, 14, 15, -1, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, + -1, 32, -1, 34, 35, 36, 37, -1, -1, -1, + 41, 260, -1, -1, 45, 46, 47, 48, 49, 50, + 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, + -1, -1, -1, 64, 65, 4, 5, 6, 7, 8, + 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, + -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, + -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, + 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, + -1, -1, -1, -1, 53, -1, -1, 56, -1, 58, + 59, 60, -1, 62, -1, -1, -1, 66, 67, 68, + 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, + -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, + 24, -1, -1, -1, -1, -1, 30, -1, -1, -1, + -1, 35, -1, -1, 38, 39, -1, -1, -1, -1, + 44, -1, -1, -1, -1, -1, -1, -1, -1, 53, + -1, -1, 56, -1, -1, 59, -1, -1, 62, -1, + -1, -1, 66, 67, 68, 4, 5, 6, 7, 8, + 9, 10, 11, 12, -1, -1, 15, 16, 17, -1, + -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, + -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, + 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, + -1, -1, -1, -1, 53, -1, -1, 56, -1, -1, + 59, -1, -1, 62, -1, -1, -1, 66, 67, 68, + 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, + -1, 15, -1, 17, -1, -1, -1, -1, -1, -1, + 24, -1, -1, -1, -1, -1, 30, -1, -1, -1, + -1, 35, -1, -1, 38, 39, -1, -1, 42, -1, + 44, -1, -1, -1, -1, -1, -1, -1, -1, 53, + -1, -1, 56, -1, -1, 59, -1, -1, 62, -1, + -1, -1, 66, 67, 68, 4, 5, 6, 7, 8, + 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, + -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, + -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, + 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, + -1, -1, -1, -1, 53, -1, -1, 56, -1, -1, + 59, -1, -1, 62, 6, -1, -1, 66, 67, 68, + 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, + -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, + -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, + 52, -1, 54, 55, -1, -1, -1, -1, 6, -1, + -1, -1, 64, 65, 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 266, 32, 268, 34, 35, 36, 37, - 273, 274, -1, 41, 277, -1, 279, 45, 46, 47, + 28, 29, -1, 31, -1, -1, 34, -1, -1, 37, + -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, - -1, -1, -1, -1, -1, -1, 64, 65, -1, -1, - 303, 304, 4, 5, 6, 7, 8, 9, 10, 11, - 12, -1, -1, 15, -1, 17, -1, -1, -1, -1, - -1, -1, 24, -1, -1, -1, -1, -1, 30, -1, - -1, -1, -1, 35, -1, 338, 38, 39, -1, -1, - -1, -1, 44, -1, -1, -1, 349, -1, -1, -1, - -1, 53, 355, -1, 56, -1, 58, 59, 60, -1, - 62, 6, 7, -1, 66, 67, 68, 12, 13, -1, - -1, -1, 17, -1, 19, 20, 21, 22, -1, -1, - -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, - 393, -1, -1, 396, -1, 398, -1, 42, -1, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 411, -1, - 15, 16, 17, -1, -1, -1, -1, -1, -1, 24, - -1, -1, -1, -1, -1, 30, 429, -1, -1, -1, - 35, 434, 435, 38, 39, 438, -1, -1, -1, 44, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - -1, 56, -1, -1, 59, -1, -1, 62, -1, -1, - -1, 66, 67, 68, 4, 5, 6, 7, 8, 9, - 10, 11, 12, -1, -1, 15, 16, 17, -1, -1, - -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, - 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, - -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, - -1, -1, -1, 53, -1, -1, 56, -1, -1, 59, - -1, -1, 62, -1, -1, -1, 66, 67, 68, 4, - 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, - 15, -1, 17, -1, -1, -1, -1, -1, -1, 24, - -1, -1, -1, -1, -1, 30, -1, -1, -1, -1, - 35, -1, -1, 38, 39, -1, -1, 42, -1, 44, - -1, -1, -1, -1, -1, -1, -1, -1, 53, -1, - -1, 56, -1, -1, 59, -1, -1, 62, -1, -1, - -1, 66, 67, 68, 4, 5, 6, 7, 8, 9, - 10, 11, 12, -1, -1, 15, -1, 17, -1, -1, - -1, -1, -1, -1, 24, -1, -1, -1, -1, -1, - 30, -1, -1, -1, -1, 35, -1, -1, 38, 39, - -1, -1, -1, -1, 44, -1, -1, -1, -1, -1, - -1, -1, -1, 53, -1, -1, 56, -1, -1, 59, - -1, -1, 62, 6, -1, -1, 66, 67, 68, 12, - -1, 14, 15, -1, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, -1, 31, -1, - -1, 34, -1, -1, 37, -1, -1, -1, -1, -1, - -1, -1, 45, 46, 47, 48, 49, 50, 51, 52, - -1, 54, 55, -1, -1, -1, -1, 6, -1, -1, - -1, 64, 65, 12, -1, 14, 15, -1, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, -1, 31, -1, -1, 34, -1, -1, 37, -1, - -1, -1, -1, -1, -1, -1, 45, 46, 47, 48, - 49, 50, 51, 52, -1, 54, 55, -1, -1, -1, - -1, 6, -1, -1, -1, 64, 65, 12, -1, 14, - 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, -1, 31, -1, -1, 34, - -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, - 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, - 55, -1, -1, -1, -1, 6, -1, -1, -1, 64, - 65, 12, -1, 14, 15, -1, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, - 31, -1, -1, 34, -1, -1, 37, -1, -1, -1, - -1, -1, -1, -1, 45, 46, 47, 48, 49, 50, - 51, 52, -1, 54, 55, -1, -1, -1, -1, 6, - -1, -1, -1, 64, 65, 12, -1, 14, 15, -1, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, -1, -1, -1, -1, 34, -1, -1, - 37, -1, -1, -1, -1, -1, -1, -1, 45, 46, - 47, 48, 49, 50, 51, 52, -1, 54, 55, 12, - -1, -1, -1, -1, 17, -1, -1, 64, 65, -1, - 23, -1, -1, -1, -1, -1, 29, -1, -1, -1, - -1, 34, -1, -1, 37, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 49, 50, 51, 52 + -1, -1, 6, -1, -1, -1, 64, 65, 12, -1, + 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, -1, 31, -1, -1, + 34, -1, -1, 37, -1, -1, -1, -1, -1, -1, + -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, + 54, 55, -1, -1, -1, -1, 6, -1, -1, -1, + 64, 65, 12, -1, 14, 15, -1, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + -1, -1, -1, -1, 34, -1, -1, 37, -1, -1, + -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, + 50, 51, 52, -1, 54, 55, -1, -1, -1, -1, + -1, -1, -1, -1, 64, 65 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1294,48 +1316,49 @@ static const yytype_uint8 yystos[] = 112, 113, 114, 115, 116, 117, 118, 119, 127, 129, 130, 131, 133, 136, 137, 138, 139, 140, 141, 15, 56, 17, 81, 38, 39, 44, 59, 67, 68, 81, - 97, 47, 97, 94, 81, 82, 83, 84, 97, 60, + 97, 47, 97, 94, 13, 81, 82, 83, 84, 97, + 60, 81, 23, 29, 34, 37, 49, 50, 51, 52, + 84, 81, 118, 81, 84, 84, 13, 17, 43, 17, + 35, 47, 84, 53, 13, 17, 43, 56, 8, 13, + 17, 35, 47, 84, 13, 84, 13, 84, 51, 84, 81, 23, 29, 34, 37, 49, 50, 51, 52, 84, - 81, 118, 81, 84, 84, 13, 17, 43, 17, 35, - 47, 84, 53, 13, 17, 43, 56, 8, 13, 17, - 35, 47, 84, 84, 84, 51, 84, 81, 23, 29, - 34, 37, 49, 50, 51, 52, 84, 13, 17, 27, - 42, 81, 8, 40, 43, 59, 60, 61, 98, 6, - 7, 93, 15, 81, 92, 98, 98, 98, 98, 58, - 58, 58, 58, 58, 58, 58, 58, 98, 98, 81, - 98, 58, 98, 98, 98, 94, 98, 97, 94, 94, - 134, 94, 4, 5, 6, 7, 8, 9, 10, 11, - 15, 16, 24, 30, 35, 53, 56, 59, 62, 66, - 81, 96, 97, 120, 40, 59, 60, 61, 94, 94, - 60, 84, 84, 84, 84, 84, 84, 51, 81, 17, - 53, 132, 53, 78, 17, 13, 132, 53, 103, 17, - 17, 13, 73, 74, 132, 84, 59, 84, 84, 84, - 84, 84, 84, 84, 51, 17, 13, 132, 81, 81, - 94, 128, 53, 81, 94, 15, 18, 47, 59, 81, - 92, 93, 117, 131, 59, 15, 81, 65, 92, 65, - 84, 84, 84, 84, 84, 84, 84, 84, 27, 81, - 94, 17, 135, 4, 5, 94, 94, 95, 59, 95, - 125, 128, 94, 59, 59, 94, 84, 59, 58, 98, - 98, 56, 13, 59, 17, 98, 98, 15, 81, 104, - 75, 76, 13, 59, 17, 56, 17, 47, 48, 86, - 87, 90, 98, 94, 84, 17, 43, 9, 59, 94, - 56, 94, 93, 92, 94, 94, 81, 81, 94, 65, - 94, 60, 31, 121, 57, 58, 63, 58, 60, 124, + 13, 17, 27, 42, 81, 8, 40, 43, 59, 60, + 61, 98, 6, 7, 93, 15, 81, 92, 98, 98, + 98, 98, 58, 58, 58, 58, 58, 58, 58, 58, + 98, 98, 81, 98, 58, 98, 98, 98, 94, 98, + 97, 94, 94, 134, 94, 4, 5, 6, 7, 8, + 9, 10, 11, 15, 16, 24, 30, 35, 53, 56, + 59, 62, 66, 81, 96, 97, 120, 17, 40, 59, + 60, 61, 94, 94, 60, 84, 84, 84, 84, 84, + 84, 51, 81, 17, 53, 132, 53, 78, 17, 13, + 132, 53, 103, 17, 17, 13, 73, 74, 132, 17, + 17, 84, 59, 84, 84, 84, 84, 84, 84, 84, + 51, 17, 13, 132, 81, 81, 94, 128, 53, 81, + 94, 15, 18, 47, 59, 81, 92, 93, 117, 131, + 59, 15, 81, 65, 92, 65, 84, 84, 84, 84, + 84, 84, 84, 84, 27, 81, 94, 17, 135, 4, + 5, 94, 94, 95, 59, 95, 125, 59, 128, 94, + 59, 59, 94, 84, 59, 58, 98, 98, 56, 13, + 59, 17, 98, 98, 15, 81, 104, 75, 76, 13, + 59, 17, 56, 17, 47, 48, 86, 87, 90, 98, + 59, 59, 94, 84, 17, 43, 9, 59, 94, 56, + 94, 93, 92, 94, 94, 81, 81, 94, 65, 94, + 60, 31, 121, 57, 58, 63, 58, 60, 124, 94, 94, 94, 15, 53, 64, 80, 81, 17, 15, 17, 24, 15, 132, 57, 58, 56, 86, 17, 15, 17, - 24, 15, 132, 80, 17, 31, 87, 90, 15, 132, - 81, 81, 94, 16, 122, 102, 65, 92, 65, 42, - 85, 94, 85, 132, 125, 94, 17, 64, 81, 126, - 53, 57, 58, 59, 98, 98, 105, 15, 81, 80, - 31, 59, 98, 98, 57, 94, 125, 104, 94, 65, - 94, 81, 85, 124, 59, 59, 79, 94, 98, 81, - 15, 17, 62, 58, 85, 57, 15, 17, 62, 86, - 123, 124, 57, 85, 94, 85, 126, 94, 94, 31, - 98, 79, 15, 81, 88, 89, 17, 86, 88, 89, - 31, 125, 126, 105, 85, 58, 60, 58, 63, 58, - 63, 59, 31, 63, 63, 124, 85, 64, 126, 64, - 126, 64, 81, 15, 64, 15, 81, 126, 126, 126, - 81, 15 + 24, 15, 132, 80, 17, 31, 87, 90, 94, 94, + 15, 132, 81, 81, 94, 16, 122, 102, 65, 92, + 65, 42, 85, 94, 85, 132, 125, 94, 17, 64, + 81, 126, 53, 57, 58, 59, 98, 98, 105, 15, + 81, 80, 31, 59, 98, 98, 57, 94, 125, 104, + 94, 65, 94, 81, 85, 124, 59, 59, 79, 94, + 98, 81, 15, 17, 62, 58, 85, 57, 15, 17, + 62, 86, 123, 124, 57, 85, 94, 85, 126, 94, + 94, 31, 98, 79, 15, 81, 88, 89, 17, 86, + 88, 89, 31, 125, 126, 105, 85, 58, 60, 58, + 63, 58, 63, 59, 31, 63, 63, 124, 85, 64, + 126, 64, 126, 64, 81, 15, 64, 15, 81, 126, + 126, 126, 81, 15 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1358,16 +1381,16 @@ static const yytype_uint8 yyr1[] = 99, 100, 100, 102, 101, 103, 101, 104, 104, 104, 104, 104, 105, 105, 105, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, - 107, 108, 108, 108, 108, 109, 109, 109, 109, 110, - 110, 110, 110, 111, 111, 111, 111, 112, 112, 112, - 112, 113, 113, 113, 113, 114, 114, 114, 115, 115, - 116, 116, 117, 117, 117, 117, 117, 118, 118, 120, - 119, 121, 119, 122, 119, 123, 119, 124, 124, 125, - 125, 126, 126, 126, 126, 126, 127, 127, 128, 129, - 129, 129, 129, 129, 129, 130, 131, 131, 132, 132, - 132, 134, 133, 135, 135, 136, 136, 136, 137, 137, - 137, 137, 137, 137, 137, 137, 138, 139, 140, 140, - 140, 141 + 107, 107, 108, 108, 108, 108, 109, 109, 109, 109, + 109, 110, 110, 110, 110, 111, 111, 111, 111, 112, + 112, 112, 112, 113, 113, 113, 113, 113, 114, 114, + 114, 115, 115, 116, 116, 117, 117, 117, 117, 117, + 118, 118, 120, 119, 121, 119, 122, 119, 123, 119, + 124, 124, 125, 125, 126, 126, 126, 126, 126, 127, + 127, 128, 129, 129, 129, 129, 129, 129, 130, 131, + 131, 132, 132, 132, 134, 133, 135, 135, 136, 136, + 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, + 139, 140, 140, 140, 141 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1390,16 +1413,16 @@ static const yytype_int8 yyr2[] = 3, 3, 5, 0, 9, 0, 7, 0, 1, 3, 1, 3, 0, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 2, 4, 4, - 3, 2, 3, 3, 3, 2, 3, 2, 3, 2, - 3, 3, 3, 2, 3, 3, 3, 2, 3, 3, - 3, 2, 3, 3, 3, 2, 2, 3, 4, 2, - 1, 3, 2, 2, 2, 3, 1, 2, 3, 0, - 6, 0, 8, 0, 8, 0, 10, 1, 2, 0, - 5, 3, 5, 6, 5, 6, 2, 3, 1, 3, - 4, 3, 3, 3, 4, 2, 1, 1, 1, 3, - 4, 0, 5, 0, 3, 3, 5, 5, 5, 5, - 5, 5, 7, 7, 9, 9, 4, 4, 4, 6, - 6, 4 + 3, 5, 2, 3, 3, 3, 2, 3, 2, 3, + 5, 2, 3, 3, 3, 2, 3, 3, 3, 2, + 3, 3, 3, 2, 3, 3, 3, 5, 2, 2, + 3, 4, 2, 1, 3, 2, 2, 2, 3, 1, + 2, 3, 0, 6, 0, 8, 0, 8, 0, 10, + 1, 2, 0, 5, 3, 5, 6, 5, 6, 2, + 3, 1, 3, 4, 3, 3, 3, 4, 2, 1, + 1, 1, 3, 4, 0, 5, 0, 3, 3, 5, + 5, 5, 5, 5, 5, 7, 7, 9, 9, 4, + 4, 4, 6, 6, 4 }; @@ -2135,91 +2158,91 @@ yyparse (void) case 3: /* input: input import */ #line 163 "antimony.ypp" {} -#line 2139 "antimony.tab.cpp" +#line 2162 "antimony.tab.cpp" break; case 4: /* input: input module */ #line 164 "antimony.ypp" { /*cout << endl << $2->ToString() << endl << endl;*/ } -#line 2145 "antimony.tab.cpp" +#line 2168 "antimony.tab.cpp" break; case 5: /* input: input modulepart */ #line 165 "antimony.ypp" {} -#line 2151 "antimony.tab.cpp" +#line 2174 "antimony.tab.cpp" break; case 6: /* input: input function */ #line 166 "antimony.ypp" {} -#line 2157 "antimony.tab.cpp" +#line 2180 "antimony.tab.cpp" break; case 7: /* input: input modulename */ #line 167 "antimony.ypp" {} -#line 2163 "antimony.tab.cpp" +#line 2186 "antimony.tab.cpp" break; case 8: /* input: input functionname */ #line 168 "antimony.ypp" {} -#line 2169 "antimony.tab.cpp" +#line 2192 "antimony.tab.cpp" break; case 9: /* input: input modulecvterm */ #line 169 "antimony.ypp" {} -#line 2175 "antimony.tab.cpp" +#line 2198 "antimony.tab.cpp" break; case 10: /* input: input functioncvterm */ #line 170 "antimony.ypp" {} -#line 2181 "antimony.tab.cpp" +#line 2204 "antimony.tab.cpp" break; case 11: /* input: input toplevel_sbo */ #line 171 "antimony.ypp" {} -#line 2187 "antimony.tab.cpp" +#line 2210 "antimony.tab.cpp" break; case 12: /* input: input annotationBlock */ #line 172 "antimony.ypp" {} -#line 2193 "antimony.tab.cpp" +#line 2216 "antimony.tab.cpp" break; case 13: /* input: input moduleannotation */ #line 173 "antimony.ypp" {} -#line 2199 "antimony.tab.cpp" +#line 2222 "antimony.tab.cpp" break; case 14: /* input: input error */ #line 174 "antimony.ypp" {YYABORT;} -#line 2205 "antimony.tab.cpp" +#line 2228 "antimony.tab.cpp" break; case 15: /* input: input "an error" */ #line 175 "antimony.ypp" {YYABORT;} -#line 2211 "antimony.tab.cpp" +#line 2234 "antimony.tab.cpp" break; case 16: /* import: "'import'" "text string" */ #line 178 "antimony.ypp" { if (g_registry.OpenFile(*((yyvsp[0].word)))==0) YYABORT;} -#line 2217 "antimony.tab.cpp" +#line 2240 "antimony.tab.cpp" break; case 17: /* $@1: %empty */ #line 181 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2223 "antimony.tab.cpp" +#line 2246 "antimony.tab.cpp" break; case 18: /* module: "'model' or 'module'" "element name" $@1 '(' variableexportlist ')' modulebody "'end'" */ @@ -2229,13 +2252,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2233 "antimony.tab.cpp" +#line 2256 "antimony.tab.cpp" break; case 19: /* $@2: %empty */ #line 187 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2239 "antimony.tab.cpp" +#line 2262 "antimony.tab.cpp" break; case 20: /* module: "'model' or 'module'" "element name" $@2 modulebody "'end'" */ @@ -2245,13 +2268,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2249 "antimony.tab.cpp" +#line 2272 "antimony.tab.cpp" break; case 21: /* $@3: %empty */ #line 193 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2255 "antimony.tab.cpp" +#line 2278 "antimony.tab.cpp" break; case 22: /* module: "'model' or 'module'" '*' "element name" $@3 '(' variableexportlist ')' modulebody "'end'" */ @@ -2261,13 +2284,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2265 "antimony.tab.cpp" +#line 2288 "antimony.tab.cpp" break; case 23: /* $@4: %empty */ #line 199 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2271 "antimony.tab.cpp" +#line 2294 "antimony.tab.cpp" break; case 24: /* module: "'model' or 'module'" '*' "element name" $@4 modulebody "'end'" */ @@ -2277,85 +2300,85 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2281 "antimony.tab.cpp" +#line 2304 "antimony.tab.cpp" break; case 25: /* module: "'model' or 'module'" "name of an existing module" */ #line 204 "antimony.ypp" {g_registry.SetError("module '" + *((yyvsp[0].word)) + "' already defined."); YYABORT;} -#line 2287 "antimony.tab.cpp" +#line 2310 "antimony.tab.cpp" break; case 26: /* module: "'model' or 'module'" "name of an existing function" */ #line 205 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a module because it is already a defined function."); YYABORT;} -#line 2293 "antimony.tab.cpp" +#line 2316 "antimony.tab.cpp" break; case 27: /* $@5: %empty */ #line 208 "antimony.ypp" {g_registry.NewUserFunction((yyvsp[0].word));} -#line 2299 "antimony.tab.cpp" +#line 2322 "antimony.tab.cpp" break; case 28: /* function: "'function'" "element name" $@5 '(' variableexportlist ')' spacedformula "'end'" */ #line 208 "antimony.ypp" {if (g_registry.SetUserFunction((yyvsp[-1].formula))) YYABORT;} -#line 2305 "antimony.tab.cpp" +#line 2328 "antimony.tab.cpp" break; case 29: /* function: "'function'" "name of an existing module" */ #line 209 "antimony.ypp" {g_registry.SetError("Cannot use '" + *((yyvsp[0].word)) +"' as a function name because it is already the name of a module."); YYABORT;} -#line 2311 "antimony.tab.cpp" +#line 2334 "antimony.tab.cpp" break; case 30: /* function: "'function'" "name of an existing function" */ #line 210 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a new function because it is already a defined function."); YYABORT;} -#line 2317 "antimony.tab.cpp" +#line 2340 "antimony.tab.cpp" break; case 31: /* spacedformula: formula */ #line 213 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2323 "antimony.tab.cpp" +#line 2346 "antimony.tab.cpp" break; case 32: /* spacedformula: lineend spacedformula */ #line 214 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2329 "antimony.tab.cpp" +#line 2352 "antimony.tab.cpp" break; case 33: /* spacedformula: spacedformula lineend */ #line 215 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula);} -#line 2335 "antimony.tab.cpp" +#line 2358 "antimony.tab.cpp" break; case 34: /* variableexportlist: %empty */ #line 225 "antimony.ypp" {} -#line 2341 "antimony.tab.cpp" +#line 2364 "antimony.tab.cpp" break; case 35: /* variableexportlist: variable */ #line 226 "antimony.ypp" {if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2347 "antimony.tab.cpp" +#line 2370 "antimony.tab.cpp" break; case 36: /* variableexportlist: variableexportlist ',' variable */ #line 227 "antimony.ypp" { if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2353 "antimony.tab.cpp" +#line 2376 "antimony.tab.cpp" break; case 37: /* variable: "element name" */ #line 230 "antimony.ypp" {(yyval.variable) = g_registry.AddVariableToCurrent((yyvsp[0].word)); } -#line 2359 "antimony.tab.cpp" +#line 2382 "antimony.tab.cpp" break; case 38: /* variable: variable '.' "element name" */ @@ -2366,97 +2389,97 @@ yyparse (void) YYABORT; } } -#line 2370 "antimony.tab.cpp" +#line 2393 "antimony.tab.cpp" break; case 39: /* variable: '$' variable */ #line 237 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable); if ((yyval.variable)->SetIsConst(true)) YYABORT;} -#line 2376 "antimony.tab.cpp" +#line 2399 "antimony.tab.cpp" break; case 40: /* variablein: variable "'in'" variable */ #line 240 "antimony.ypp" {if ((yyvsp[-2].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; (yyval.variable) = (yyvsp[-2].variable);} -#line 2382 "antimony.tab.cpp" +#line 2405 "antimony.tab.cpp" break; case 41: /* varmaybein: variable */ #line 243 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2388 "antimony.tab.cpp" +#line 2411 "antimony.tab.cpp" break; case 42: /* varmaybein: variablein */ #line 244 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2394 "antimony.tab.cpp" +#line 2417 "antimony.tab.cpp" break; case 43: /* varmaybeis: varmaybein */ #line 247 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2400 "antimony.tab.cpp" +#line 2423 "antimony.tab.cpp" break; case 44: /* varmaybeis: varmaybein '=' formula */ #line 248 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 2406 "antimony.tab.cpp" +#line 2429 "antimony.tab.cpp" break; case 45: /* varmaybeis: varmaybein ':' '=' formula */ #line 249 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT; } -#line 2412 "antimony.tab.cpp" +#line 2435 "antimony.tab.cpp" break; case 46: /* varmaybeis: varmaybein '\'' '=' formula */ #line 250 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT; } -#line 2418 "antimony.tab.cpp" +#line 2441 "antimony.tab.cpp" break; case 47: /* varmaybeis: varmaybein "'has'" unitdef */ #line 251 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 2424 "antimony.tab.cpp" +#line 2447 "antimony.tab.cpp" break; case 48: /* maybein: %empty */ #line 254 "antimony.ypp" {(yyval.variable) = NULL;} -#line 2430 "antimony.tab.cpp" +#line 2453 "antimony.tab.cpp" break; case 49: /* maybein: "'in'" variable */ #line 255 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2436 "antimony.tab.cpp" +#line 2459 "antimony.tab.cpp" break; case 50: /* modulebody: modulepart */ #line 258 "antimony.ypp" {} -#line 2442 "antimony.tab.cpp" +#line 2465 "antimony.tab.cpp" break; case 51: /* modulebody: moduleannotation */ #line 259 "antimony.ypp" {} -#line 2448 "antimony.tab.cpp" +#line 2471 "antimony.tab.cpp" break; case 52: /* modulebody: modulebody modulepart */ #line 260 "antimony.ypp" {} -#line 2454 "antimony.tab.cpp" +#line 2477 "antimony.tab.cpp" break; case 53: /* modulebody: modulebody moduleannotation */ #line 261 "antimony.ypp" {} -#line 2460 "antimony.tab.cpp" +#line 2483 "antimony.tab.cpp" break; case 54: /* moduleannotation: "'model' or 'module'" "element name" stringlist lineend */ @@ -2465,7 +2488,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCVTerm(&modname,(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT; } -#line 2469 "antimony.tab.cpp" +#line 2492 "antimony.tab.cpp" break; case 55: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" stringlist lineend */ @@ -2474,7 +2497,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT; } -#line 2478 "antimony.tab.cpp" +#line 2501 "antimony.tab.cpp" break; case 56: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" "number" lineend */ @@ -2483,7 +2506,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT; } -#line 2487 "antimony.tab.cpp" +#line 2510 "antimony.tab.cpp" break; case 57: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "number" */ @@ -2497,7 +2520,7 @@ yyparse (void) YYABORT; } } -#line 2501 "antimony.tab.cpp" +#line 2524 "antimony.tab.cpp" break; case 58: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "element name" */ @@ -2511,7 +2534,7 @@ yyparse (void) YYABORT; } } -#line 2515 "antimony.tab.cpp" +#line 2538 "antimony.tab.cpp" break; case 59: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "name of a pre-defined constant" */ @@ -2525,7 +2548,7 @@ yyparse (void) YYABORT; } } -#line 2529 "antimony.tab.cpp" +#line 2552 "antimony.tab.cpp" break; case 60: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "number" */ @@ -2543,7 +2566,7 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 2547 "antimony.tab.cpp" +#line 2570 "antimony.tab.cpp" break; case 61: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "element name" */ @@ -2561,7 +2584,7 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 2565 "antimony.tab.cpp" +#line 2588 "antimony.tab.cpp" break; case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ @@ -2579,7 +2602,7 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 2583 "antimony.tab.cpp" +#line 2606 "antimony.tab.cpp" break; case 63: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' numlist '}' */ @@ -2597,127 +2620,127 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 2601 "antimony.tab.cpp" +#line 2624 "antimony.tab.cpp" break; case 64: /* variablelist: variable */ #line 367 "antimony.ypp" { (yyval.variablelist) = new std::vector(); (yyval.variablelist)->push_back((yyvsp[0].variable));} -#line 2607 "antimony.tab.cpp" +#line 2630 "antimony.tab.cpp" break; case 65: /* variablelist: variablelist ',' variable */ #line 368 "antimony.ypp" { (yyval.variablelist) = (yyvsp[-2].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } -#line 2613 "antimony.tab.cpp" +#line 2636 "antimony.tab.cpp" break; case 66: /* variablelist: variablelist ',' '\n' variable */ #line 369 "antimony.ypp" { (yyval.variablelist) = (yyvsp[-3].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } -#line 2619 "antimony.tab.cpp" +#line 2642 "antimony.tab.cpp" break; case 67: /* numlist: "number" */ #line 372 "antimony.ypp" { (yyval.numlist) = new std::vector(); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2625 "antimony.tab.cpp" +#line 2648 "antimony.tab.cpp" break; case 68: /* numlist: numlist ',' "number" */ #line 373 "antimony.ypp" { (yyval.numlist) = (yyvsp[-2].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2631 "antimony.tab.cpp" +#line 2654 "antimony.tab.cpp" break; case 69: /* numlist: numlist ',' '\n' "number" */ #line 374 "antimony.ypp" { (yyval.numlist) = (yyvsp[-3].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2637 "antimony.tab.cpp" +#line 2660 "antimony.tab.cpp" break; case 70: /* modulepart: reaction lineend */ #line 377 "antimony.ypp" {} -#line 2643 "antimony.tab.cpp" +#line 2666 "antimony.tab.cpp" break; case 71: /* modulepart: assignment lineend */ #line 378 "antimony.ypp" {} -#line 2649 "antimony.tab.cpp" +#line 2672 "antimony.tab.cpp" break; case 72: /* modulepart: submodule lineend */ #line 379 "antimony.ypp" {} -#line 2655 "antimony.tab.cpp" +#line 2678 "antimony.tab.cpp" break; case 73: /* modulepart: varinitialize lineend */ #line 380 "antimony.ypp" {} -#line 2661 "antimony.tab.cpp" +#line 2684 "antimony.tab.cpp" break; case 74: /* modulepart: dnadef lineend */ #line 381 "antimony.ypp" {} -#line 2667 "antimony.tab.cpp" +#line 2690 "antimony.tab.cpp" break; case 75: /* modulepart: event lineend */ #line 382 "antimony.ypp" {} -#line 2673 "antimony.tab.cpp" +#line 2696 "antimony.tab.cpp" break; case 76: /* modulepart: unitinit lineend */ #line 383 "antimony.ypp" {} -#line 2679 "antimony.tab.cpp" +#line 2702 "antimony.tab.cpp" break; case 77: /* modulepart: deletion lineend */ #line 384 "antimony.ypp" {} -#line 2685 "antimony.tab.cpp" +#line 2708 "antimony.tab.cpp" break; case 78: /* modulepart: cvterm lineend */ #line 385 "antimony.ypp" {} -#line 2691 "antimony.tab.cpp" +#line 2714 "antimony.tab.cpp" break; case 79: /* modulepart: variablein */ #line 386 "antimony.ypp" {} -#line 2697 "antimony.tab.cpp" +#line 2720 "antimony.tab.cpp" break; case 80: /* modulepart: constraint lineend */ #line 387 "antimony.ypp" {} -#line 2703 "antimony.tab.cpp" +#line 2726 "antimony.tab.cpp" break; case 81: /* modulepart: objective lineend */ #line 388 "antimony.ypp" {} -#line 2709 "antimony.tab.cpp" +#line 2732 "antimony.tab.cpp" break; case 82: /* modulepart: algrule lineend */ #line 389 "antimony.ypp" {} -#line 2715 "antimony.tab.cpp" +#line 2738 "antimony.tab.cpp" break; case 83: /* modulepart: lineend */ #line 390 "antimony.ypp" {} -#line 2721 "antimony.tab.cpp" +#line 2744 "antimony.tab.cpp" break; case 84: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ @@ -2729,7 +2752,7 @@ yyparse (void) if ((yyvsp[-7].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2733 "antimony.tab.cpp" +#line 2756 "antimony.tab.cpp" break; case 85: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ @@ -2741,7 +2764,7 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2745 "antimony.tab.cpp" +#line 2768 "antimony.tab.cpp" break; case 86: /* reaction: reactantList reactionDivider ';' formula maybein */ @@ -2753,7 +2776,7 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2757 "antimony.tab.cpp" +#line 2780 "antimony.tab.cpp" break; case 87: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ @@ -2765,7 +2788,7 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2769 "antimony.tab.cpp" +#line 2792 "antimony.tab.cpp" break; case 88: /* reaction: reactionDivider reactantList ';' formula maybein */ @@ -2777,7 +2800,7 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2781 "antimony.tab.cpp" +#line 2804 "antimony.tab.cpp" break; case 89: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ @@ -2789,385 +2812,385 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2793 "antimony.tab.cpp" +#line 2816 "antimony.tab.cpp" break; case 90: /* reactantList: variable */ #line 443 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2799 "antimony.tab.cpp" +#line 2822 "antimony.tab.cpp" break; case 91: /* reactantList: "number" variable */ #line 444 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2805 "antimony.tab.cpp" +#line 2828 "antimony.tab.cpp" break; case 92: /* reactantList: variable variable */ #line 445 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2811 "antimony.tab.cpp" +#line 2834 "antimony.tab.cpp" break; case 93: /* reactantList: reactantList '+' variable */ #line 446 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-2].reactantList); if((yyvsp[-2].reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2817 "antimony.tab.cpp" +#line 2840 "antimony.tab.cpp" break; case 94: /* reactantList: reactantList '+' "number" variable */ #line 447 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2823 "antimony.tab.cpp" +#line 2846 "antimony.tab.cpp" break; case 95: /* reactantList: reactantList '+' variable variable */ #line 448 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2829 "antimony.tab.cpp" +#line 2852 "antimony.tab.cpp" break; case 96: /* reactionDivider: "->" */ #line 452 "antimony.ypp" {(yyval.reactionDivider) = rdBecomes;} -#line 2835 "antimony.tab.cpp" +#line 2858 "antimony.tab.cpp" break; case 97: /* reactionDivider: "-|" */ #line 453 "antimony.ypp" {(yyval.reactionDivider) = rdInhibits;} -#line 2841 "antimony.tab.cpp" +#line 2864 "antimony.tab.cpp" break; case 98: /* reactionDivider: '-' '(' */ #line 454 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2847 "antimony.tab.cpp" +#line 2870 "antimony.tab.cpp" break; case 99: /* reactionDivider: "-o" */ #line 455 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2853 "antimony.tab.cpp" +#line 2876 "antimony.tab.cpp" break; case 100: /* reactionDivider: "=>" */ #line 456 "antimony.ypp" {(yyval.reactionDivider) = rdBecomesIrreversibly;} -#line 2859 "antimony.tab.cpp" +#line 2882 "antimony.tab.cpp" break; case 101: /* formula: %empty */ #line 459 "antimony.ypp" {(yyval.formula) = g_registry.NewBlankFormula(); } -#line 2865 "antimony.tab.cpp" +#line 2888 "antimony.tab.cpp" break; case 102: /* formula: formula "..." */ #line 460 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddEllipses();} -#line 2871 "antimony.tab.cpp" +#line 2894 "antimony.tab.cpp" break; case 103: /* formula: formula variable */ #line 461 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); if((yyvsp[-1].formula)->AddVariable((yyvsp[0].variable))) YYABORT; } -#line 2877 "antimony.tab.cpp" +#line 2900 "antimony.tab.cpp" break; case 104: /* formula: formula "number" */ #line 462 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddNum((yyvsp[0].num)); } -#line 2883 "antimony.tab.cpp" +#line 2906 "antimony.tab.cpp" break; case 105: /* formula: formula "name of a pre-defined constant" */ #line 463 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2889 "antimony.tab.cpp" +#line 2912 "antimony.tab.cpp" break; case 106: /* formula: formula "name of an existing function" */ #line 464 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2895 "antimony.tab.cpp" +#line 2918 "antimony.tab.cpp" break; case 107: /* formula: formula '(' commaformula ')' */ #line 465 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddParentheses(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2901 "antimony.tab.cpp" +#line 2924 "antimony.tab.cpp" break; case 108: /* formula: formula '{' commaformula '}' */ #line 466 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddCurlyBrackets(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2907 "antimony.tab.cpp" +#line 2930 "antimony.tab.cpp" break; case 109: /* formula: formula mathThing */ #line 467 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddMathThing((yyvsp[0].character)); } -#line 2913 "antimony.tab.cpp" +#line 2936 "antimony.tab.cpp" break; case 110: /* formula: formula inequality */ #line 468 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddInequality((yyvsp[0].inequality)); } -#line 2919 "antimony.tab.cpp" +#line 2942 "antimony.tab.cpp" break; case 111: /* formula: formula '=' '=' */ #line 469 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('='); (yyvsp[-2].formula)->AddMathThing('='); } -#line 2925 "antimony.tab.cpp" +#line 2948 "antimony.tab.cpp" break; case 112: /* formula: formula '&' '&' */ #line 470 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('&'); (yyvsp[-2].formula)->AddMathThing('&'); } -#line 2931 "antimony.tab.cpp" +#line 2954 "antimony.tab.cpp" break; case 113: /* formula: formula '|' '|' */ #line 471 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('|'); (yyvsp[-2].formula)->AddMathThing('|'); } -#line 2937 "antimony.tab.cpp" +#line 2960 "antimony.tab.cpp" break; case 114: /* formula: formula "text string" */ #line 472 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word), true); } -#line 2943 "antimony.tab.cpp" +#line 2966 "antimony.tab.cpp" break; case 115: /* commaformula: formula */ #line 475 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2949 "antimony.tab.cpp" +#line 2972 "antimony.tab.cpp" break; case 116: /* commaformula: commaformula ',' formula */ #line 476 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyval.formula)->AddMathThing(','); (yyval.formula)->AddFormula((yyvsp[0].formula)); } -#line 2955 "antimony.tab.cpp" +#line 2978 "antimony.tab.cpp" break; case 117: /* mathThing: '+' */ #line 479 "antimony.ypp" {(yyval.character) = '+';} -#line 2961 "antimony.tab.cpp" +#line 2984 "antimony.tab.cpp" break; case 118: /* mathThing: '-' */ #line 480 "antimony.ypp" {(yyval.character) = '-';} -#line 2967 "antimony.tab.cpp" +#line 2990 "antimony.tab.cpp" break; case 119: /* mathThing: '*' */ #line 481 "antimony.ypp" {(yyval.character) = '*';} -#line 2973 "antimony.tab.cpp" +#line 2996 "antimony.tab.cpp" break; case 120: /* mathThing: '/' */ #line 482 "antimony.ypp" {(yyval.character) = '/';} -#line 2979 "antimony.tab.cpp" +#line 3002 "antimony.tab.cpp" break; case 121: /* mathThing: '^' */ #line 483 "antimony.ypp" {(yyval.character) = '^';} -#line 2985 "antimony.tab.cpp" +#line 3008 "antimony.tab.cpp" break; case 122: /* mathThing: '!' */ #line 484 "antimony.ypp" {(yyval.character) = '!';} -#line 2991 "antimony.tab.cpp" +#line 3014 "antimony.tab.cpp" break; case 123: /* mathThing: '%' */ #line 485 "antimony.ypp" {(yyval.character) = '%';} -#line 2997 "antimony.tab.cpp" +#line 3020 "antimony.tab.cpp" break; case 124: /* inequality: '<' */ #line 488 "antimony.ypp" {(yyval.inequality) = constLT;} -#line 3003 "antimony.tab.cpp" +#line 3026 "antimony.tab.cpp" break; case 125: /* inequality: "<=" */ #line 489 "antimony.ypp" {(yyval.inequality) = constLEQ;} -#line 3009 "antimony.tab.cpp" +#line 3032 "antimony.tab.cpp" break; case 126: /* inequality: '>' */ #line 490 "antimony.ypp" {(yyval.inequality) = constGT;} -#line 3015 "antimony.tab.cpp" +#line 3038 "antimony.tab.cpp" break; case 127: /* inequality: ">=" */ #line 491 "antimony.ypp" {(yyval.inequality) = constGEQ;} -#line 3021 "antimony.tab.cpp" +#line 3044 "antimony.tab.cpp" break; case 128: /* inequality: "!=" */ #line 492 "antimony.ypp" {(yyval.inequality) = constNEQ;} -#line 3027 "antimony.tab.cpp" +#line 3050 "antimony.tab.cpp" break; case 129: /* lineend: ';' */ #line 495 "antimony.ypp" {} -#line 3033 "antimony.tab.cpp" +#line 3056 "antimony.tab.cpp" break; case 130: /* lineend: '\n' */ #line 496 "antimony.ypp" {} -#line 3039 "antimony.tab.cpp" +#line 3062 "antimony.tab.cpp" break; case 131: /* lineend: "end of line" */ #line 497 "antimony.ypp" {} -#line 3045 "antimony.tab.cpp" +#line 3068 "antimony.tab.cpp" break; case 132: /* assignment: varmaybein ':' maxormin formula */ #line 500 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[-3].variable), (yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3051 "antimony.tab.cpp" +#line 3074 "antimony.tab.cpp" break; case 133: /* assignment: varmaybein '=' formula */ #line 501 "antimony.ypp" {if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 3057 "antimony.tab.cpp" +#line 3080 "antimony.tab.cpp" break; case 134: /* assignment: varmaybein "'is'" variable */ #line 502 "antimony.ypp" {if ((yyvsp[-2].variable)->Synchronize((yyvsp[0].variable), NULL)) YYABORT;} -#line 3063 "antimony.tab.cpp" +#line 3086 "antimony.tab.cpp" break; case 135: /* assignment: varmaybein "'is'" variable '/' variable */ #line 503 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[-2].variable), (yyvsp[0].variable))) YYABORT;} -#line 3069 "antimony.tab.cpp" +#line 3092 "antimony.tab.cpp" break; case 136: /* assignment: varmaybein '*' variable "'is'" variable */ #line 504 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[0].variable), (yyvsp[-2].variable))) YYABORT;} -#line 3075 "antimony.tab.cpp" +#line 3098 "antimony.tab.cpp" break; case 137: /* assignment: varmaybein "'is'" "text string" */ #line 505 "antimony.ypp" {if ((yyvsp[-2].variable)->SetDisplayName(*((yyvsp[0].word)))) YYABORT;} -#line 3081 "antimony.tab.cpp" +#line 3104 "antimony.tab.cpp" break; case 138: /* assignment: varmaybein ':' '=' formula */ #line 506 "antimony.ypp" {if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT;} -#line 3087 "antimony.tab.cpp" +#line 3110 "antimony.tab.cpp" break; case 139: /* assignment: varmaybein '\'' '=' formula */ #line 507 "antimony.ypp" {if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT;} -#line 3093 "antimony.tab.cpp" +#line 3116 "antimony.tab.cpp" break; case 140: /* assignment: varmaybein "'has'" unitdef */ #line 508 "antimony.ypp" {if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 3099 "antimony.tab.cpp" +#line 3122 "antimony.tab.cpp" break; case 141: /* algrule: "number" '=' formula */ #line 512 "antimony.ypp" {if (g_registry.AddNewAlgebraicRuleToCurrent((yyvsp[-2].num), (yyvsp[0].formula))) YYABORT; } -#line 3105 "antimony.tab.cpp" +#line 3128 "antimony.tab.cpp" break; case 142: /* algrule: varmaybein ':' "number" '=' formula */ #line 513 "antimony.ypp" {if ((yyvsp[-4].variable)->SetAlgebraicRule((yyvsp[-2].num), (yyvsp[0].formula)) ) YYABORT;} -#line 3111 "antimony.tab.cpp" +#line 3134 "antimony.tab.cpp" break; case 143: /* $@6: %empty */ #line 516 "antimony.ypp" {if ((yyvsp[-3].variable)->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3117 "antimony.tab.cpp" +#line 3140 "antimony.tab.cpp" break; case 144: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ #line 516 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if ((yyvsp[-8].variable)->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3123 "antimony.tab.cpp" +#line 3146 "antimony.tab.cpp" break; case 145: /* $@7: %empty */ #line 517 "antimony.ypp" {if(g_registry.CurrentModule()->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3129 "antimony.tab.cpp" +#line 3152 "antimony.tab.cpp" break; case 146: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ #line 517 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if (g_registry.GetCurrentSubmodel()->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3135 "antimony.tab.cpp" +#line 3158 "antimony.tab.cpp" break; case 147: /* variableimportlist: %empty */ #line 521 "antimony.ypp" {} -#line 3141 "antimony.tab.cpp" +#line 3164 "antimony.tab.cpp" break; case 148: /* variableimportlist: variable */ #line 522 "antimony.ypp" {if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3147 "antimony.tab.cpp" +#line 3170 "antimony.tab.cpp" break; case 149: /* variableimportlist: variableimportlist ',' variable */ #line 523 "antimony.ypp" { if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3153 "antimony.tab.cpp" +#line 3176 "antimony.tab.cpp" break; case 150: /* variableimportlist: "number" */ #line 524 "antimony.ypp" {if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3159 "antimony.tab.cpp" +#line 3182 "antimony.tab.cpp" break; case 151: /* variableimportlist: variableimportlist ',' "number" */ #line 525 "antimony.ypp" { if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3165 "antimony.tab.cpp" +#line 3188 "antimony.tab.cpp" break; case 152: /* submodifications: %empty */ #line 529 "antimony.ypp" {} -#line 3171 "antimony.tab.cpp" +#line 3194 "antimony.tab.cpp" break; case 153: /* submodifications: submodifications ',' "element name" '=' variable */ @@ -3175,7 +3198,7 @@ yyparse (void) {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].variable));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].variable))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3179 "antimony.tab.cpp" +#line 3202 "antimony.tab.cpp" break; case 154: /* submodifications: submodifications ',' "element name" '=' "number" */ @@ -3183,455 +3206,473 @@ yyparse (void) {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].num));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].num))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3187 "antimony.tab.cpp" +#line 3210 "antimony.tab.cpp" break; case 155: /* varinitialize: specinit */ #line 538 "antimony.ypp" { } -#line 3193 "antimony.tab.cpp" +#line 3216 "antimony.tab.cpp" break; case 156: /* varinitialize: formulainit */ #line 539 "antimony.ypp" { } -#line 3199 "antimony.tab.cpp" +#line 3222 "antimony.tab.cpp" break; case 157: /* varinitialize: reactioninit */ #line 540 "antimony.ypp" { } -#line 3205 "antimony.tab.cpp" +#line 3228 "antimony.tab.cpp" break; case 158: /* varinitialize: dnainit */ #line 541 "antimony.ypp" { } -#line 3211 "antimony.tab.cpp" +#line 3234 "antimony.tab.cpp" break; case 159: /* varinitialize: geneinit */ #line 542 "antimony.ypp" { } -#line 3217 "antimony.tab.cpp" +#line 3240 "antimony.tab.cpp" break; case 160: /* varinitialize: operatorinit */ #line 543 "antimony.ypp" { } -#line 3223 "antimony.tab.cpp" +#line 3246 "antimony.tab.cpp" break; case 161: /* varinitialize: compartmentinit */ #line 544 "antimony.ypp" { } -#line 3229 "antimony.tab.cpp" +#line 3252 "antimony.tab.cpp" break; case 162: /* varinitialize: varconstinit */ #line 545 "antimony.ypp" { } -#line 3235 "antimony.tab.cpp" +#line 3258 "antimony.tab.cpp" break; case 163: /* specinit: "'species'" varmaybeis */ #line 548 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3241 "antimony.tab.cpp" +#line 3264 "antimony.tab.cpp" break; case 164: /* specinit: "'var'" "'species'" varmaybeis */ #line 549 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3247 "antimony.tab.cpp" +#line 3270 "antimony.tab.cpp" break; case 165: /* specinit: "'const'" "'species'" varmaybeis */ #line 550 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3253 "antimony.tab.cpp" +#line 3276 "antimony.tab.cpp" break; case 166: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ #line 551 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3259 "antimony.tab.cpp" +#line 3282 "antimony.tab.cpp" break; case 167: /* specinit: "'substanceOnly'" varmaybeis */ #line 552 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3265 "antimony.tab.cpp" +#line 3288 "antimony.tab.cpp" break; case 168: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ #line 553 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3271 "antimony.tab.cpp" +#line 3294 "antimony.tab.cpp" break; case 169: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ #line 554 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3277 "antimony.tab.cpp" +#line 3300 "antimony.tab.cpp" break; case 170: /* specinit: specinit ',' varmaybeis */ #line 555 "antimony.ypp" {(yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3283 "antimony.tab.cpp" +#line 3306 "antimony.tab.cpp" break; - case 171: /* formulainit: "'formula'" varmaybeis */ -#line 558 "antimony.ypp" - {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3289 "antimony.tab.cpp" + case 171: /* specinit: "'species'" '.' "element name" '=' formula */ +#line 556 "antimony.ypp" + {if (g_registry.CurrentModule()->AddSpeciesLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} +#line 3312 "antimony.tab.cpp" break; - case 172: /* formulainit: "'var'" "'formula'" varmaybeis */ + case 172: /* formulainit: "'formula'" varmaybeis */ #line 559 "antimony.ypp" - {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3295 "antimony.tab.cpp" + {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } +#line 3318 "antimony.tab.cpp" break; - case 173: /* formulainit: "'const'" "'formula'" varmaybeis */ + case 173: /* formulainit: "'var'" "'formula'" varmaybeis */ #line 560 "antimony.ypp" - {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3301 "antimony.tab.cpp" + {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } +#line 3324 "antimony.tab.cpp" break; - case 174: /* formulainit: formulainit ',' varmaybeis */ + case 174: /* formulainit: "'const'" "'formula'" varmaybeis */ #line 561 "antimony.ypp" + {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } +#line 3330 "antimony.tab.cpp" + break; + + case 175: /* formulainit: formulainit ',' varmaybeis */ +#line 562 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3307 "antimony.tab.cpp" +#line 3336 "antimony.tab.cpp" break; - case 175: /* reactioninit: "'reaction'" varmaybeis */ -#line 564 "antimony.ypp" + case 176: /* reactioninit: "'reaction'" varmaybeis */ +#line 565 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3313 "antimony.tab.cpp" +#line 3342 "antimony.tab.cpp" break; - case 176: /* reactioninit: "'var'" "'reaction'" varmaybeis */ -#line 565 "antimony.ypp" + case 177: /* reactioninit: "'var'" "'reaction'" varmaybeis */ +#line 566 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3319 "antimony.tab.cpp" +#line 3348 "antimony.tab.cpp" break; - case 177: /* reactioninit: "'const'" "'reaction'" */ -#line 566 "antimony.ypp" + case 178: /* reactioninit: "'const'" "'reaction'" */ +#line 567 "antimony.ypp" {g_registry.SetError("Reactions may not be set 'const'."); YYABORT; } -#line 3325 "antimony.tab.cpp" +#line 3354 "antimony.tab.cpp" break; - case 178: /* reactioninit: reactioninit ',' varmaybeis */ -#line 567 "antimony.ypp" + case 179: /* reactioninit: reactioninit ',' varmaybeis */ +#line 568 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3331 "antimony.tab.cpp" +#line 3360 "antimony.tab.cpp" + break; + + case 180: /* reactioninit: "'reaction'" '.' "element name" '=' formula */ +#line 569 "antimony.ypp" + {if (g_registry.CurrentModule()->AddReactionLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} +#line 3366 "antimony.tab.cpp" break; - case 179: /* dnainit: "'DNA'" varmaybeis */ -#line 570 "antimony.ypp" + case 181: /* dnainit: "'DNA'" varmaybeis */ +#line 572 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3337 "antimony.tab.cpp" +#line 3372 "antimony.tab.cpp" break; - case 180: /* dnainit: "'var'" "'DNA'" varmaybeis */ -#line 571 "antimony.ypp" + case 182: /* dnainit: "'var'" "'DNA'" varmaybeis */ +#line 573 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3343 "antimony.tab.cpp" +#line 3378 "antimony.tab.cpp" break; - case 181: /* dnainit: "'const'" "'DNA'" varmaybeis */ -#line 572 "antimony.ypp" + case 183: /* dnainit: "'const'" "'DNA'" varmaybeis */ +#line 574 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3349 "antimony.tab.cpp" +#line 3384 "antimony.tab.cpp" break; - case 182: /* dnainit: dnainit ',' varmaybeis */ -#line 573 "antimony.ypp" + case 184: /* dnainit: dnainit ',' varmaybeis */ +#line 575 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3355 "antimony.tab.cpp" +#line 3390 "antimony.tab.cpp" break; - case 183: /* geneinit: "'gene'" varmaybeis */ -#line 576 "antimony.ypp" + case 185: /* geneinit: "'gene'" varmaybeis */ +#line 578 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3361 "antimony.tab.cpp" +#line 3396 "antimony.tab.cpp" break; - case 184: /* geneinit: "'var'" "'gene'" varmaybeis */ -#line 577 "antimony.ypp" + case 186: /* geneinit: "'var'" "'gene'" varmaybeis */ +#line 579 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3367 "antimony.tab.cpp" +#line 3402 "antimony.tab.cpp" break; - case 185: /* geneinit: "'const'" "'gene'" varmaybeis */ -#line 578 "antimony.ypp" + case 187: /* geneinit: "'const'" "'gene'" varmaybeis */ +#line 580 "antimony.ypp" {g_registry.SetError("Genes may not be set 'const'."); YYABORT; } -#line 3373 "antimony.tab.cpp" +#line 3408 "antimony.tab.cpp" break; - case 186: /* geneinit: geneinit ',' varmaybeis */ -#line 579 "antimony.ypp" + case 188: /* geneinit: geneinit ',' varmaybeis */ +#line 581 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3379 "antimony.tab.cpp" +#line 3414 "antimony.tab.cpp" break; - case 187: /* operatorinit: "'operator'" varmaybeis */ -#line 582 "antimony.ypp" + case 189: /* operatorinit: "'operator'" varmaybeis */ +#line 584 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3385 "antimony.tab.cpp" +#line 3420 "antimony.tab.cpp" break; - case 188: /* operatorinit: "'var'" "'operator'" varmaybeis */ -#line 583 "antimony.ypp" + case 190: /* operatorinit: "'var'" "'operator'" varmaybeis */ +#line 585 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3391 "antimony.tab.cpp" +#line 3426 "antimony.tab.cpp" break; - case 189: /* operatorinit: "'const'" "'operator'" varmaybeis */ -#line 584 "antimony.ypp" + case 191: /* operatorinit: "'const'" "'operator'" varmaybeis */ +#line 586 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3397 "antimony.tab.cpp" +#line 3432 "antimony.tab.cpp" break; - case 190: /* operatorinit: operatorinit ',' varmaybeis */ -#line 585 "antimony.ypp" + case 192: /* operatorinit: operatorinit ',' varmaybeis */ +#line 587 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3403 "antimony.tab.cpp" +#line 3438 "antimony.tab.cpp" break; - case 191: /* compartmentinit: "'compartment'" varmaybeis */ -#line 589 "antimony.ypp" + case 193: /* compartmentinit: "'compartment'" varmaybeis */ +#line 591 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3409 "antimony.tab.cpp" +#line 3444 "antimony.tab.cpp" break; - case 192: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ -#line 590 "antimony.ypp" + case 194: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ +#line 592 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3415 "antimony.tab.cpp" +#line 3450 "antimony.tab.cpp" break; - case 193: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ -#line 591 "antimony.ypp" + case 195: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ +#line 593 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3421 "antimony.tab.cpp" +#line 3456 "antimony.tab.cpp" break; - case 194: /* compartmentinit: compartmentinit ',' varmaybeis */ -#line 592 "antimony.ypp" + case 196: /* compartmentinit: compartmentinit ',' varmaybeis */ +#line 594 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3427 "antimony.tab.cpp" +#line 3462 "antimony.tab.cpp" break; - case 195: /* varconstinit: "'var'" varmaybeis */ + case 197: /* compartmentinit: "'compartment'" '.' "element name" '=' formula */ #line 595 "antimony.ypp" + {if (g_registry.CurrentModule()->AddCompartmentLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} +#line 3468 "antimony.tab.cpp" + break; + + case 198: /* varconstinit: "'var'" varmaybeis */ +#line 598 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst();} -#line 3433 "antimony.tab.cpp" +#line 3474 "antimony.tab.cpp" break; - case 196: /* varconstinit: "'const'" varmaybeis */ -#line 596 "antimony.ypp" + case 199: /* varconstinit: "'const'" varmaybeis */ +#line 599 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst();} -#line 3439 "antimony.tab.cpp" +#line 3480 "antimony.tab.cpp" break; - case 197: /* varconstinit: varconstinit ',' varmaybeis */ -#line 597 "antimony.ypp" + case 200: /* varconstinit: varconstinit ',' varmaybeis */ +#line 600 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst();} -#line 3445 "antimony.tab.cpp" +#line 3486 "antimony.tab.cpp" break; - case 198: /* unitinit: "'unit'" variable '=' formula */ -#line 600 "antimony.ypp" + case 201: /* unitinit: "'unit'" variable '=' formula */ +#line 603 "antimony.ypp" {if ((yyvsp[-2].variable)->SetType(varUnitDefinition)) YYABORT; if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[-2].variable)->GetUnitDef()->SetFromFormula((yyvsp[0].formula))) YYABORT;} -#line 3453 "antimony.tab.cpp" +#line 3494 "antimony.tab.cpp" break; - case 199: /* unitinit: "'unit'" variable */ -#line 603 "antimony.ypp" + case 202: /* unitinit: "'unit'" variable */ +#line 606 "antimony.ypp" {if ((yyvsp[0].variable)->SetType(varUnitDefinition)) YYABORT;} -#line 3459 "antimony.tab.cpp" +#line 3500 "antimony.tab.cpp" break; - case 200: /* dnadef: dnastrand */ -#line 606 "antimony.ypp" + case 203: /* dnadef: dnastrand */ +#line 609 "antimony.ypp" {if (g_registry.SaveWorkingStrand()) YYABORT;} -#line 3465 "antimony.tab.cpp" +#line 3506 "antimony.tab.cpp" break; - case 201: /* dnadef: varmaybein ':' dnastrand */ -#line 607 "antimony.ypp" + case 204: /* dnadef: varmaybein ':' dnastrand */ +#line 610 "antimony.ypp" {if (g_registry.SetStrandAs((yyvsp[-2].variable))) YYABORT;} -#line 3471 "antimony.tab.cpp" +#line 3512 "antimony.tab.cpp" break; - case 202: /* dnastrand: "--" variable */ -#line 610 "antimony.ypp" + case 205: /* dnastrand: "--" variable */ +#line 613 "antimony.ypp" {if (g_registry.SetNewUpstreamOpen((yyvsp[0].variable))) YYABORT;} -#line 3477 "antimony.tab.cpp" +#line 3518 "antimony.tab.cpp" break; - case 203: /* dnastrand: "--" dnamiddle */ -#line 611 "antimony.ypp" + case 206: /* dnastrand: "--" dnamiddle */ +#line 614 "antimony.ypp" {g_registry.SetOpenUpstream(); } -#line 3483 "antimony.tab.cpp" +#line 3524 "antimony.tab.cpp" break; - case 204: /* dnastrand: dnamiddle variable */ -#line 612 "antimony.ypp" + case 207: /* dnastrand: dnamiddle variable */ +#line 615 "antimony.ypp" {if (g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3489 "antimony.tab.cpp" +#line 3530 "antimony.tab.cpp" break; - case 205: /* dnastrand: "--" dnamiddle variable */ -#line 613 "antimony.ypp" + case 208: /* dnastrand: "--" dnamiddle variable */ +#line 616 "antimony.ypp" {g_registry.SetOpenUpstream(); if(g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3495 "antimony.tab.cpp" +#line 3536 "antimony.tab.cpp" break; - case 206: /* dnastrand: dnamiddle */ -#line 614 "antimony.ypp" + case 209: /* dnastrand: dnamiddle */ +#line 617 "antimony.ypp" { } -#line 3501 "antimony.tab.cpp" +#line 3542 "antimony.tab.cpp" break; - case 207: /* dnamiddle: variable "--" */ -#line 617 "antimony.ypp" + case 210: /* dnamiddle: variable "--" */ +#line 620 "antimony.ypp" {if (g_registry.SetNewDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3507 "antimony.tab.cpp" +#line 3548 "antimony.tab.cpp" break; - case 208: /* dnamiddle: dnamiddle variable "--" */ -#line 618 "antimony.ypp" + case 211: /* dnamiddle: dnamiddle variable "--" */ +#line 621 "antimony.ypp" {if (g_registry.SetDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3513 "antimony.tab.cpp" +#line 3554 "antimony.tab.cpp" break; - case 209: /* $@8: %empty */ -#line 621 "antimony.ypp" + case 212: /* $@8: %empty */ +#line 624 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula))) YYABORT;} -#line 3519 "antimony.tab.cpp" +#line 3560 "antimony.tab.cpp" break; - case 210: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ -#line 621 "antimony.ypp" + case 213: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ +#line 624 "antimony.ypp" {} -#line 3525 "antimony.tab.cpp" +#line 3566 "antimony.tab.cpp" break; - case 211: /* $@9: %empty */ -#line 622 "antimony.ypp" + case 214: /* $@9: %empty */ +#line 625 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula))) YYABORT;} -#line 3531 "antimony.tab.cpp" +#line 3572 "antimony.tab.cpp" break; - case 212: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ -#line 622 "antimony.ypp" + case 215: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ +#line 625 "antimony.ypp" {} -#line 3537 "antimony.tab.cpp" +#line 3578 "antimony.tab.cpp" break; - case 213: /* $@10: %empty */ -#line 623 "antimony.ypp" + case 216: /* $@10: %empty */ +#line 626 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula), (yyvsp[-3].variable))) YYABORT;} -#line 3543 "antimony.tab.cpp" +#line 3584 "antimony.tab.cpp" break; - case 214: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ -#line 623 "antimony.ypp" + case 217: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ +#line 626 "antimony.ypp" {} -#line 3549 "antimony.tab.cpp" +#line 3590 "antimony.tab.cpp" break; - case 215: /* $@11: %empty */ -#line 624 "antimony.ypp" + case 218: /* $@11: %empty */ +#line 627 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula), (yyvsp[-5].variable))) YYABORT;} -#line 3555 "antimony.tab.cpp" +#line 3596 "antimony.tab.cpp" break; - case 216: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ -#line 624 "antimony.ypp" + case 219: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ +#line 627 "antimony.ypp" {} -#line 3561 "antimony.tab.cpp" +#line 3602 "antimony.tab.cpp" break; - case 217: /* colonret: ':' */ -#line 627 "antimony.ypp" + case 220: /* colonret: ':' */ +#line 630 "antimony.ypp" {} -#line 3567 "antimony.tab.cpp" +#line 3608 "antimony.tab.cpp" break; - case 218: /* colonret: colonret '\n' */ -#line 628 "antimony.ypp" + case 221: /* colonret: colonret '\n' */ +#line 631 "antimony.ypp" {} -#line 3573 "antimony.tab.cpp" +#line 3614 "antimony.tab.cpp" break; - case 219: /* eventmodifications: %empty */ -#line 631 "antimony.ypp" + case 222: /* eventmodifications: %empty */ +#line 634 "antimony.ypp" {} -#line 3579 "antimony.tab.cpp" +#line 3620 "antimony.tab.cpp" break; - case 220: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ -#line 632 "antimony.ypp" + case 223: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ +#line 635 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "priority")) {g_registry.GetCurrentEvent()->SetPriority(*(yyvsp[0].formula));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "t0")) {if (g_registry.GetCurrentEvent()->SetInitialValue(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "fromTrigger")) {if (g_registry.GetCurrentEvent()->SetUseValuesFromTriggerTime(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "persistent")) {if (g_registry.GetCurrentEvent()->SetPersistent(*(yyvsp[0].formula))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in event defintion. You may use the terms 'priority', 't0', 'fromTrigger', and 'persistent' here to set those properties of an event."); YYABORT;}} -#line 3589 "antimony.tab.cpp" +#line 3630 "antimony.tab.cpp" break; - case 221: /* assignmentlist: variable '=' formula */ -#line 639 "antimony.ypp" + case 224: /* assignmentlist: variable '=' formula */ +#line 642 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3595 "antimony.tab.cpp" +#line 3636 "antimony.tab.cpp" break; - case 222: /* assignmentlist: variable '=' formula ':' assignmentlist */ -#line 640 "antimony.ypp" + case 225: /* assignmentlist: variable '=' formula ':' assignmentlist */ +#line 643 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3601 "antimony.tab.cpp" +#line 3642 "antimony.tab.cpp" break; - case 223: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ -#line 641 "antimony.ypp" + case 226: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ +#line 644 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3607 "antimony.tab.cpp" +#line 3648 "antimony.tab.cpp" break; - case 224: /* assignmentlist: variable '=' formula ',' assignmentlist */ -#line 642 "antimony.ypp" + case 227: /* assignmentlist: variable '=' formula ',' assignmentlist */ +#line 645 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3613 "antimony.tab.cpp" +#line 3654 "antimony.tab.cpp" break; - case 225: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ -#line 643 "antimony.ypp" + case 228: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ +#line 646 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3619 "antimony.tab.cpp" +#line 3660 "antimony.tab.cpp" break; - case 226: /* deletion: "'delete'" variable */ -#line 646 "antimony.ypp" + case 229: /* deletion: "'delete'" variable */ +#line 649 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3625 "antimony.tab.cpp" +#line 3666 "antimony.tab.cpp" break; - case 227: /* deletion: deletion ',' variable */ -#line 647 "antimony.ypp" + case 230: /* deletion: deletion ',' variable */ +#line 650 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3631 "antimony.tab.cpp" +#line 3672 "antimony.tab.cpp" break; - case 228: /* unitdef: formula */ -#line 650 "antimony.ypp" + case 231: /* unitdef: formula */ +#line 653 "antimony.ypp" { if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[0].formula)->IsSingleVariable()) { @@ -3645,125 +3686,125 @@ yyparse (void) (yyval.variable) = g_registry.CurrentModule()->AddOrFindUnitDef(ud); } } -#line 3649 "antimony.tab.cpp" +#line 3690 "antimony.tab.cpp" break; - case 229: /* constraint: "number" inequality formula */ -#line 665 "antimony.ypp" + case 232: /* constraint: "number" inequality formula */ +#line 668 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3655 "antimony.tab.cpp" +#line 3696 "antimony.tab.cpp" break; - case 230: /* constraint: '-' "number" inequality formula */ -#line 666 "antimony.ypp" + case 233: /* constraint: '-' "number" inequality formula */ +#line 669 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint(-(yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3661 "antimony.tab.cpp" +#line 3702 "antimony.tab.cpp" break; - case 231: /* constraint: "name of a pre-defined constant" inequality formula */ -#line 667 "antimony.ypp" + case 234: /* constraint: "name of a pre-defined constant" inequality formula */ +#line 670 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3667 "antimony.tab.cpp" +#line 3708 "antimony.tab.cpp" break; - case 232: /* constraint: "element name" inequality formula */ -#line 668 "antimony.ypp" + case 235: /* constraint: "element name" inequality formula */ +#line 671 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3673 "antimony.tab.cpp" +#line 3714 "antimony.tab.cpp" break; - case 233: /* constraint: "'constraint'" ':' formula */ -#line 669 "antimony.ypp" + case 236: /* constraint: "'constraint'" ':' formula */ +#line 672 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[0].formula))) YYABORT;} -#line 3679 "antimony.tab.cpp" +#line 3720 "antimony.tab.cpp" break; - case 234: /* constraint: "'constraint'" variable ':' formula */ -#line 670 "antimony.ypp" + case 237: /* constraint: "'constraint'" variable ':' formula */ +#line 673 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3685 "antimony.tab.cpp" +#line 3726 "antimony.tab.cpp" break; - case 235: /* objective: maxormin formula */ -#line 673 "antimony.ypp" + case 238: /* objective: maxormin formula */ +#line 676 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3691 "antimony.tab.cpp" +#line 3732 "antimony.tab.cpp" break; - case 236: /* maxormin: "'maximize'" */ -#line 676 "antimony.ypp" + case 239: /* maxormin: "'maximize'" */ +#line 679 "antimony.ypp" {(yyval.maxormin) = true;} -#line 3697 "antimony.tab.cpp" +#line 3738 "antimony.tab.cpp" break; - case 237: /* maxormin: "'minimize'" */ -#line 677 "antimony.ypp" + case 240: /* maxormin: "'minimize'" */ +#line 680 "antimony.ypp" {(yyval.maxormin) = false;} -#line 3703 "antimony.tab.cpp" +#line 3744 "antimony.tab.cpp" break; - case 238: /* stringlist: "text string" */ -#line 680 "antimony.ypp" + case 241: /* stringlist: "text string" */ +#line 683 "antimony.ypp" { (yyval.stringlist) = new std::vector(); (yyval.stringlist)->push_back(*((yyvsp[0].word))); } -#line 3709 "antimony.tab.cpp" +#line 3750 "antimony.tab.cpp" break; - case 239: /* stringlist: stringlist ',' "text string" */ -#line 681 "antimony.ypp" + case 242: /* stringlist: stringlist ',' "text string" */ +#line 684 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-2].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3715 "antimony.tab.cpp" +#line 3756 "antimony.tab.cpp" break; - case 240: /* stringlist: stringlist ',' '\n' "text string" */ -#line 682 "antimony.ypp" + case 243: /* stringlist: stringlist ',' '\n' "text string" */ +#line 685 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-3].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3721 "antimony.tab.cpp" +#line 3762 "antimony.tab.cpp" break; - case 241: /* $@12: %empty */ -#line 684 "antimony.ypp" + case 244: /* $@12: %empty */ +#line 687 "antimony.ypp" {if (g_registry.SetCurrentModuleIf((yyvsp[0].word), (yyvsp[-1].word))) YYABORT;} -#line 3727 "antimony.tab.cpp" +#line 3768 "antimony.tab.cpp" break; - case 242: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ -#line 684 "antimony.ypp" + case 245: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ +#line 687 "antimony.ypp" {g_registry.RevertToPreviousModule();} -#line 3733 "antimony.tab.cpp" +#line 3774 "antimony.tab.cpp" break; - case 243: /* annotations: %empty */ -#line 687 "antimony.ypp" + case 246: /* annotations: %empty */ +#line 690 "antimony.ypp" {} -#line 3739 "antimony.tab.cpp" +#line 3780 "antimony.tab.cpp" break; - case 244: /* annotations: "element name" ':' stringlist */ -#line 688 "antimony.ypp" + case 247: /* annotations: "element name" ':' stringlist */ +#line 691 "antimony.ypp" {string modname = g_registry.CurrentModuleName(); g_registry.ProcessGlobalCVTerm(&modname, (yyvsp[-2].word), (yyvsp[0].stringlist));} -#line 3745 "antimony.tab.cpp" +#line 3786 "antimony.tab.cpp" break; - case 245: /* cvterm: variable "element name" stringlist */ -#line 693 "antimony.ypp" + case 248: /* cvterm: variable "element name" stringlist */ +#line 696 "antimony.ypp" {if (g_registry.CurrentModule()->ProcessCVTerm((yyvsp[-2].variable),(yyvsp[-1].word),(yyvsp[0].stringlist))) YYABORT;} -#line 3751 "antimony.tab.cpp" +#line 3792 "antimony.tab.cpp" break; - case 246: /* cvterm: variable "element name" '.' "element name" stringlist */ -#line 694 "antimony.ypp" + case 249: /* cvterm: variable "element name" '.' "element name" stringlist */ +#line 697 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].stringlist))) YYABORT;} -#line 3757 "antimony.tab.cpp" +#line 3798 "antimony.tab.cpp" break; - case 247: /* cvterm: variable "element name" '.' "element name" "number" */ -#line 695 "antimony.ypp" + case 250: /* cvterm: variable "element name" '.' "element name" "number" */ +#line 698 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].num))) YYABORT;} -#line 3763 "antimony.tab.cpp" +#line 3804 "antimony.tab.cpp" break; - case 248: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ -#line 699 "antimony.ypp" + case 251: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ +#line 702 "antimony.ypp" { Module* module = g_registry.GetModule(*(yyvsp[-4].word)); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); @@ -3773,11 +3814,11 @@ yyparse (void) YYABORT; } } -#line 3777 "antimony.tab.cpp" +#line 3818 "antimony.tab.cpp" break; - case 249: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ -#line 710 "antimony.ypp" + case 252: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ +#line 713 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { function->SetSBOTerm(lround((yyvsp[0].num))); @@ -3787,11 +3828,11 @@ yyparse (void) YYABORT; } } -#line 3791 "antimony.tab.cpp" +#line 3832 "antimony.tab.cpp" break; - case 250: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ -#line 720 "antimony.ypp" + case 253: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ +#line 723 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; @@ -3801,11 +3842,11 @@ yyparse (void) YYABORT; } } -#line 3805 "antimony.tab.cpp" +#line 3846 "antimony.tab.cpp" break; - case 251: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "name of a pre-defined constant" */ -#line 730 "antimony.ypp" + case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "name of a pre-defined constant" */ +#line 733 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; @@ -3815,11 +3856,11 @@ yyparse (void) YYABORT; } } -#line 3819 "antimony.tab.cpp" +#line 3860 "antimony.tab.cpp" break; - case 252: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ -#line 740 "antimony.ypp" + case 255: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ +#line 743 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; @@ -3833,11 +3874,11 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 3837 "antimony.tab.cpp" +#line 3878 "antimony.tab.cpp" break; - case 253: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ -#line 754 "antimony.ypp" + case 256: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ +#line 757 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; @@ -3851,11 +3892,11 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 3855 "antimony.tab.cpp" +#line 3896 "antimony.tab.cpp" break; - case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ -#line 768 "antimony.ypp" + case 257: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ +#line 771 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -3869,11 +3910,11 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 3873 "antimony.tab.cpp" +#line 3914 "antimony.tab.cpp" break; - case 255: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ -#line 782 "antimony.ypp" + case 258: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ +#line 785 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -3887,47 +3928,47 @@ yyparse (void) } module->SetAutoLayout("on"); } -#line 3891 "antimony.tab.cpp" +#line 3932 "antimony.tab.cpp" break; - case 256: /* modulename: "name of an existing module" "'is'" "text string" lineend */ -#line 798 "antimony.ypp" + case 259: /* modulename: "name of an existing module" "'is'" "text string" lineend */ +#line 801 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3897 "antimony.tab.cpp" +#line 3938 "antimony.tab.cpp" break; - case 257: /* functionname: "name of an existing function" "'is'" "text string" lineend */ -#line 800 "antimony.ypp" + case 260: /* functionname: "name of an existing function" "'is'" "text string" lineend */ +#line 803 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3903 "antimony.tab.cpp" +#line 3944 "antimony.tab.cpp" break; - case 258: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ -#line 803 "antimony.ypp" + case 261: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ +#line 806 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3909 "antimony.tab.cpp" +#line 3950 "antimony.tab.cpp" break; - case 259: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ -#line 804 "antimony.ypp" + case 262: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ +#line 807 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT;} -#line 3915 "antimony.tab.cpp" +#line 3956 "antimony.tab.cpp" break; - case 260: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ -#line 805 "antimony.ypp" + case 263: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ +#line 808 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT;} -#line 3921 "antimony.tab.cpp" +#line 3962 "antimony.tab.cpp" break; - case 261: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ -#line 806 "antimony.ypp" + case 264: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ +#line 809 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3927 "antimony.tab.cpp" +#line 3968 "antimony.tab.cpp" break; -#line 3931 "antimony.tab.cpp" +#line 3972 "antimony.tab.cpp" default: break; } @@ -4151,7 +4192,7 @@ yyparse (void) return yyresult; } -#line 808 "antimony.ypp" +#line 811 "antimony.ypp" diff --git a/src/antimony.ypp b/src/antimony.ypp index 1657e59f..35f45da4 100644 --- a/src/antimony.ypp +++ b/src/antimony.ypp @@ -553,6 +553,7 @@ specinit: SPECIES varmaybeis {g_registry.SetConstness(constDEFAULT); g_reg | VARWORD SUBSTONLY SPECIES varmaybeis {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(true); $4->SetRegSpecVals(); if ($4->SetType(varSpeciesUndef)) YYABORT; } | CONSTWORD SUBSTONLY SPECIES varmaybeis {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(true); $4->SetRegSpecVals(); if ($4->SetType(varSpeciesUndef)) YYABORT; } | specinit ',' varmaybeis {$3->SetRegSpecVals(); if ($3->SetType(varSpeciesUndef)) YYABORT; } + | SPECIES '.' ANTWORD '=' formula {if (g_registry.CurrentModule()->AddSpeciesLayoutInfo($3, $5)) YYABORT;} ; formulainit: FORMULA varmaybeis {g_registry.SetConstness(constDEFAULT); $2->SetRegConst(); if ($2->SetType(varFormulaUndef)) YYABORT; } @@ -565,6 +566,7 @@ reactioninit: REACTION varmaybeis {g_registry.SetConstness(constDEFAULT); $2-> | VARWORD REACTION varmaybeis {g_registry.SetConstness(constVAR); $3->SetRegConst(); if ($3->SetType(varReactionUndef)) YYABORT; } | CONSTWORD REACTION {g_registry.SetError("Reactions may not be set 'const'."); YYABORT; } | reactioninit ',' varmaybeis {$3->SetRegConst(); if ($3->SetType(varReactionUndef)) YYABORT; } + | REACTION '.' ANTWORD '=' formula {if (g_registry.CurrentModule()->AddReactionLayoutInfo($3, $5)) YYABORT;} ; dnainit: DNA varmaybeis {g_registry.SetConstness(constDEFAULT); $2->SetRegConst(); if ($2->SetType(varDNA)) YYABORT; } @@ -590,6 +592,7 @@ compartmentinit: | VARWORD COMPARTMENT varmaybeis {g_registry.SetConstness(constVAR); $3->SetRegConst(); if ($3->SetType(varCompartment)) YYABORT; } | CONSTWORD COMPARTMENT varmaybeis {g_registry.SetConstness(constCONST); $3->SetRegConst(); if ($3->SetType(varCompartment)) YYABORT; } | compartmentinit ',' varmaybeis {$3->SetRegConst(); if ($3->SetType(varCompartment)) YYABORT; } + | COMPARTMENT '.' ANTWORD '=' formula {if (g_registry.CurrentModule()->AddCompartmentLayoutInfo($3, $5)) YYABORT;} ; varconstinit: VARWORD varmaybeis {g_registry.SetConstness(constVAR); $2->SetRegConst();} diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index b7058141..996c7cea 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -33,6 +33,21 @@ LayoutWrapper::LayoutWrapper(Variable* parent, layout_type type) SetNamespace(parent->GetNamespace()); } +LayoutWrapper::LayoutWrapper(layout_type type) + : Variable() + , m_layout_type(type) +{ + m_displayname = ""; + m_formulatype = formulaINITIAL; + m_supercomptype = varUndefined; + m_deletedunit = false; + m_replacedformrxn = false; + m_const = constDEFAULT; + m_substOnly = false; + m_sboTermWrapper = NULL; + m_type = varLayoutWrapper; +} + LayoutWrapper::~LayoutWrapper() { } @@ -303,6 +318,226 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const return false; } +bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string& group) const +{ + assert(group == "species" || group == "reaction" || group == "compartment"); + string formstring = m_valFormula.ToSBMLString(); + ASTNode* astn = parseStringToASTNode(formstring); + string error = "Unable to set " + group + "." + LayoutTypeToString(m_layout_type) + " to " + formstring + "."; + if (IsPair(m_layout_type)) { + //The content should already be checked. + assert(astn->getNumChildren() == 2); + double xval = astn->getChild(0)->getValue(); + double yval = astn->getChild(1)->getValue(); + int ret1 = 0; + int ret2 = 0; + assert(m_layout_type == lt_size); + if (group == "species") { + //ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, xval); + //ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, yval); + } + else if (group == "compartment") { + //ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, xval); + //ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, yval); + } + else if (group == "reaction") { + //ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, xval); + //ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, yval); + } + if (ret1 == -1 || ret2 == -1) { + g_registry.SetError(error); + return true; + } + } + else { + double lval = astn->getValue(); + int ret = 0; + switch (m_layout_type) { + case lt_x: + case lt_y: + assert(false); + return true; + case lt_height: + //if (group == "species") { + // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, lval); + //} + //else if (group == "compartment") { + // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, lval); + //} + //else if (group == "reaction") { + // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, lval); + //} + break; + case lt_width: + //if (group == "species") { + // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, lval); + //} + //else if (group == "compartment") { + // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, lval); + //} + //else if (group == "reaction") { + // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, lval); + //} + break; + case lt_color: + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFillColor(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFillColor(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFillColor(sbml, 0, formstring); + } + break; + case lt_font: + { + std::regex underscore_re("_"); + formstring = std::regex_replace(formstring, underscore_re, "-"); + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontFamily(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontFamily(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontFamily(sbml, 0, formstring); + } + break; + } + case lt_fontsize: + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontSize(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontSize(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontSize(sbml, 0, formstring); + } + break; + case lt_fontcolor: + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontColor(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontColor(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontColor(sbml, 0, formstring); + } + break; + case lt_fontstyle: + case lt_fontweight: + if (CaselessStrCmp(false, formstring, "bold")) { + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontWeight(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontWeight(sbml, 0, formstring); + } + } + if (CaselessStrCmp(false, formstring, "italic")) { + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontStyle(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontStyle(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontStyle(sbml, 0, formstring); + } + } + if (CaselessStrCmp(false, formstring, "normal")) { + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontWeight(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontWeight(sbml, 0, formstring); + } + if (ret == 0) { + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontStyle(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontStyle(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontStyle(sbml, 0, formstring); + } + } + } + if (CaselessStrCmp(false, formstring, "bold_italic")) { + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontWeight(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontWeight(sbml, 0, formstring); + } + if (ret == 0) { + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontStyle(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontStyle(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontStyle(sbml, 0, formstring); + } + } + } + break; + case lt_linewidth: + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesStrokeWidth(sbml, 0, lval); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentStrokeWidth(sbml, 0, lval); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionStrokeWidth(sbml, 0, lval); + } + break; + case lt_linecolor: + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesStrokeColor(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentStrokeColor(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionStrokeColor(sbml, 0, formstring); + } + break; + case lt_shape: + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesGeometricShapeType(sbml, 0, formstring); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentGeometricShapeType(sbml, 0, formstring); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionGeometricShapeType(sbml, 0, formstring); + } + break; + case lt_unknown: + break; + } + } + + + return false; +} + bool LayoutWrapper::HasLayoutPositionInfo() const { switch (m_layout_type) { diff --git a/src/layoutWrapper.h b/src/layoutWrapper.h index 1183b7ee..35238cc8 100644 --- a/src/layoutWrapper.h +++ b/src/layoutWrapper.h @@ -13,6 +13,7 @@ class LayoutWrapper : public Variable layout_type m_layout_type; public: LayoutWrapper(Variable* parent, layout_type type); + LayoutWrapper(layout_type type); ~LayoutWrapper(); bool IsPointer() const; @@ -27,6 +28,7 @@ class LayoutWrapper : public Variable virtual bool Synchronize(Variable* clone, const Variable* conversionFactor); virtual std::string CreatelayoutParamsAntimonySyntax(const std::string& indent) const; virtual bool TransferLayoutInformationTo(libsbml::SBMLDocument* sbml) const; + bool TransferLayoutInformationTo(libsbml::SBMLDocument* sbml, const std::string& group) const; virtual bool HasLayoutPositionInfo() const; }; diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index a2ac6c08..dee6c58f 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2482,6 +2482,15 @@ void Module::CreateSBMLModel(bool comp) if (m_layout.align_top.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top"); } + for (size_t sl = 0; sl < m_speciesLayouts.size(); sl++) { + m_speciesLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "species"); + } + for (size_t sl = 0; sl < m_compartmentLayouts.size(); sl++) { + m_compartmentLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "compartment"); + } + for (size_t sl = 0; sl < m_reactionLayouts.size(); sl++) { + m_reactionLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "reaction"); + } for (size_t v = 0; v < m_uniquevars.size(); v++) { if (m_uniquevars[v]->TransferLayoutInformationTo(&m_sbml)) { assert(false); diff --git a/src/module.cpp b/src/module.cpp index 92dbb9ea..ffb6f25a 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -16,6 +16,7 @@ #include "typex.h" #include "unitdef.h" #include "stringx.h" +#include "layoutWrapper.h" #ifndef NCELLML #include #include @@ -1274,6 +1275,10 @@ bool Module::Finalize() } } + if (m_speciesLayouts.size() || m_compartmentLayouts.size() || m_reactionLayouts.size()) { + m_autolayout.use = true; + } + #endif //Phase 3: Set compartments @@ -3369,6 +3374,70 @@ bool Module::SetLayout(const std::string* argument, const std::vector* v return ret; } +LayoutWrapper* CreateAndCheckLayoutWrapper(const std::string* type, Formula* formula, const string& group) +{ + layout_type ltype = LayoutStringToType(*type); + switch (ltype) { + case lt_x: + case lt_y: + case lt_position: + g_registry.SetError("Unable to set " + group + "." + *type + ": the position of each " + group + " is unique, so cannot collectively have a single position."); + return NULL; + case lt_unknown: + g_registry.SetError("Unable to set " + group + "." + *type + ": the allowed options here are 'height', 'width', 'size', 'color', 'font', 'fontsize', 'fontcolor' 'fontstyle', 'linewidth', 'linecolor', and 'shape'."); + return NULL; + case lt_height: + case lt_width: + case lt_size: + case lt_color: + case lt_font: + case lt_fontsize: + case lt_fontcolor: + case lt_fontstyle: + case lt_fontweight: + case lt_linewidth: + case lt_linecolor: + case lt_shape: + break; + } + LayoutWrapper* lw = new LayoutWrapper(ltype); + if (lw->SetFormula(formula)) { + delete lw; + return NULL; + } + return lw; +} + +bool Module::AddSpeciesLayoutInfo(const std::string* type, Formula* formula) +{ + LayoutWrapper* lw = CreateAndCheckLayoutWrapper(type, formula, "species"); + if (lw == NULL) { + return true; + } + m_speciesLayouts.push_back(lw); + return false; +} + +bool Module::AddCompartmentLayoutInfo(const std::string* type, Formula* formula) +{ + LayoutWrapper* lw = CreateAndCheckLayoutWrapper(type, formula, "compartment"); + if (lw == NULL) { + return true; + } + m_compartmentLayouts.push_back(lw); + return false; +} + +bool Module::AddReactionLayoutInfo(const std::string* type, Formula* formula) +{ + LayoutWrapper* lw = CreateAndCheckLayoutWrapper(type, formula, "reaction"); + if (lw == NULL) { + return true; + } + m_reactionLayouts.push_back(lw); + return false; +} + string Module::ValidateLayoutArgument(const string* argument) { diff --git a/src/module.h b/src/module.h index dfd452c5..2a3f4a64 100644 --- a/src/module.h +++ b/src/module.h @@ -28,6 +28,7 @@ enum tree_direction {td_UP, td_DOWN, td_SIDEWAYS}; #include "sboTermWrapper.h" class ReactionList; +class LayoutWrapper; struct autolayout { bool use = false; @@ -95,6 +96,9 @@ class Module : public Annotated bool m_hasFBC; autolayout m_autolayout; layout m_layout; + std::vector m_speciesLayouts; + std::vector m_compartmentLayouts; + std::vector m_reactionLayouts; #endif #ifndef NCELLML @@ -201,6 +205,10 @@ class Module : public Annotated virtual bool SetLayout(const std::string* argument, const std::vector* values); virtual bool SetLayout(const std::string* argument, const std::vector* values); + virtual bool AddSpeciesLayoutInfo(const std::string* type, Formula* formula); + virtual bool AddCompartmentLayoutInfo(const std::string* type, Formula* formula); + virtual bool AddReactionLayoutInfo(const std::string* type, Formula* formula); + //Output for the API bool Finalize(); From 3dc6a672989383fa471fe4988ec2a63de195586d Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Wed, 17 Jul 2024 16:37:30 -0700 Subject: [PATCH 05/43] Fix error messages for group layout information. --- src/antimony.tab.cpp | 276 +++++++++++++++++++++--------------------- src/antimony.ypp | 1 - src/layoutWrapper.cpp | 12 +- src/layoutWrapper.h | 2 +- src/module.cpp | 2 +- 5 files changed, 150 insertions(+), 143 deletions(-) diff --git a/src/antimony.tab.cpp b/src/antimony.tab.cpp index 7e4ec003..f2b4d483 100644 --- a/src/antimony.tab.cpp +++ b/src/antimony.tab.cpp @@ -798,19 +798,19 @@ static const yytype_int16 yyrline[] = 468, 469, 470, 471, 472, 475, 476, 479, 480, 481, 482, 483, 484, 485, 488, 489, 490, 491, 492, 495, 496, 497, 500, 501, 502, 503, 504, 505, 506, 507, - 508, 512, 513, 516, 516, 517, 517, 521, 522, 523, - 524, 525, 529, 530, 534, 538, 539, 540, 541, 542, - 543, 544, 545, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 559, 560, 561, 562, 565, 566, 567, 568, - 569, 572, 573, 574, 575, 578, 579, 580, 581, 584, - 585, 586, 587, 591, 592, 593, 594, 595, 598, 599, - 600, 603, 606, 609, 610, 613, 614, 615, 616, 617, - 620, 621, 624, 624, 625, 625, 626, 626, 627, 627, - 630, 631, 634, 635, 642, 643, 644, 645, 646, 649, - 650, 653, 668, 669, 670, 671, 672, 673, 676, 679, - 680, 683, 684, 685, 687, 687, 690, 691, 696, 697, - 698, 701, 712, 722, 732, 742, 756, 770, 784, 800, - 802, 806, 807, 808, 809 + 508, 511, 512, 515, 515, 516, 516, 520, 521, 522, + 523, 524, 528, 529, 533, 537, 538, 539, 540, 541, + 542, 543, 544, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 558, 559, 560, 561, 564, 565, 566, 567, + 568, 571, 572, 573, 574, 577, 578, 579, 580, 583, + 584, 585, 586, 590, 591, 592, 593, 594, 597, 598, + 599, 602, 605, 608, 609, 612, 613, 614, 615, 616, + 619, 620, 623, 623, 624, 624, 625, 625, 626, 626, + 629, 630, 633, 634, 641, 642, 643, 644, 645, 648, + 649, 652, 667, 668, 669, 670, 671, 672, 675, 678, + 679, 682, 683, 684, 686, 686, 689, 690, 695, 696, + 697, 700, 711, 721, 731, 741, 755, 769, 783, 799, + 801, 805, 806, 807, 808 }; #endif @@ -3122,79 +3122,79 @@ yyparse (void) break; case 141: /* algrule: "number" '=' formula */ -#line 512 "antimony.ypp" +#line 511 "antimony.ypp" {if (g_registry.AddNewAlgebraicRuleToCurrent((yyvsp[-2].num), (yyvsp[0].formula))) YYABORT; } #line 3128 "antimony.tab.cpp" break; case 142: /* algrule: varmaybein ':' "number" '=' formula */ -#line 513 "antimony.ypp" +#line 512 "antimony.ypp" {if ((yyvsp[-4].variable)->SetAlgebraicRule((yyvsp[-2].num), (yyvsp[0].formula)) ) YYABORT;} #line 3134 "antimony.tab.cpp" break; case 143: /* $@6: %empty */ -#line 516 "antimony.ypp" +#line 515 "antimony.ypp" {if ((yyvsp[-3].variable)->SetModule((yyvsp[-1].word))) YYABORT;} #line 3140 "antimony.tab.cpp" break; case 144: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ -#line 516 "antimony.ypp" +#line 515 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if ((yyvsp[-8].variable)->SetCompartment((yyvsp[0].variable))) YYABORT;}} #line 3146 "antimony.tab.cpp" break; case 145: /* $@7: %empty */ -#line 517 "antimony.ypp" +#line 516 "antimony.ypp" {if(g_registry.CurrentModule()->SetModule((yyvsp[-1].word))) YYABORT;} #line 3152 "antimony.tab.cpp" break; case 146: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ -#line 517 "antimony.ypp" +#line 516 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if (g_registry.GetCurrentSubmodel()->SetCompartment((yyvsp[0].variable))) YYABORT;}} #line 3158 "antimony.tab.cpp" break; case 147: /* variableimportlist: %empty */ -#line 521 "antimony.ypp" +#line 520 "antimony.ypp" {} #line 3164 "antimony.tab.cpp" break; case 148: /* variableimportlist: variable */ -#line 522 "antimony.ypp" +#line 521 "antimony.ypp" {if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } #line 3170 "antimony.tab.cpp" break; case 149: /* variableimportlist: variableimportlist ',' variable */ -#line 523 "antimony.ypp" +#line 522 "antimony.ypp" { if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } #line 3176 "antimony.tab.cpp" break; case 150: /* variableimportlist: "number" */ -#line 524 "antimony.ypp" +#line 523 "antimony.ypp" {if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } #line 3182 "antimony.tab.cpp" break; case 151: /* variableimportlist: variableimportlist ',' "number" */ -#line 525 "antimony.ypp" +#line 524 "antimony.ypp" { if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } #line 3188 "antimony.tab.cpp" break; case 152: /* submodifications: %empty */ -#line 529 "antimony.ypp" +#line 528 "antimony.ypp" {} #line 3194 "antimony.tab.cpp" break; case 153: /* submodifications: submodifications ',' "element name" '=' variable */ -#line 530 "antimony.ypp" +#line 529 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].variable));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].variable))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} @@ -3202,7 +3202,7 @@ yyparse (void) break; case 154: /* submodifications: submodifications ',' "element name" '=' "number" */ -#line 534 "antimony.ypp" +#line 533 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].num));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].num))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} @@ -3210,283 +3210,283 @@ yyparse (void) break; case 155: /* varinitialize: specinit */ -#line 538 "antimony.ypp" +#line 537 "antimony.ypp" { } #line 3216 "antimony.tab.cpp" break; case 156: /* varinitialize: formulainit */ -#line 539 "antimony.ypp" +#line 538 "antimony.ypp" { } #line 3222 "antimony.tab.cpp" break; case 157: /* varinitialize: reactioninit */ -#line 540 "antimony.ypp" +#line 539 "antimony.ypp" { } #line 3228 "antimony.tab.cpp" break; case 158: /* varinitialize: dnainit */ -#line 541 "antimony.ypp" +#line 540 "antimony.ypp" { } #line 3234 "antimony.tab.cpp" break; case 159: /* varinitialize: geneinit */ -#line 542 "antimony.ypp" +#line 541 "antimony.ypp" { } #line 3240 "antimony.tab.cpp" break; case 160: /* varinitialize: operatorinit */ -#line 543 "antimony.ypp" +#line 542 "antimony.ypp" { } #line 3246 "antimony.tab.cpp" break; case 161: /* varinitialize: compartmentinit */ -#line 544 "antimony.ypp" +#line 543 "antimony.ypp" { } #line 3252 "antimony.tab.cpp" break; case 162: /* varinitialize: varconstinit */ -#line 545 "antimony.ypp" +#line 544 "antimony.ypp" { } #line 3258 "antimony.tab.cpp" break; case 163: /* specinit: "'species'" varmaybeis */ -#line 548 "antimony.ypp" +#line 547 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3264 "antimony.tab.cpp" break; case 164: /* specinit: "'var'" "'species'" varmaybeis */ -#line 549 "antimony.ypp" +#line 548 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3270 "antimony.tab.cpp" break; case 165: /* specinit: "'const'" "'species'" varmaybeis */ -#line 550 "antimony.ypp" +#line 549 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3276 "antimony.tab.cpp" break; case 166: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ -#line 551 "antimony.ypp" +#line 550 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3282 "antimony.tab.cpp" break; case 167: /* specinit: "'substanceOnly'" varmaybeis */ -#line 552 "antimony.ypp" +#line 551 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3288 "antimony.tab.cpp" break; case 168: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ -#line 553 "antimony.ypp" +#line 552 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3294 "antimony.tab.cpp" break; case 169: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ -#line 554 "antimony.ypp" +#line 553 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3300 "antimony.tab.cpp" break; case 170: /* specinit: specinit ',' varmaybeis */ -#line 555 "antimony.ypp" +#line 554 "antimony.ypp" {(yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } #line 3306 "antimony.tab.cpp" break; case 171: /* specinit: "'species'" '.' "element name" '=' formula */ -#line 556 "antimony.ypp" +#line 555 "antimony.ypp" {if (g_registry.CurrentModule()->AddSpeciesLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} #line 3312 "antimony.tab.cpp" break; case 172: /* formulainit: "'formula'" varmaybeis */ -#line 559 "antimony.ypp" +#line 558 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } #line 3318 "antimony.tab.cpp" break; case 173: /* formulainit: "'var'" "'formula'" varmaybeis */ -#line 560 "antimony.ypp" +#line 559 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } #line 3324 "antimony.tab.cpp" break; case 174: /* formulainit: "'const'" "'formula'" varmaybeis */ -#line 561 "antimony.ypp" +#line 560 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } #line 3330 "antimony.tab.cpp" break; case 175: /* formulainit: formulainit ',' varmaybeis */ -#line 562 "antimony.ypp" +#line 561 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } #line 3336 "antimony.tab.cpp" break; case 176: /* reactioninit: "'reaction'" varmaybeis */ -#line 565 "antimony.ypp" +#line 564 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } #line 3342 "antimony.tab.cpp" break; case 177: /* reactioninit: "'var'" "'reaction'" varmaybeis */ -#line 566 "antimony.ypp" +#line 565 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } #line 3348 "antimony.tab.cpp" break; case 178: /* reactioninit: "'const'" "'reaction'" */ -#line 567 "antimony.ypp" +#line 566 "antimony.ypp" {g_registry.SetError("Reactions may not be set 'const'."); YYABORT; } #line 3354 "antimony.tab.cpp" break; case 179: /* reactioninit: reactioninit ',' varmaybeis */ -#line 568 "antimony.ypp" +#line 567 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } #line 3360 "antimony.tab.cpp" break; case 180: /* reactioninit: "'reaction'" '.' "element name" '=' formula */ -#line 569 "antimony.ypp" +#line 568 "antimony.ypp" {if (g_registry.CurrentModule()->AddReactionLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} #line 3366 "antimony.tab.cpp" break; case 181: /* dnainit: "'DNA'" varmaybeis */ -#line 572 "antimony.ypp" +#line 571 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } #line 3372 "antimony.tab.cpp" break; case 182: /* dnainit: "'var'" "'DNA'" varmaybeis */ -#line 573 "antimony.ypp" +#line 572 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } #line 3378 "antimony.tab.cpp" break; case 183: /* dnainit: "'const'" "'DNA'" varmaybeis */ -#line 574 "antimony.ypp" +#line 573 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } #line 3384 "antimony.tab.cpp" break; case 184: /* dnainit: dnainit ',' varmaybeis */ -#line 575 "antimony.ypp" +#line 574 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } #line 3390 "antimony.tab.cpp" break; case 185: /* geneinit: "'gene'" varmaybeis */ -#line 578 "antimony.ypp" +#line 577 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } #line 3396 "antimony.tab.cpp" break; case 186: /* geneinit: "'var'" "'gene'" varmaybeis */ -#line 579 "antimony.ypp" +#line 578 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } #line 3402 "antimony.tab.cpp" break; case 187: /* geneinit: "'const'" "'gene'" varmaybeis */ -#line 580 "antimony.ypp" +#line 579 "antimony.ypp" {g_registry.SetError("Genes may not be set 'const'."); YYABORT; } #line 3408 "antimony.tab.cpp" break; case 188: /* geneinit: geneinit ',' varmaybeis */ -#line 581 "antimony.ypp" +#line 580 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } #line 3414 "antimony.tab.cpp" break; case 189: /* operatorinit: "'operator'" varmaybeis */ -#line 584 "antimony.ypp" +#line 583 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } #line 3420 "antimony.tab.cpp" break; case 190: /* operatorinit: "'var'" "'operator'" varmaybeis */ -#line 585 "antimony.ypp" +#line 584 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } #line 3426 "antimony.tab.cpp" break; case 191: /* operatorinit: "'const'" "'operator'" varmaybeis */ -#line 586 "antimony.ypp" +#line 585 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } #line 3432 "antimony.tab.cpp" break; case 192: /* operatorinit: operatorinit ',' varmaybeis */ -#line 587 "antimony.ypp" +#line 586 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } #line 3438 "antimony.tab.cpp" break; case 193: /* compartmentinit: "'compartment'" varmaybeis */ -#line 591 "antimony.ypp" +#line 590 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } #line 3444 "antimony.tab.cpp" break; case 194: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ -#line 592 "antimony.ypp" +#line 591 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } #line 3450 "antimony.tab.cpp" break; case 195: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ -#line 593 "antimony.ypp" +#line 592 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } #line 3456 "antimony.tab.cpp" break; case 196: /* compartmentinit: compartmentinit ',' varmaybeis */ -#line 594 "antimony.ypp" +#line 593 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } #line 3462 "antimony.tab.cpp" break; case 197: /* compartmentinit: "'compartment'" '.' "element name" '=' formula */ -#line 595 "antimony.ypp" +#line 594 "antimony.ypp" {if (g_registry.CurrentModule()->AddCompartmentLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} #line 3468 "antimony.tab.cpp" break; case 198: /* varconstinit: "'var'" varmaybeis */ -#line 598 "antimony.ypp" +#line 597 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst();} #line 3474 "antimony.tab.cpp" break; case 199: /* varconstinit: "'const'" varmaybeis */ -#line 599 "antimony.ypp" +#line 598 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst();} #line 3480 "antimony.tab.cpp" break; case 200: /* varconstinit: varconstinit ',' varmaybeis */ -#line 600 "antimony.ypp" +#line 599 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst();} #line 3486 "antimony.tab.cpp" break; case 201: /* unitinit: "'unit'" variable '=' formula */ -#line 603 "antimony.ypp" +#line 602 "antimony.ypp" {if ((yyvsp[-2].variable)->SetType(varUnitDefinition)) YYABORT; if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[-2].variable)->GetUnitDef()->SetFromFormula((yyvsp[0].formula))) YYABORT;} @@ -3494,133 +3494,133 @@ yyparse (void) break; case 202: /* unitinit: "'unit'" variable */ -#line 606 "antimony.ypp" +#line 605 "antimony.ypp" {if ((yyvsp[0].variable)->SetType(varUnitDefinition)) YYABORT;} #line 3500 "antimony.tab.cpp" break; case 203: /* dnadef: dnastrand */ -#line 609 "antimony.ypp" +#line 608 "antimony.ypp" {if (g_registry.SaveWorkingStrand()) YYABORT;} #line 3506 "antimony.tab.cpp" break; case 204: /* dnadef: varmaybein ':' dnastrand */ -#line 610 "antimony.ypp" +#line 609 "antimony.ypp" {if (g_registry.SetStrandAs((yyvsp[-2].variable))) YYABORT;} #line 3512 "antimony.tab.cpp" break; case 205: /* dnastrand: "--" variable */ -#line 613 "antimony.ypp" +#line 612 "antimony.ypp" {if (g_registry.SetNewUpstreamOpen((yyvsp[0].variable))) YYABORT;} #line 3518 "antimony.tab.cpp" break; case 206: /* dnastrand: "--" dnamiddle */ -#line 614 "antimony.ypp" +#line 613 "antimony.ypp" {g_registry.SetOpenUpstream(); } #line 3524 "antimony.tab.cpp" break; case 207: /* dnastrand: dnamiddle variable */ -#line 615 "antimony.ypp" +#line 614 "antimony.ypp" {if (g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} #line 3530 "antimony.tab.cpp" break; case 208: /* dnastrand: "--" dnamiddle variable */ -#line 616 "antimony.ypp" +#line 615 "antimony.ypp" {g_registry.SetOpenUpstream(); if(g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} #line 3536 "antimony.tab.cpp" break; case 209: /* dnastrand: dnamiddle */ -#line 617 "antimony.ypp" +#line 616 "antimony.ypp" { } #line 3542 "antimony.tab.cpp" break; case 210: /* dnamiddle: variable "--" */ -#line 620 "antimony.ypp" +#line 619 "antimony.ypp" {if (g_registry.SetNewDownstreamOpen((yyvsp[-1].variable))) YYABORT;} #line 3548 "antimony.tab.cpp" break; case 211: /* dnamiddle: dnamiddle variable "--" */ -#line 621 "antimony.ypp" +#line 620 "antimony.ypp" {if (g_registry.SetDownstreamOpen((yyvsp[-1].variable))) YYABORT;} #line 3554 "antimony.tab.cpp" break; case 212: /* $@8: %empty */ -#line 624 "antimony.ypp" +#line 623 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula))) YYABORT;} #line 3560 "antimony.tab.cpp" break; case 213: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ -#line 624 "antimony.ypp" +#line 623 "antimony.ypp" {} #line 3566 "antimony.tab.cpp" break; case 214: /* $@9: %empty */ -#line 625 "antimony.ypp" +#line 624 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula))) YYABORT;} #line 3572 "antimony.tab.cpp" break; case 215: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ -#line 625 "antimony.ypp" +#line 624 "antimony.ypp" {} #line 3578 "antimony.tab.cpp" break; case 216: /* $@10: %empty */ -#line 626 "antimony.ypp" +#line 625 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula), (yyvsp[-3].variable))) YYABORT;} #line 3584 "antimony.tab.cpp" break; case 217: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ -#line 626 "antimony.ypp" +#line 625 "antimony.ypp" {} #line 3590 "antimony.tab.cpp" break; case 218: /* $@11: %empty */ -#line 627 "antimony.ypp" +#line 626 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula), (yyvsp[-5].variable))) YYABORT;} #line 3596 "antimony.tab.cpp" break; case 219: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ -#line 627 "antimony.ypp" +#line 626 "antimony.ypp" {} #line 3602 "antimony.tab.cpp" break; case 220: /* colonret: ':' */ -#line 630 "antimony.ypp" +#line 629 "antimony.ypp" {} #line 3608 "antimony.tab.cpp" break; case 221: /* colonret: colonret '\n' */ -#line 631 "antimony.ypp" +#line 630 "antimony.ypp" {} #line 3614 "antimony.tab.cpp" break; case 222: /* eventmodifications: %empty */ -#line 634 "antimony.ypp" +#line 633 "antimony.ypp" {} #line 3620 "antimony.tab.cpp" break; case 223: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ -#line 635 "antimony.ypp" +#line 634 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "priority")) {g_registry.GetCurrentEvent()->SetPriority(*(yyvsp[0].formula));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "t0")) {if (g_registry.GetCurrentEvent()->SetInitialValue(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "fromTrigger")) {if (g_registry.GetCurrentEvent()->SetUseValuesFromTriggerTime(*(yyvsp[0].formula))) YYABORT;} @@ -3630,49 +3630,49 @@ yyparse (void) break; case 224: /* assignmentlist: variable '=' formula */ -#line 642 "antimony.ypp" +#line 641 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} #line 3636 "antimony.tab.cpp" break; case 225: /* assignmentlist: variable '=' formula ':' assignmentlist */ -#line 643 "antimony.ypp" +#line 642 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} #line 3642 "antimony.tab.cpp" break; case 226: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ -#line 644 "antimony.ypp" +#line 643 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} #line 3648 "antimony.tab.cpp" break; case 227: /* assignmentlist: variable '=' formula ',' assignmentlist */ -#line 645 "antimony.ypp" +#line 644 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} #line 3654 "antimony.tab.cpp" break; case 228: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ -#line 646 "antimony.ypp" +#line 645 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} #line 3660 "antimony.tab.cpp" break; case 229: /* deletion: "'delete'" variable */ -#line 649 "antimony.ypp" +#line 648 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} #line 3666 "antimony.tab.cpp" break; case 230: /* deletion: deletion ',' variable */ -#line 650 "antimony.ypp" +#line 649 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} #line 3672 "antimony.tab.cpp" break; case 231: /* unitdef: formula */ -#line 653 "antimony.ypp" +#line 652 "antimony.ypp" { if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[0].formula)->IsSingleVariable()) { @@ -3690,121 +3690,121 @@ yyparse (void) break; case 232: /* constraint: "number" inequality formula */ -#line 668 "antimony.ypp" +#line 667 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} #line 3696 "antimony.tab.cpp" break; case 233: /* constraint: '-' "number" inequality formula */ -#line 669 "antimony.ypp" +#line 668 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint(-(yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} #line 3702 "antimony.tab.cpp" break; case 234: /* constraint: "name of a pre-defined constant" inequality formula */ -#line 670 "antimony.ypp" +#line 669 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} #line 3708 "antimony.tab.cpp" break; case 235: /* constraint: "element name" inequality formula */ -#line 671 "antimony.ypp" +#line 670 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} #line 3714 "antimony.tab.cpp" break; case 236: /* constraint: "'constraint'" ':' formula */ -#line 672 "antimony.ypp" +#line 671 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[0].formula))) YYABORT;} #line 3720 "antimony.tab.cpp" break; case 237: /* constraint: "'constraint'" variable ':' formula */ -#line 673 "antimony.ypp" +#line 672 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} #line 3726 "antimony.tab.cpp" break; case 238: /* objective: maxormin formula */ -#line 676 "antimony.ypp" +#line 675 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} #line 3732 "antimony.tab.cpp" break; case 239: /* maxormin: "'maximize'" */ -#line 679 "antimony.ypp" +#line 678 "antimony.ypp" {(yyval.maxormin) = true;} #line 3738 "antimony.tab.cpp" break; case 240: /* maxormin: "'minimize'" */ -#line 680 "antimony.ypp" +#line 679 "antimony.ypp" {(yyval.maxormin) = false;} #line 3744 "antimony.tab.cpp" break; case 241: /* stringlist: "text string" */ -#line 683 "antimony.ypp" +#line 682 "antimony.ypp" { (yyval.stringlist) = new std::vector(); (yyval.stringlist)->push_back(*((yyvsp[0].word))); } #line 3750 "antimony.tab.cpp" break; case 242: /* stringlist: stringlist ',' "text string" */ -#line 684 "antimony.ypp" +#line 683 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-2].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } #line 3756 "antimony.tab.cpp" break; case 243: /* stringlist: stringlist ',' '\n' "text string" */ -#line 685 "antimony.ypp" +#line 684 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-3].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } #line 3762 "antimony.tab.cpp" break; case 244: /* $@12: %empty */ -#line 687 "antimony.ypp" +#line 686 "antimony.ypp" {if (g_registry.SetCurrentModuleIf((yyvsp[0].word), (yyvsp[-1].word))) YYABORT;} #line 3768 "antimony.tab.cpp" break; case 245: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ -#line 687 "antimony.ypp" +#line 686 "antimony.ypp" {g_registry.RevertToPreviousModule();} #line 3774 "antimony.tab.cpp" break; case 246: /* annotations: %empty */ -#line 690 "antimony.ypp" +#line 689 "antimony.ypp" {} #line 3780 "antimony.tab.cpp" break; case 247: /* annotations: "element name" ':' stringlist */ -#line 691 "antimony.ypp" +#line 690 "antimony.ypp" {string modname = g_registry.CurrentModuleName(); g_registry.ProcessGlobalCVTerm(&modname, (yyvsp[-2].word), (yyvsp[0].stringlist));} #line 3786 "antimony.tab.cpp" break; case 248: /* cvterm: variable "element name" stringlist */ -#line 696 "antimony.ypp" +#line 695 "antimony.ypp" {if (g_registry.CurrentModule()->ProcessCVTerm((yyvsp[-2].variable),(yyvsp[-1].word),(yyvsp[0].stringlist))) YYABORT;} #line 3792 "antimony.tab.cpp" break; case 249: /* cvterm: variable "element name" '.' "element name" stringlist */ -#line 697 "antimony.ypp" +#line 696 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].stringlist))) YYABORT;} #line 3798 "antimony.tab.cpp" break; case 250: /* cvterm: variable "element name" '.' "element name" "number" */ -#line 698 "antimony.ypp" +#line 697 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].num))) YYABORT;} #line 3804 "antimony.tab.cpp" break; case 251: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ -#line 702 "antimony.ypp" +#line 701 "antimony.ypp" { Module* module = g_registry.GetModule(*(yyvsp[-4].word)); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); @@ -3818,7 +3818,7 @@ yyparse (void) break; case 252: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ -#line 713 "antimony.ypp" +#line 712 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { function->SetSBOTerm(lround((yyvsp[0].num))); @@ -3832,7 +3832,7 @@ yyparse (void) break; case 253: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ -#line 723 "antimony.ypp" +#line 722 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; @@ -3846,7 +3846,7 @@ yyparse (void) break; case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "name of a pre-defined constant" */ -#line 733 "antimony.ypp" +#line 732 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; @@ -3860,7 +3860,7 @@ yyparse (void) break; case 255: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ -#line 743 "antimony.ypp" +#line 742 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; @@ -3878,7 +3878,7 @@ yyparse (void) break; case 256: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ -#line 757 "antimony.ypp" +#line 756 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; @@ -3896,7 +3896,7 @@ yyparse (void) break; case 257: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ -#line 771 "antimony.ypp" +#line 770 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -3914,7 +3914,7 @@ yyparse (void) break; case 258: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ -#line 785 "antimony.ypp" +#line 784 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -3932,37 +3932,37 @@ yyparse (void) break; case 259: /* modulename: "name of an existing module" "'is'" "text string" lineend */ -#line 801 "antimony.ypp" +#line 800 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } #line 3938 "antimony.tab.cpp" break; case 260: /* functionname: "name of an existing function" "'is'" "text string" lineend */ -#line 803 "antimony.ypp" +#line 802 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } #line 3944 "antimony.tab.cpp" break; case 261: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ -#line 806 "antimony.ypp" +#line 805 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} #line 3950 "antimony.tab.cpp" break; case 262: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ -#line 807 "antimony.ypp" +#line 806 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT;} #line 3956 "antimony.tab.cpp" break; case 263: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ -#line 808 "antimony.ypp" +#line 807 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT;} #line 3962 "antimony.tab.cpp" break; case 264: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ -#line 809 "antimony.ypp" +#line 808 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} #line 3968 "antimony.tab.cpp" break; @@ -4192,7 +4192,7 @@ yyparse (void) return yyresult; } -#line 811 "antimony.ypp" +#line 810 "antimony.ypp" diff --git a/src/antimony.ypp b/src/antimony.ypp index 35f45da4..ff195c4b 100644 --- a/src/antimony.ypp +++ b/src/antimony.ypp @@ -506,7 +506,6 @@ assignment: varmaybein ':' maxormin formula {if (g_registry.CurrentModule()- | varmaybein ':' '=' formula {if ($1->SetAssignmentRule($4)) YYABORT;} | varmaybein '\'' '=' formula {if ($1->SetRateRule($4)) YYABORT;} | varmaybein HASWORD unitdef {if ($1->SetUnit($3)) YYABORT; } -// | NUM '=' formula {if (g_registry.CurrentModule()->SetAlgRule($1, $3)) YYABORT; } ; algrule: NUM '=' formula {if (g_registry.AddNewAlgebraicRuleToCurrent($1, $3)) YYABORT; } diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 996c7cea..05aae31a 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -33,8 +33,9 @@ LayoutWrapper::LayoutWrapper(Variable* parent, layout_type type) SetNamespace(parent->GetNamespace()); } -LayoutWrapper::LayoutWrapper(layout_type type) +LayoutWrapper::LayoutWrapper(layout_type type, const string& group) : Variable() + , m_parent(NULL) , m_layout_type(type) { m_displayname = ""; @@ -45,6 +46,8 @@ LayoutWrapper::LayoutWrapper(layout_type type) m_const = constDEFAULT; m_substOnly = false; m_sboTermWrapper = NULL; + m_name.push_back(group); + m_name.push_back(LayoutTypeToString(type)); m_type = varLayoutWrapper; } @@ -191,7 +194,12 @@ Variable* LayoutWrapper::GetParent() string LayoutWrapper::GetNameDelimitedBy(string cc) const { - return m_parent->GetNameDelimitedBy(cc) + cc + LayoutTypeToString(m_layout_type); + if (m_parent) { + return m_parent->GetNameDelimitedBy(cc) + cc + LayoutTypeToString(m_layout_type); + } + else { + return Variable::GetNameDelimitedBy(cc); + } } bool LayoutWrapper::Synchronize(Variable* clone, const Variable* conversionFactor) diff --git a/src/layoutWrapper.h b/src/layoutWrapper.h index 35238cc8..76a246b6 100644 --- a/src/layoutWrapper.h +++ b/src/layoutWrapper.h @@ -13,7 +13,7 @@ class LayoutWrapper : public Variable layout_type m_layout_type; public: LayoutWrapper(Variable* parent, layout_type type); - LayoutWrapper(layout_type type); + LayoutWrapper(layout_type type, const std::string& group); ~LayoutWrapper(); bool IsPointer() const; diff --git a/src/module.cpp b/src/module.cpp index ffb6f25a..963f29bb 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3400,7 +3400,7 @@ LayoutWrapper* CreateAndCheckLayoutWrapper(const std::string* type, Formula* for case lt_shape: break; } - LayoutWrapper* lw = new LayoutWrapper(ltype); + LayoutWrapper* lw = new LayoutWrapper(ltype, group); if (lw->SetFormula(formula)) { delete lw; return NULL; From 43014b5dfd5de4b0936ef888fc29744a49ccc1fe Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 9 Aug 2024 09:50:04 -0700 Subject: [PATCH 06/43] Update to latest libSBMLNetwork. Uncomment now-implemented functions; allow general 'layout' setting. Drop 'locked' option for autolayout (handle this automatically) Allow general layout 'style'. Add font setting --- src/layoutWrapper.cpp | 168 +++++++++++++++++++++++++++++++++--------- src/module-sbml.cpp | 54 ++++++++------ src/module.cpp | 119 +++++++++++++++++++++++++----- src/module.h | 17 +++-- src/typex.cpp | 3 + src/variable.cpp | 1 + 6 files changed, 281 insertions(+), 81 deletions(-) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 05aae31a..2a5ad1a0 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -309,7 +309,6 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const break; case lt_linewidth: ret = LIBSBMLNETWORK_CPP_NAMESPACE::setStrokeWidth(sbml, sid, lval); - assert(false); break; case lt_linecolor: ret = LIBSBMLNETWORK_CPP_NAMESPACE::setStrokeColor(sbml, sid, formstring); @@ -328,7 +327,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string& group) const { - assert(group == "species" || group == "reaction" || group == "compartment"); + assert(group == "species" || group == "reaction" || group == "compartment" || group == "layout"); string formstring = m_valFormula.ToSBMLString(); ASTNode* astn = parseStringToASTNode(formstring); string error = "Unable to set " + group + "." + LayoutTypeToString(m_layout_type) + " to " + formstring + "."; @@ -341,16 +340,17 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string int ret2 = 0; assert(m_layout_type == lt_size); if (group == "species") { - //ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, xval); - //ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, yval); + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, 0, xval); + //double S1width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(sbml, "S1"); + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, 0, yval); } else if (group == "compartment") { - //ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, xval); - //ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, yval); + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, 0, xval); + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, 0, yval); } else if (group == "reaction") { - //ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, xval); - //ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, yval); + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, 0, xval); + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, 0, yval); } if (ret1 == -1 || ret2 == -1) { g_registry.SetError(error); @@ -366,26 +366,32 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string assert(false); return true; case lt_height: - //if (group == "species") { - // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, lval); - //} - //else if (group == "compartment") { - // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, lval); - //} - //else if (group == "reaction") { - // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, lval); - //} + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, 0, lval); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, 0, lval); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, 0, lval); + } + else { + assert(false); + } break; case lt_width: - //if (group == "species") { - // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, lval); - //} - //else if (group == "compartment") { - // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, lval); - //} - //else if (group == "reaction") { - // ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, lval); - //} + if (group == "species") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, 0, lval); + } + else if (group == "compartment") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, 0, lval); + } + else if (group == "reaction") { + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, 0, lval); + } + else { + assert(false); + } break; case lt_color: if (group == "species") { @@ -397,6 +403,13 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFillColor(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFillColor(sbml, zero, formstring); + } + else { + assert(false); + } break; case lt_font: { @@ -411,17 +424,31 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontFamily(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontFamily(sbml, zero, formstring); + } + else { + assert(false); + } break; } case lt_fontsize: if (group == "species") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontSize(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontSize(sbml, 0, lval); } else if (group == "compartment") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontSize(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontSize(sbml, 0, lval); } else if (group == "reaction") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontSize(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontSize(sbml, 0, lval); + } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontSize(sbml, zero, lval); + } + else { + assert(false); } break; case lt_fontcolor: @@ -434,6 +461,13 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontColor(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontColor(sbml, zero, formstring); + } + else { + assert(false); + } break; case lt_fontstyle: case lt_fontweight: @@ -447,6 +481,13 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontWeight(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, zero, formstring); + } + else { + assert(false); + } } if (CaselessStrCmp(false, formstring, "italic")) { if (group == "species") { @@ -458,6 +499,13 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontStyle(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, zero, formstring); + } + else { + assert(false); + } } if (CaselessStrCmp(false, formstring, "normal")) { if (group == "species") { @@ -469,6 +517,13 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontWeight(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, zero, formstring); + } + else { + assert(false); + } if (ret == 0) { if (group == "species") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontStyle(sbml, 0, formstring); @@ -479,27 +534,48 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontStyle(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, zero, formstring); + } + else { + assert(false); + } } } if (CaselessStrCmp(false, formstring, "bold_italic")) { if (group == "species") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, "bold"); } else if (group == "compartment") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontWeight(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontWeight(sbml, 0, "bold"); } else if (group == "reaction") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontWeight(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontWeight(sbml, 0, "bold"); + } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, zero, "bold"); + } + else { + assert(false); } if (ret == 0) { if (group == "species") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontStyle(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontStyle(sbml, 0, "italic"); } else if (group == "compartment") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontStyle(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentFontStyle(sbml, 0, "italic"); } else if (group == "reaction") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontStyle(sbml, 0, formstring); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionFontStyle(sbml, 0, "italic"); + } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, zero, "italic"); + } + else { + assert(false); } } } @@ -514,6 +590,13 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionStrokeWidth(sbml, 0, lval); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setStrokeWidth(sbml, zero, lval); + } + else { + assert(false); + } break; case lt_linecolor: if (group == "species") { @@ -525,6 +608,13 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionStrokeColor(sbml, 0, formstring); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setStrokeColor(sbml, zero, formstring); + } + else { + assert(false); + } break; case lt_shape: if (group == "species") { @@ -536,6 +626,14 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionGeometricShapeType(sbml, 0, formstring); } + else if (group == "layout") { + assert(false); //Shouldn't be able to set a default shape. + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setGeometricShapeType(sbml, zero, formstring); + } + else { + assert(false); + } break; case lt_unknown: break; diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index dee6c58f..422b63df 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2446,7 +2446,7 @@ void Module::CreateSBMLModel(bool comp) // Layout/Render! if (m_autolayout.use) { - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel); // , m_autolayout.lockedNodeIds); + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.maxNumConnectedEdges, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel); // , m_autolayout.lockedNodeIds); LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); if (m_layout.width != 0) { LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(&m_sbml, m_layout.width); @@ -2454,6 +2454,9 @@ void Module::CreateSBMLModel(bool comp) if (m_layout.height != 0) { LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(&m_sbml, m_layout.height); } + if (m_layout.style != "") { + LIBSBMLNETWORK_CPP_NAMESPACE::setStyle(&m_sbml, 0, m_layout.style); + } //if (m_layout.depth != 0) { // LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionDepth(m_layout.sbmllayout, m_layout.depth); //} @@ -2461,48 +2464,57 @@ void Module::CreateSBMLModel(bool comp) //The background name has already been validated when set. LIBSBMLNETWORK_CPP_NAMESPACE::setBackgroundColor(&m_sbml, m_layout.background); } + for (size_t sl = 0; sl < m_defaultLayouts.size(); sl++) { + m_defaultLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "layout"); + } + for (size_t sl = 0; sl < m_speciesLayouts.size(); sl++) { + m_speciesLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "species"); + } + for (size_t sl = 0; sl < m_compartmentLayouts.size(); sl++) { + m_compartmentLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "compartment"); + } + for (size_t sl = 0; sl < m_reactionLayouts.size(); sl++) { + m_reactionLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "reaction"); + } + for (size_t v = 0; v < m_uniquevars.size(); v++) { + if (m_uniquevars[v]->TransferLayoutInformationTo(&m_sbml)) { + assert(false); + } + } if (m_layout.align_bottom.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_bottom, "bottom"); + m_autolayout.lockedNodeIds.insert(m_layout.align_bottom.begin(), m_layout.align_bottom.end()); } if (m_layout.align_center.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_center, "center"); + m_autolayout.lockedNodeIds.insert(m_layout.align_center.begin(), m_layout.align_center.end()); } if (m_layout.align_circular.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_circular, "circular"); + m_autolayout.lockedNodeIds.insert(m_layout.align_circular.begin(), m_layout.align_circular.end()); } if (m_layout.align_left.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_left, "left"); + m_autolayout.lockedNodeIds.insert(m_layout.align_left.begin(), m_layout.align_left.end()); } if (m_layout.align_middle.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_middle, "middle"); + m_autolayout.lockedNodeIds.insert(m_layout.align_middle.begin(), m_layout.align_middle.end()); } if (m_layout.align_right.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_right, "right"); + m_autolayout.lockedNodeIds.insert(m_layout.align_right.begin(), m_layout.align_right.end()); } if (m_layout.align_top.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top"); - } - for (size_t sl = 0; sl < m_speciesLayouts.size(); sl++) { - m_speciesLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "species"); - } - for (size_t sl = 0; sl < m_compartmentLayouts.size(); sl++) { - m_compartmentLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "compartment"); - } - for (size_t sl = 0; sl < m_reactionLayouts.size(); sl++) { - m_reactionLayouts[sl]->TransferLayoutInformationTo(&m_sbml, "reaction"); - } - for (size_t v = 0; v < m_uniquevars.size(); v++) { - if (m_uniquevars[v]->TransferLayoutInformationTo(&m_sbml)) { - assert(false); - //return true; - } + m_autolayout.lockedNodeIds.insert(m_layout.align_top.begin(), m_layout.align_top.end()); } if (m_autolayout.lockedNodeIds.size() > 0) { - vector lockedids; - for (auto node = m_autolayout.lockedNodeIds.begin(); node != m_autolayout.lockedNodeIds.end(); node++) { - lockedids.push_back(*node); - } - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, lockedids); + //double S1width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(&m_sbml, "S1"); + double S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.maxNumConnectedEdges, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); + //S1width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(&m_sbml, "S1"); + S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); } } } diff --git a/src/module.cpp b/src/module.cpp index 963f29bb..070c34e8 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "module.h" #include "variable.h" @@ -3148,9 +3149,12 @@ bool Module::SetAutoLayout(const string* argument, const double& value) if (CaselessStrCmp(true, *argument, "stiffness")) { m_autolayout.stiffness = value; } - if (CaselessStrCmp(true, *argument, "gravity")) { + else if (CaselessStrCmp(true, *argument, "gravity")) { m_autolayout.gravity = value; } + else if (CaselessStrCmp(true, *argument, "maxNumConnectedEdges")) { + m_autolayout.maxNumConnectedEdges = round(value); + } return false; } @@ -3168,6 +3172,7 @@ bool Module::SetAutoLayout(const std::string* argument, const std::vector ids; for (size_t i = 0; i < values->size(); i++) { string id = (*values)[i]->GetNameDelimitedBy(g_registry.GetCC()); @@ -3206,6 +3211,9 @@ string Module::ValidateAutoLayoutArgument(const string* argument) if (CaselessStrCmp(true, *argument, "gravity")) { return "double"; } + if (CaselessStrCmp(true, *argument, "maxNumConnectedEdges")) { + return "double"; + } if (CaselessStrCmp(true, *argument, "useMagnetism")) { return "bool"; } @@ -3218,10 +3226,10 @@ string Module::ValidateAutoLayoutArgument(const string* argument) if (CaselessStrCmp(true, *argument, "useNameAsTextLabel")) { return "bool"; } - if (CaselessStrCmp(true, *argument, "locked")) { - return "idlist"; - } - g_registry.SetError("No such setting 'autolayout." + *argument+ "': the valid autolayout settings are 'stiffness', 'gravity', 'useMagnetism', 'useBoundary', 'useGrid', 'useNameAsTextLabel', and 'locked'."); + //if (CaselessStrCmp(true, *argument, "locked")) { + // return "idlist"; + //} + g_registry.SetError("No such setting 'autolayout." + *argument+ "': the valid autolayout settings are 'stiffness', 'gravity', 'maxNumConnectedEdges', 'useMagnetism', 'useBoundary', 'useGrid', and 'useNameAsTextLabel'."); return "none"; } @@ -3246,14 +3254,55 @@ bool Module::SetLayout(const std::string* argument, const std::string* value) g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': you must set it to a list of IDs in brackets (i.e. '[S1, S2]')."); return true; } - bool arg = true; - if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(*value)) { - g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': that's not a valid color. Try something like 'red' or 'blue' or a hex color of the form '#FF0000'."); + + if (type == "color") { + if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(*value)) { + g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': that's not a valid color. Try something like 'red' or 'blue' or a hex color of the form '#FF0000'."); + return true; + } + } + else if (type == "style") { + std::regex underscore_re("_"); + string spaces_not_underscores = std::regex_replace(*value, underscore_re, " "); + //if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidstyle(spaces_not_underscores)) { + // g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': that's not a valid predefined style. Try something like 'blue_ombre', 'sunset', or 'black_and_white'."); + // return true; + //} + } + else if(type == "font") { + //All font names are legal + } + else if (type == "fontEmphasis") { + if (!(CaselessStrCmp(true, *value, "italic") || CaselessStrCmp(true, *value, "bold") || CaselessStrCmp(true, *value, "normal") || CaselessStrCmp(true, *value, "bold_italic"))) { + g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': the valid font emphases are 'normal', 'bold', 'italic', or 'bold_italic'."); + return true; + } + } + else { + assert(false); + } + + + if (CaselessStrCmp(true, *argument, "background")) { + m_layout.background = *value; + return false; + } + + else if (CaselessStrCmp(true, *argument, "style")) { + m_layout.style = *value; + return false; + } + + //Otherwise, it's a legal layout_type + layout_type lt = LayoutStringToType(*argument); + + LayoutWrapper* wrapper = new LayoutWrapper(lt, "layout"); + Formula form; + form.AddText(value); + if (wrapper->SetFormula(&form)) { return true; } - assert(type == "color"); - assert(CaselessStrCmp(true, *argument, "background")); - m_layout.background = *value; + m_defaultLayouts.push_back(wrapper); return false; } @@ -3308,11 +3357,11 @@ bool Module::SetLayout(const std::string* argument, const std::vector return true; } else if (type == "idlist") { - vector ids; + set ids; for (size_t i = 0; i < values->size(); i++) { string id = (*values)[i]->GetNameDelimitedBy(g_registry.GetCC()); - ids.push_back(id); - m_autolayout.lockedNodeIds.insert(id); + ids.insert(id); + //m_autolayout.lockedNodeIds.insert(id); } if (CaselessStrCmp(true, *argument, "align_top")) { m_layout.align_top = ids; @@ -3361,8 +3410,8 @@ bool Module::SetLayout(const std::string* argument, const std::vector* v g_registry.SetError("Unable to set layout." + *argument + ": the list must contain exactly two entries, for height/width."); } else { - m_layout.height = (*values)[0]; - m_layout.width = (*values)[1]; + m_layout.width = (*values)[0]; + m_layout.height = (*values)[1]; if (values->size() == 3) { //m_layout.depth = (*values)[2]; g_registry.SetError("Unable to set layout." + *argument + ": Antimony does not currently support 3D layouts."); @@ -3477,8 +3526,42 @@ string Module::ValidateLayoutArgument(const string* argument) if (CaselessStrCmp(true, *argument, "background")) { return "color"; } - g_registry.SetError("No such setting 'layout." + *argument + "': the valid layout settings are 'align_top', 'align_center', 'align_bottom', 'align_left', 'align_middle', 'align_right', 'align_circular', 'size', 'height', 'width', 'depth' and 'background'."); - + if (CaselessStrCmp(true, *argument, "style")) { + return "style"; + } + layout_type lt = LayoutStringToType(*argument); + switch (lt) { + case lt_position: + case lt_x: + case lt_y: + g_registry.SetError("Cannot set 'layout." + *argument + "': every element has a different location, so it cannot be set for everything at once."); + return "none"; + case lt_size: + case lt_height: + case lt_width: + g_registry.SetError("Cannot set 'layout." + *argument + "': the sizes of compartments, species, and reactions should be different from each other."); + return "none"; + case lt_color: + case lt_linecolor: + case lt_fontcolor: + return "color"; + case lt_font: + return "font"; + case lt_fontsize: + return "double"; + case lt_fontstyle: + case lt_fontweight: + return "fontEmphasis"; + case lt_linewidth: + return "double"; + case lt_shape: + g_registry.SetError("Cannot set 'layout." + *argument + "': the sizes of compartments, species, and reactions should be different from each other."); + return "none"; + case lt_unknown: + g_registry.SetError("No such setting 'layout." + *argument + "': the valid layout settings are 'align_top', 'align_center', 'align_bottom', 'align_left', 'align_middle', 'align_right', 'align_circular', 'size', 'height', 'width', 'depth' and 'background', plus 'color', 'font', 'fontsize', 'fontstyle', 'linewidth', and 'linecolor' for setting those features for everything at once."); + return "none"; + } + assert(false); //Should be caught above. return "none"; } diff --git a/src/module.h b/src/module.h index 2a3f4a64..fe2d817d 100644 --- a/src/module.h +++ b/src/module.h @@ -34,6 +34,7 @@ struct autolayout { bool use = false; double stiffness = 10.0; double gravity = 15.0; + int maxNumConnectedEdges = 3; bool useMagnetism = false; bool useBoundary = false; bool useGrid = false; @@ -42,17 +43,18 @@ struct autolayout { }; struct layout { - std::vector align_top = std::vector(); - std::vector align_center = std::vector(); - std::vector align_bottom = std::vector(); - std::vector align_left = std::vector(); - std::vector align_middle = std::vector(); - std::vector align_right = std::vector(); - std::vector align_circular = std::vector(); + std::set align_top = std::set(); + std::set align_center = std::set(); + std::set align_bottom = std::set(); + std::set align_left = std::set(); + std::set align_middle = std::set(); + std::set align_right = std::set(); + std::set align_circular = std::set(); double height = 0.0; double width = 0.0; //double depth = 0.0; std::string background = ""; + std::string style = ""; }; @@ -96,6 +98,7 @@ class Module : public Annotated bool m_hasFBC; autolayout m_autolayout; layout m_layout; + std::vector m_defaultLayouts; std::vector m_speciesLayouts; std::vector m_compartmentLayouts; std::vector m_reactionLayouts; diff --git a/src/typex.cpp b/src/typex.cpp index c6c96f98..7e705927 100644 --- a/src/typex.cpp +++ b/src/typex.cpp @@ -659,6 +659,9 @@ layout_type LayoutStringToType(const string& ltype) if (CaselessStrCmp(false, ltype, "color")) { return lt_color; } + if (CaselessStrCmp(false, ltype, "fillcolor")) { + return lt_color; + } if (CaselessStrCmp(false, ltype, "font")) { return lt_font; } diff --git a/src/variable.cpp b/src/variable.cpp index 3aa34204..0d8edb5d 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -2427,6 +2427,7 @@ bool Variable::AllowedInFormulas() const case varCompartment: case varUnitDefinition: case varStoichiometry: + case varLayoutColorEtc: return true; case varInteraction: From 5030cffc951727b60895180ef7f121f369624184 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 9 Aug 2024 12:16:46 -0700 Subject: [PATCH 07/43] Fix setting layout width/height. --- src/layoutWrapper.cpp | 8 ++++++++ src/module.cpp | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 2a5ad1a0..73d3aff6 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -375,6 +375,10 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, 0, lval); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, zero, lval); + } else { assert(false); } @@ -389,6 +393,10 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string else if (group == "reaction") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, 0, lval); } + else if (group == "layout") { + int zero = 0; + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, zero, lval); + } else { assert(false); } diff --git a/src/module.cpp b/src/module.cpp index 070c34e8..ad6ef333 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3337,6 +3337,16 @@ bool Module::SetLayout(const string* argument, const double& value) g_registry.SetError("Unable to set layout." + *argument + " to '" + val.str() + "': Antimony does not currently support 3D layouts."); return true; } + //Otherwise, it's a legal layout_type + layout_type lt = LayoutStringToType(*argument); + + LayoutWrapper* wrapper = new LayoutWrapper(lt, "layout"); + Formula form; + form.AddNum(value); + if (wrapper->SetFormula(&form)) { + return true; + } + m_defaultLayouts.push_back(wrapper); return false; } @@ -3384,6 +3394,9 @@ bool Module::SetLayout(const std::string* argument, const std::vector else if (CaselessStrCmp(true, *argument, "align_circular")) { m_layout.align_circular = ids; } + else { + assert(false); //Shouldn't be any other setting that takes a list of IDs. + } ret = false; } delete values; @@ -3419,6 +3432,9 @@ bool Module::SetLayout(const std::string* argument, const std::vector* v ret = false; } } + else { + assert(false); //Shouldn't be any other setting that takes a list of values. + } delete values; return ret; } From 3b9ad99dc061a905a2543fa742c0b81320a9fed1 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 9 Aug 2024 14:07:00 -0700 Subject: [PATCH 08/43] Add error checking for alignment. Alignments can (eventually) only have a single fixed node in them, and after they're run, those nodes then count as 'fixed'. --- src/module.cpp | 62 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-) diff --git a/src/module.cpp b/src/module.cpp index ad6ef333..869f9f7d 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -1180,6 +1180,41 @@ string Module::GetVariableNameDelimitedBy(string cc) const return retval; } +vector getIntersection(set set1, set set2) +{ + vector overlap; + for (auto s1 = set1.begin(); s1 != set1.end(); s1++) { + if (set2.find(*s1) != set2.end()) { + overlap.push_back(*s1); + } + } + return overlap; +} + +bool checkOverlapAndInsert(set& fixed, set check, string label) +{ + vector intersection = getIntersection(fixed, check); + if (intersection.size() >= 2) { + string err = "Unable to set the alignment " + label + " because only one element is allowed in an alignment whose position is already known. In addition, adding an element to an alignment then establishes that element's position, so two such elements cannot be used in another alignment. In this case, the positions of elements "; + for (size_t i = 0; i < intersection.size(); i++) { + if (i > 0) { + err += ", "; + } + if (i == intersection.size() - 1) { + err += "and "; + } + err += "'"; + err += intersection[i]; + err += "'"; + } + err += " are already known."; + g_registry.SetError(err); + return true; + } + fixed.insert(check.begin(), check.end()); + return false; +} + bool Module::Finalize() { m_uniquevars.clear(); @@ -1280,6 +1315,31 @@ bool Module::Finalize() m_autolayout.use = true; } + //Now check if the layout align lists are OK, i.e. don't have 2+ already-fixed nodes in them. + set combo = m_autolayout.lockedNodeIds; + if (checkOverlapAndInsert(combo, m_layout.align_top, "align_top")) { + return true; + } + if (checkOverlapAndInsert(combo, m_layout.align_center, "align_center")) { + return true; + } + if (checkOverlapAndInsert(combo, m_layout.align_bottom, "align_bottom")) { + return true; + } + if (checkOverlapAndInsert(combo, m_layout.align_left, "align_left")) { + return true; + } + if (checkOverlapAndInsert(combo, m_layout.align_middle, "align_middle")) { + return true; + } + if (checkOverlapAndInsert(combo, m_layout.align_right, "align_right")) { + return true; + } + if (checkOverlapAndInsert(combo, m_layout.align_circular, "align_circular")) { + return true; + } + + #endif //Phase 3: Set compartments @@ -3419,14 +3479,12 @@ bool Module::SetLayout(const std::string* argument, const std::vector* v } else if (type == "numlist") { if (values->size() < 2 || values->size() > 3) { - //g_registry.SetError("Unable to set layout." + *argument + ": the list must contain exactly two or three entries, for height/width, or height/width/depth."); g_registry.SetError("Unable to set layout." + *argument + ": the list must contain exactly two entries, for height/width."); } else { m_layout.width = (*values)[0]; m_layout.height = (*values)[1]; if (values->size() == 3) { - //m_layout.depth = (*values)[2]; g_registry.SetError("Unable to set layout." + *argument + ": Antimony does not currently support 3D layouts."); } ret = false; From 107a161a497257a1ae2854e5e00db9c66b02d3c7 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Mon, 12 Aug 2024 15:16:46 -0700 Subject: [PATCH 09/43] Add Antimony export. --- src/layoutWrapper.cpp | 2 +- src/layoutWrapper.h | 2 +- src/module-sbml.cpp | 6 +- src/module.cpp | 130 +++++++++++++++++++++++++++++++++++++++++- src/module.h | 5 +- 5 files changed, 134 insertions(+), 11 deletions(-) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 73d3aff6..ba91887e 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -208,7 +208,7 @@ bool LayoutWrapper::Synchronize(Variable* clone, const Variable* conversionFacto return true; } -string LayoutWrapper::CreatelayoutParamsAntimonySyntax(const string& indent) const +string LayoutWrapper::CreateLayoutParamsAntimonySyntax(const string& indent) const { string ret = ""; if (!m_valFormula.IsEmpty()) { diff --git a/src/layoutWrapper.h b/src/layoutWrapper.h index 76a246b6..25fe57b8 100644 --- a/src/layoutWrapper.h +++ b/src/layoutWrapper.h @@ -26,7 +26,7 @@ class LayoutWrapper : public Variable Variable* GetParent(); virtual std::string GetNameDelimitedBy(std::string cc) const; virtual bool Synchronize(Variable* clone, const Variable* conversionFactor); - virtual std::string CreatelayoutParamsAntimonySyntax(const std::string& indent) const; + virtual std::string CreateLayoutParamsAntimonySyntax(const std::string& indent) const; virtual bool TransferLayoutInformationTo(libsbml::SBMLDocument* sbml) const; bool TransferLayoutInformationTo(libsbml::SBMLDocument* sbml, const std::string& group) const; virtual bool HasLayoutPositionInfo() const; diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 422b63df..ec6fc72d 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2510,11 +2510,7 @@ void Module::CreateSBMLModel(bool comp) m_autolayout.lockedNodeIds.insert(m_layout.align_top.begin(), m_layout.align_top.end()); } if (m_autolayout.lockedNodeIds.size() > 0) { - //double S1width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(&m_sbml, "S1"); - double S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.maxNumConnectedEdges, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); - //S1width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(&m_sbml, "S1"); - S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.maxNumConnectedEdges, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, false, m_autolayout.lockedNodeIds); } } } diff --git a/src/module.cpp b/src/module.cpp index 869f9f7d..41d8d5e0 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -2392,6 +2392,20 @@ string Module::GetAntimony(set& usedmods, bool funcsincluded, boo retval += indent + m_uniquevars[var]->GetNameDelimitedBy(cc) + " is \"" + m_uniquevars[var]->GetDisplayName() + "\";\n"; } + if (m_autolayout.use) { + retval += GetAntimonyAutolayout(indent); + retval += GetAntimonyGeneralLayout(indent); + retval += GetAntimonyTypeLayouts(indent); + string individual_layouts = ""; + for (size_t var = 0; var < m_uniquevars.size(); var++) { + individual_layouts += m_uniquevars[var]->CreateLayoutParamsAntimonySyntax(indent); + } + if (!individual_layouts.empty()) { + retval += indent + "// Individual element layout information\n"; + retval += individual_layouts; + } + } + if (enableAnnotations) { // SBO terms bool anysboterm = false; @@ -3128,10 +3142,10 @@ bool Module::SetAutoLayout(const string* isset) } else if (CaselessStrCmp(true, *isset, "off") || CaselessStrCmp(true, *isset, "false")) { - m_autolayout.use = false; - return false; + g_registry.SetError("The only way to turn off autolayout to not include any layout information in the Antimony model. Do not try to set model.autolayout to '" + *isset + "'."); + return true; } - g_registry.SetError("Unable to set autolayout to '" + *isset + "': the only valid options are 'true' or 'false' (or 'on' or 'off')."); + g_registry.SetError("Unable to set autolayout to '" + *isset + "': it can only be used to turn on autolayout by setting it to 'true' or 'on'."); return true; } @@ -3639,3 +3653,113 @@ string Module::ValidateLayoutArgument(const string* argument) return "none"; } +string Module::GetAntimonyAutolayout(const string& indent) const +{ + stringstream ret; + ret << indent << "# Autolayout options" << endl; + ret << indent << "model.autolayout = on" << endl; + if (m_autolayout.stiffness != 10) { + ret << indent << "model.autolayout.stiffness = " << m_autolayout.stiffness << endl; + } + if (m_autolayout.gravity != 15) { + ret << indent << "model.autolayout.gravity = " << m_autolayout.gravity << endl; + } + if (m_autolayout.maxNumConnectedEdges != 3) { + ret << indent << "model.autolayout.maxNumConnectedEdges = " << m_autolayout.maxNumConnectedEdges << endl; + } + if (m_autolayout.useMagnetism) { + ret << indent << "model.autolayout.useMagnetism = on" << endl; + } + if (!m_autolayout.useBoundary) { + ret << indent << "model.autolayout.useBoundary = off" << endl; + } + if (m_autolayout.useGrid) { + ret << indent << "model.autolayout.useGrid = on" << endl; + } + if (!m_autolayout.useNameAsTextLabel) { + ret << indent << "model.autolayout.useNameAsTextLabel = off" << endl; + } + + + return ret.str(); +} + +string getSetString(set list) +{ + string ret = "{"; + for (auto li = list.begin(); li != list.end(); li++) { + ret += " " + *li + ","; + } + ret[ret.size() - 1] = ' '; + ret += "}"; + return ret; +} + +string Module::GetAntimonyGeneralLayout(const string& indent) const +{ + stringstream ret; + ret << indent << "# General layout defaults" << endl; + if (m_layout.height && m_layout.width) { + ret << indent << "model.layout.size = {" << m_layout.width << ", " << m_layout.height << "}" << endl; + } + else if (m_layout.height) { + ret << indent << "model.layout.height = " << m_layout.height << endl; + } + else if (m_layout.width) { + ret << indent << "model.layout.width = " << m_layout.width << endl; + } + if (m_layout.style != "") { + ret << indent << "model.layout.style = " << m_layout.style << endl; + } + if (m_layout.background != "") { + ret << indent << "model.layout.background = " << m_layout.background << endl; + } + if (m_layout.align_top.size()) { + ret << indent << getSetString(m_layout.align_top); + } + if (m_layout.align_center.size()) { + ret << indent << getSetString(m_layout.align_center); + } + if (m_layout.align_bottom.size()) { + ret << indent << getSetString(m_layout.align_bottom); + } + if (m_layout.align_left.size()) { + ret << indent << getSetString(m_layout.align_left); + } + if (m_layout.align_middle.size()) { + ret << indent << getSetString(m_layout.align_middle); + } + if (m_layout.align_right.size()) { + ret << indent << getSetString(m_layout.align_right); + } + if (m_layout.align_circular.size()) { + ret << indent << getSetString(m_layout.align_circular); + } + + return ret.str(); +} + +std::string Module::GetAntimonyTypeLayouts(const std::string& indent) const +{ + string ret = ""; + if (m_compartmentLayouts.size()) { + ret += indent + "// Compartment layout defaults\n"; + for (size_t c = 0; c < m_compartmentLayouts.size(); c++) { + ret += m_compartmentLayouts[c]->CreateLayoutParamsAntimonySyntax(indent); + } + } + if (m_speciesLayouts.size()) { + ret += indent + "// Species layout defaults\n"; + for (size_t s = 0; s < m_speciesLayouts.size(); s++) { + ret += m_speciesLayouts[s]->CreateLayoutParamsAntimonySyntax(indent); + } + } + if (m_reactionLayouts.size()) { + ret += indent + "// Reaction layout defaults\n"; + for (size_t r = 0; r < m_reactionLayouts.size(); r++) { + ret += m_reactionLayouts[r]->CreateLayoutParamsAntimonySyntax(indent); + } + } + return std::string(); +} + diff --git a/src/module.h b/src/module.h index fe2d817d..7724ee35 100644 --- a/src/module.h +++ b/src/module.h @@ -36,7 +36,7 @@ struct autolayout { double gravity = 15.0; int maxNumConnectedEdges = 3; bool useMagnetism = false; - bool useBoundary = false; + bool useBoundary = true; bool useGrid = false; bool useNameAsTextLabel = true; std::set lockedNodeIds = std::set(); @@ -340,6 +340,9 @@ class Module : public Annotated void UpdateRateOf(libsbml::Model* model); std::string ValidateAutoLayoutArgument(const std::string* argument); std::string ValidateLayoutArgument(const std::string* argument); + std::string GetAntimonyAutolayout(const std::string& indent) const; + std::string GetAntimonyGeneralLayout(const std::string& indent) const; + std::string GetAntimonyTypeLayouts(const std::string& indent) const; #endif #endif }; From e8bc6fc34a4e5c79fa2620af60a688c8a6686884 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Thu, 15 Aug 2024 16:18:42 -0700 Subject: [PATCH 10/43] Round-trip everything. Needs more defaults, but works with SBMLNetwork's base defaults. Also, update to SBMLNetwork's latest API. Also also, don't worry about individual lines, with their start/end/midpoints. --- src/enums.h | 12 ++ src/layoutWrapper.cpp | 2 + src/module-sbml.cpp | 300 +++++++++++++++++++++++++++++++++++++++--- src/module.cpp | 105 +++++++-------- src/module.h | 13 +- src/typex.cpp | 60 +++++++++ 6 files changed, 415 insertions(+), 77 deletions(-) diff --git a/src/enums.h b/src/enums.h index d476b093..99255d5d 100644 --- a/src/enums.h +++ b/src/enums.h @@ -217,6 +217,18 @@ enum layout_type { lt_position = 0, lt_x, lt_y, + lt_start, + lt_startx, + lt_starty, + lt_end, + lt_endx, + lt_endy, + lt_mid1, + lt_mid1x, + lt_mid1y, + lt_mid2, + lt_mid2x, + lt_mid2y, lt_size, lt_height, lt_width, diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index ba91887e..11c49599 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -674,4 +674,6 @@ bool LayoutWrapper::HasLayoutPositionInfo() const case lt_unknown: return false; } + assert(false); + return false; } diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index ec6fc72d..03401232 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -3,6 +3,7 @@ #include "libsbmlnetwork_sbmldocument.h" #include "libsbmlnetwork_sbmldocument_layout.h" #include "libsbmlnetwork_sbmldocument_render.h" +#include "sbml/packages/layout/extension/LayoutModelPlugin.h" using namespace libsbml; @@ -1626,6 +1627,7 @@ void Module::LoadSBML(Model* sbml) //Finally, fix the fact that 'time' used to be OK in functions (l2v1), but is no longer (l2v2). g_registry.FixTimeInFunctions(); + LoadLayout(sbml); } const SBMLDocument* Module::GetSBML(bool comp) @@ -2446,7 +2448,7 @@ void Module::CreateSBMLModel(bool comp) // Layout/Render! if (m_autolayout.use) { - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.maxNumConnectedEdges, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel); // , m_autolayout.lockedNodeIds); + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true); // , m_autolayout.lockedNodeIds); LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); if (m_layout.width != 0) { LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(&m_sbml, m_layout.width); @@ -2481,36 +2483,45 @@ void Module::CreateSBMLModel(bool comp) assert(false); } } - if (m_layout.align_bottom.size()) { - LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_bottom, "bottom"); - m_autolayout.lockedNodeIds.insert(m_layout.align_bottom.begin(), m_layout.align_bottom.end()); - } - if (m_layout.align_center.size()) { - LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_center, "center"); - m_autolayout.lockedNodeIds.insert(m_layout.align_center.begin(), m_layout.align_center.end()); - } - if (m_layout.align_circular.size()) { - LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_circular, "circular"); - m_autolayout.lockedNodeIds.insert(m_layout.align_circular.begin(), m_layout.align_circular.end()); + if (m_layout.align_top.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top"); + m_autolayout.lockedNodeIds.insert(m_layout.align_top.begin(), m_layout.align_top.end()); + //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_left.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_left, "left"); m_autolayout.lockedNodeIds.insert(m_layout.align_left.begin(), m_layout.align_left.end()); + //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); + } + if (m_layout.align_hCenter.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_hCenter, "hCenter"); + m_autolayout.lockedNodeIds.insert(m_layout.align_hCenter.begin(), m_layout.align_hCenter.end()); + //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } - if (m_layout.align_middle.size()) { - LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_middle, "middle"); - m_autolayout.lockedNodeIds.insert(m_layout.align_middle.begin(), m_layout.align_middle.end()); + if (m_layout.align_vCenter.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_vCenter, "vCenter"); + m_autolayout.lockedNodeIds.insert(m_layout.align_vCenter.begin(), m_layout.align_vCenter.end()); + //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_right.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_right, "right"); m_autolayout.lockedNodeIds.insert(m_layout.align_right.begin(), m_layout.align_right.end()); + //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } - if (m_layout.align_top.size()) { - LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top"); - m_autolayout.lockedNodeIds.insert(m_layout.align_top.begin(), m_layout.align_top.end()); + if (m_layout.align_bottom.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_bottom, "bottom"); + m_autolayout.lockedNodeIds.insert(m_layout.align_bottom.begin(), m_layout.align_bottom.end()); + //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); + } + if (m_layout.align_circular.size()) { + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_circular, "circular"); + m_autolayout.lockedNodeIds.insert(m_layout.align_circular.begin(), m_layout.align_circular.end()); + //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_autolayout.lockedNodeIds.size() > 0) { - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.stiffness, m_autolayout.gravity, m_autolayout.maxNumConnectedEdges, m_autolayout.useMagnetism, m_autolayout.useBoundary, m_autolayout.useGrid, m_autolayout.useNameAsTextLabel, false, m_autolayout.lockedNodeIds); + double J0x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "J0"); + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); + J0x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "J0"); } } } @@ -3125,4 +3136,255 @@ void Module::UpdateRateOf(Model* model) } } } + +struct layoutInfo { + double width = -1; + double height = -1; + string color = ""; + string linecolor = ""; + double linewidth = -1; + string font = ""; + string fontcolor = ""; + double fontsize = -1; + string fontstyle = ""; + string shape = ""; +}; + +layoutInfo getDefaultLayoutInfo() +{ + layoutInfo ret; + ret.color = "white"; + ret.linecolor = "black"; + ret.linewidth = 2; + ret.font = "sans-serif"; + ret.fontcolor = "black"; + ret.fontsize = 10; + ret.fontstyle = "normal"; + ret.shape = "rectangle"; + return ret; +} + +layoutInfo getDefaultSpeciesLayoutInfo() +{ + layoutInfo ret = getDefaultLayoutInfo(); + ret.width = 60; + ret.height = 36; + ret.fontsize = 24; + return ret; +} + +layoutInfo getDefaultCompartmentLayoutInfo() +{ + layoutInfo ret = getDefaultLayoutInfo(); + ret.fontsize = 10; + ret.color = "lightgray"; + ret.linecolor = "darkcyan"; + ret.fontcolor = "darkcyan"; + return ret; +} + +layoutInfo getDefaultReactionLayoutInfo() +{ + layoutInfo ret = getDefaultLayoutInfo(); + ret.fontsize = 12; + ret.fontcolor = "darkslategray"; + ret.shape = "ellipse"; + return ret; +} + + +void Module::LoadLayout(Model* sbml) +{ + const LayoutModelPlugin* lplugin = static_cast(sbml->getPlugin("layout")); + if (lplugin != NULL) { + m_autolayout.use = true; + //Use SBMLNetwork to read stuff instead of reading from the document directly. + SBMLDocument* doc = sbml->getSBMLDocument(); + layoutInfo gendefault = getDefaultLayoutInfo(); + m_layout.height = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc); + m_layout.width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc); + + //Background color + string background = LIBSBMLNETWORK_CPP_NAMESPACE::getBackgroundColor(doc); + if (background != gendefault.color) { + m_layout.background = background; + } + + //LS DEBUG: Figure out how to get the style, and to get the general defaults + map defaults; + defaults[varSpeciesUndef] = getDefaultSpeciesLayoutInfo(); + defaults[varReactionUndef] = getDefaultReactionLayoutInfo(); + defaults[varCompartment] = getDefaultCompartmentLayoutInfo(); + + Formula form; + for (size_t v = 0; v < m_variables.size(); v++) { + Variable* var = m_variables[v]; + var_type type = var->GetType(); + switch (type) { + case varSpeciesUndef: + case varCompartment: + case varReactionUndef: + break; + case varDNA: + case varReactionGene: + type = varReactionUndef; + break; + case varFormulaUndef: + case varFormulaOperator: + case varInteraction: + case varUndefined: + case varSboTermWrapper: + case varUncertWrapper: + case varLayoutWrapper: + case varLayoutColorEtc: + case varModule: + case varEvent: + case varStrand: + case varUnitDefinition: + case varDeleted: + case varConstraint: + case varStoichiometry: + case varAlgebraicRule: + continue; + } + string varid = var->GetNameDelimitedBy("_"); + double val = 0.0; + string sval = ""; + + // Position + val = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, varid); + double valy = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, varid); + if (val || valy) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_position); + string text = "{"; + form.AddText(&text, true); + form.AddNum(val); + text = ","; + form.AddText(&text, true); + form.AddNum(valy); + text = "}"; + form.AddText(&text, true); + + lw->SetFormula(&form); + form.Clear(); + } + + // Width + val = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, varid); + if (val && val != defaults[type].width) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_width); + form.AddNum(val); + lw->SetFormula(&form); + form.Clear(); + } + + // Height + val = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, varid); + if (val && val != defaults[type].height) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_height); + form.AddNum(val); + lw->SetFormula(&form); + form.Clear(); + } + + // Fill color + sval = LIBSBMLNETWORK_CPP_NAMESPACE::getFillColor(doc, varid); + if (!sval.empty() && sval != defaults[type].color) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_color); + form.AddText(&sval, true); + lw->SetFormula(&form); + form.Clear(); + } + + // Line color + sval = LIBSBMLNETWORK_CPP_NAMESPACE::getStrokeColor(doc, varid); + if (!sval.empty() && sval != defaults[type].linecolor) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_linecolor); + form.AddText(&sval, true); + lw->SetFormula(&form); + form.Clear(); + } + + // Linewidth + val = LIBSBMLNETWORK_CPP_NAMESPACE::getStrokeWidth(doc, varid); + if (val && val != defaults[type].linewidth) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_linewidth); + form.AddNum(val); + lw->SetFormula(&form); + form.Clear(); + } + + // Font + sval = LIBSBMLNETWORK_CPP_NAMESPACE::getFontFamily(doc, varid); + if (!sval.empty() && sval != defaults[type].font) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_font); + form.AddText(&sval, true); + lw->SetFormula(&form); + form.Clear(); + } + + // Font color + sval = LIBSBMLNETWORK_CPP_NAMESPACE::getFontColor(doc, varid); + if (!sval.empty() && sval != defaults[type].fontcolor) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontcolor); + form.AddText(&sval, true); + lw->SetFormula(&form); + form.Clear(); + } + + // Font size + //val = LIBSBMLNETWORK_CPP_NAMESPACE::getFontSize(doc, varid); + //if (val && val != defaults[type].fontsize) { + // LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontsize); + // form.AddNum(val); + // lw->SetFormula(&form); + // form.Clear(); + //} + + // Font style + sval = LIBSBMLNETWORK_CPP_NAMESPACE::getFontStyle(doc, varid); + string isbold = LIBSBMLNETWORK_CPP_NAMESPACE::getFontWeight(doc, varid); + if (isbold == "bold") { + if (sval == "italic") { + sval = "bold_italic"; + } + else { + sval = "bold"; + } + } + if (!sval.empty() && sval != defaults[type].fontstyle) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontstyle); + form.AddText(&sval, true); + lw->SetFormula(&form); + form.Clear(); + } + + // Shape + sval = LIBSBMLNETWORK_CPP_NAMESPACE::getGeometricShapeType(doc, varid); + if (!sval.empty() && sval != defaults[type].shape) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_shape); + form.AddText(&sval, true); + lw->SetFormula(&form); + form.Clear(); + } + + + + + //S1.size = { 55, 66 } # The size(width, height) of S1. + // S1.width = 55 # (alt for size).The width of S1. + // S1.height = 66 # (alt for size).The height of S1. + // S1.color = magenta # (or 'fillcolor') The fill color for S1 + // S1.linecolor = yellow # (or 'strokecolor') The line color for S1 + // S1.linewidth = 18 # (or 'strokewidth') The linewidth for S1 + // S1.fontcolor = gray # The font color for S1 + // S1.font = serif # The font for S1(predefined options are 'serif' (default), 'sans_serif', and 'monospace', but arbitrary font names are also legal.) + // S1.fontsize = 19 # The font size for S1(default 10) + // S1.fontstyle = bold # (or 'fontweight') The font style for S1(options are 'normal' (default), 'bold', 'italic', and 'bold_italic'). + // S1.shape = ellipse # The shape for S1(options are 'rectangle' (default), 'square', 'ellipse', 'circle', 'triangle', 'diamond', 'pentagon', 'hexagon', and 'octagon'). + } + } +} + + #endif //NSBML diff --git a/src/module.cpp b/src/module.cpp index 41d8d5e0..4c228da8 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -1320,7 +1320,7 @@ bool Module::Finalize() if (checkOverlapAndInsert(combo, m_layout.align_top, "align_top")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_center, "align_center")) { + if (checkOverlapAndInsert(combo, m_layout.align_hCenter, "align_hCenter")) { return true; } if (checkOverlapAndInsert(combo, m_layout.align_bottom, "align_bottom")) { @@ -1329,7 +1329,7 @@ bool Module::Finalize() if (checkOverlapAndInsert(combo, m_layout.align_left, "align_left")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_middle, "align_middle")) { + if (checkOverlapAndInsert(combo, m_layout.align_vCenter, "align_vCenter")) { return true; } if (checkOverlapAndInsert(combo, m_layout.align_right, "align_right")) { @@ -2394,7 +2394,9 @@ string Module::GetAntimony(set& usedmods, bool funcsincluded, boo if (m_autolayout.use) { retval += GetAntimonyAutolayout(indent); + retval += "\n"; retval += GetAntimonyGeneralLayout(indent); + retval += "\n"; retval += GetAntimonyTypeLayouts(indent); string individual_layouts = ""; for (size_t var = 0; var < m_uniquevars.size(); var++) { @@ -3181,13 +3183,13 @@ bool Module::SetAutoLayout(const std::string* argument, const std::string* value g_registry.SetError("Unable to set autolayout." + *argument + " to '" + *value + "': the only valid options are 'true' or 'false' (or 'on' or 'off')."); return true; } - if (CaselessStrCmp(true, *argument, "useMagnetism")) { - m_autolayout.useMagnetism = arg; - } - else if (CaselessStrCmp(true, *argument, "useBoundary")) { - m_autolayout.useBoundary = arg; - } - else if (CaselessStrCmp(true, *argument, "useGrid")) { + //if (CaselessStrCmp(true, *argument, "useMagnetism")) { + // m_autolayout.useMagnetism = arg; + //} + //else if (CaselessStrCmp(true, *argument, "useBoundary")) { + // m_autolayout.useBoundary = arg; + //} + if (CaselessStrCmp(true, *argument, "useGrid")) { m_autolayout.useGrid = arg; } else if (CaselessStrCmp(true, *argument, "useNameAsTextLabel")) { @@ -3220,12 +3222,12 @@ bool Module::SetAutoLayout(const string* argument, const double& value) g_registry.SetError("Unable to set autolayout." + *argument + " to '" + val.str() + "': you must set it to a list of IDs in brackets (i.e. '[S1, S2]')."); return true; } - if (CaselessStrCmp(true, *argument, "stiffness")) { - m_autolayout.stiffness = value; - } - else if (CaselessStrCmp(true, *argument, "gravity")) { - m_autolayout.gravity = value; - } + //if (CaselessStrCmp(true, *argument, "stiffness")) { + // m_autolayout.stiffness = value; + //} + //else if (CaselessStrCmp(true, *argument, "gravity")) { + // m_autolayout.gravity = value; + //} else if (CaselessStrCmp(true, *argument, "maxNumConnectedEdges")) { m_autolayout.maxNumConnectedEdges = round(value); } @@ -3279,21 +3281,21 @@ bool Module::SetAutoLayout(const std::string* argument, const std::vector if (CaselessStrCmp(true, *argument, "align_top")) { m_layout.align_top = ids; } - else if (CaselessStrCmp(true, *argument, "align_center")) { - m_layout.align_center = ids; + else if (CaselessStrCmp(true, *argument, "align_hCenter")) { + m_layout.align_hCenter = ids; } else if (CaselessStrCmp(true, *argument, "align_bottom")) { m_layout.align_bottom = ids; @@ -3459,8 +3461,8 @@ bool Module::SetLayout(const std::string* argument, const std::vector else if (CaselessStrCmp(true, *argument, "align_left")) { m_layout.align_left = ids; } - else if (CaselessStrCmp(true, *argument, "align_middle")) { - m_layout.align_middle = ids; + else if (CaselessStrCmp(true, *argument, "align_vCenter")) { + m_layout.align_vCenter = ids; } else if (CaselessStrCmp(true, *argument, "align_right")) { m_layout.align_right = ids; @@ -3581,7 +3583,7 @@ string Module::ValidateLayoutArgument(const string* argument) if (CaselessStrCmp(true, *argument, "align_top")) { return "idlist"; } - if (CaselessStrCmp(true, *argument, "align_center")) { + if (CaselessStrCmp(true, *argument, "align_hCenter")) { return "idlist"; } if (CaselessStrCmp(true, *argument, "align_bottom")) { @@ -3590,7 +3592,7 @@ string Module::ValidateLayoutArgument(const string* argument) if (CaselessStrCmp(true, *argument, "align_left")) { return "idlist"; } - if (CaselessStrCmp(true, *argument, "align_middle")) { + if (CaselessStrCmp(true, *argument, "align_vCenter")) { return "idlist"; } if (CaselessStrCmp(true, *argument, "align_right")) { @@ -3646,7 +3648,7 @@ string Module::ValidateLayoutArgument(const string* argument) g_registry.SetError("Cannot set 'layout." + *argument + "': the sizes of compartments, species, and reactions should be different from each other."); return "none"; case lt_unknown: - g_registry.SetError("No such setting 'layout." + *argument + "': the valid layout settings are 'align_top', 'align_center', 'align_bottom', 'align_left', 'align_middle', 'align_right', 'align_circular', 'size', 'height', 'width', 'depth' and 'background', plus 'color', 'font', 'fontsize', 'fontstyle', 'linewidth', and 'linecolor' for setting those features for everything at once."); + g_registry.SetError("No such setting 'layout." + *argument + "': the valid layout settings are 'align_top', 'align_hCenter', 'align_bottom', 'align_left', 'align_vCenter', 'align_right', 'align_circular', 'size', 'height', 'width', 'depth' and 'background', plus 'color', 'font', 'fontsize', 'fontstyle', 'linewidth', and 'linecolor' for setting those features for everything at once."); return "none"; } assert(false); //Should be caught above. @@ -3658,21 +3660,21 @@ string Module::GetAntimonyAutolayout(const string& indent) const stringstream ret; ret << indent << "# Autolayout options" << endl; ret << indent << "model.autolayout = on" << endl; - if (m_autolayout.stiffness != 10) { - ret << indent << "model.autolayout.stiffness = " << m_autolayout.stiffness << endl; - } - if (m_autolayout.gravity != 15) { - ret << indent << "model.autolayout.gravity = " << m_autolayout.gravity << endl; - } + //if (m_autolayout.stiffness != 10) { + // ret << indent << "model.autolayout.stiffness = " << m_autolayout.stiffness << endl; + //} + //if (m_autolayout.gravity != 15) { + // ret << indent << "model.autolayout.gravity = " << m_autolayout.gravity << endl; + //} if (m_autolayout.maxNumConnectedEdges != 3) { ret << indent << "model.autolayout.maxNumConnectedEdges = " << m_autolayout.maxNumConnectedEdges << endl; } - if (m_autolayout.useMagnetism) { - ret << indent << "model.autolayout.useMagnetism = on" << endl; - } - if (!m_autolayout.useBoundary) { - ret << indent << "model.autolayout.useBoundary = off" << endl; - } + //if (m_autolayout.useMagnetism) { + // ret << indent << "model.autolayout.useMagnetism = on" << endl; + //} + //if (!m_autolayout.useBoundary) { + // ret << indent << "model.autolayout.useBoundary = off" << endl; + //} if (m_autolayout.useGrid) { ret << indent << "model.autolayout.useGrid = on" << endl; } @@ -3717,8 +3719,8 @@ string Module::GetAntimonyGeneralLayout(const string& indent) const if (m_layout.align_top.size()) { ret << indent << getSetString(m_layout.align_top); } - if (m_layout.align_center.size()) { - ret << indent << getSetString(m_layout.align_center); + if (m_layout.align_hCenter.size()) { + ret << indent << getSetString(m_layout.align_hCenter); } if (m_layout.align_bottom.size()) { ret << indent << getSetString(m_layout.align_bottom); @@ -3726,8 +3728,8 @@ string Module::GetAntimonyGeneralLayout(const string& indent) const if (m_layout.align_left.size()) { ret << indent << getSetString(m_layout.align_left); } - if (m_layout.align_middle.size()) { - ret << indent << getSetString(m_layout.align_middle); + if (m_layout.align_vCenter.size()) { + ret << indent << getSetString(m_layout.align_vCenter); } if (m_layout.align_right.size()) { ret << indent << getSetString(m_layout.align_right); @@ -3762,4 +3764,3 @@ std::string Module::GetAntimonyTypeLayouts(const std::string& indent) const } return std::string(); } - diff --git a/src/module.h b/src/module.h index 7724ee35..23c86685 100644 --- a/src/module.h +++ b/src/module.h @@ -32,11 +32,11 @@ class LayoutWrapper; struct autolayout { bool use = false; - double stiffness = 10.0; - double gravity = 15.0; + //double stiffness = 10.0; + //double gravity = 15.0; int maxNumConnectedEdges = 3; - bool useMagnetism = false; - bool useBoundary = true; + //bool useMagnetism = false; + //bool useBoundary = true; bool useGrid = false; bool useNameAsTextLabel = true; std::set lockedNodeIds = std::set(); @@ -44,10 +44,10 @@ struct autolayout { struct layout { std::set align_top = std::set(); - std::set align_center = std::set(); + std::set align_hCenter = std::set(); std::set align_bottom = std::set(); std::set align_left = std::set(); - std::set align_middle = std::set(); + std::set align_vCenter = std::set(); std::set align_right = std::set(); std::set align_circular = std::set(); double height = 0.0; @@ -343,6 +343,7 @@ class Module : public Annotated std::string GetAntimonyAutolayout(const std::string& indent) const; std::string GetAntimonyGeneralLayout(const std::string& indent) const; std::string GetAntimonyTypeLayouts(const std::string& indent) const; + void LoadLayout(libsbml::Model* sbml); #endif #endif }; diff --git a/src/typex.cpp b/src/typex.cpp index 7e705927..d27d7d1f 100644 --- a/src/typex.cpp +++ b/src/typex.cpp @@ -604,6 +604,30 @@ string LayoutTypeToString(const layout_type ltype) return "x"; case lt_y: return "y"; + case lt_start: + return "start"; + case lt_startx: + return "startx"; + case lt_starty: + return "starty"; + case lt_end: + return "end"; + case lt_endx: + return "end_x"; + case lt_endy: + return "end_y"; + case lt_mid1: + return "mid1"; + case lt_mid1x: + return "mid1_x"; + case lt_mid1y: + return "mid1_y"; + case lt_mid2: + return "mid2"; + case lt_mid2x: + return "mid2_x"; + case lt_mid2y: + return "mid2_y"; case lt_size: return "size"; case lt_height: @@ -647,6 +671,42 @@ layout_type LayoutStringToType(const string& ltype) if (CaselessStrCmp(false, ltype, "y")) { return lt_y; } + if (CaselessStrCmp(false, ltype, "start")) { + return lt_start; + } + if (CaselessStrCmp(false, ltype, "start_x")) { + return lt_startx; + } + if (CaselessStrCmp(false, ltype, "start_y")) { + return lt_starty; + } + if (CaselessStrCmp(false, ltype, "end")) { + return lt_end; + } + if (CaselessStrCmp(false, ltype, "end_x")) { + return lt_endx; + } + if (CaselessStrCmp(false, ltype, "end_y")) { + return lt_endy; + } + if (CaselessStrCmp(false, ltype, "mid1")) { + return lt_mid1; + } + if (CaselessStrCmp(false, ltype, "mid1_x")) { + return lt_mid1x; + } + if (CaselessStrCmp(false, ltype, "mid1_y")) { + return lt_mid1y; + } + if (CaselessStrCmp(false, ltype, "mid2")) { + return lt_mid2; + } + if (CaselessStrCmp(false, ltype, "mid2_x")) { + return lt_mid2x; + } + if (CaselessStrCmp(false, ltype, "mid2_y")) { + return lt_mid2y; + } if (CaselessStrCmp(false, ltype, "size")) { return lt_size; } From 63517624d888b7e2ae8fa253497a933d03694d53 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 13:31:46 -0700 Subject: [PATCH 11/43] Fix where we find libraries and include dirs. --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba56348c..0031f77d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,7 @@ endif(WITH_CELLML) if(WITH_LIBSBML_EXPAT) find_library(EXPAT_LIBRARY - NAMES libexpat.lib libexpat.so libexpat.dylib libexpat expat.lib expat.so expat.dylib expat + NAMES libexpat.lib libexpat.so libexpat.dylib libexpat expat.lib expat.so expat.dylib expat libexpatdMD libexpatMD PATHS /usr/lib /usr/local/lib ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dependencies/lib @@ -340,7 +340,7 @@ endif() if(WITH_SBML) find_library(SBMLNETWORK_LIBRARY - NAMES libsbmlnetwork-static.lib sbmlnetwork-static.lib libsbmlnetwork-static sbmlnetwork-static + NAMES libsbmlnetwork-static.lib sbmlnetwork-static.lib libsbmlnetwork-static sbmlnetwork-static libsbmlnetwork-staticmdd libsbmlnetwork-staticmd PATHS /usr/lib /usr/local/lib ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dependencies/lib @@ -350,7 +350,7 @@ if(WITH_SBML) find_path(SBMLNETWORK_INCLUDE_DIR NAMES libsbmlnetwork_common.h - PATHS /usr/include /usr/local/include ${LIBSBML_DEPENDENCY_DIR}/include + PATHS /usr/include /usr/local/include ${LIBSBML_INSTALL_DIR}/include DOC "The directory containing the SBMLNetwork include files." ) From 9534c0f4c147c33011e09805e87c570f2055d5a9 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 13:50:27 -0700 Subject: [PATCH 12/43] Update libroadrunner-deps version. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d619f02e..e828d0b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.1.1" ] + libroadrunner_deps_release_version: [ "v2.2" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} From 30bc619cf28826ed2702cfde224f7df7ff2718cf Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 14:03:30 -0700 Subject: [PATCH 13/43] Fix import name. --- src/layoutWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 11c49599..fa3ebd0b 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -1,4 +1,4 @@ -#include "LayoutWrapper.h" +#include "layoutWrapper.h" #include "module.h" #include "registry.h" #include "stringx.h" From 114faf9523a8bbe76c618db978ed92f3649ab525 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 14:09:14 -0700 Subject: [PATCH 14/43] Other name for sbmlnetwork library. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 379ec741..b4fb1dc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,7 +340,7 @@ endif() if(WITH_SBML) find_library(SBMLNETWORK_LIBRARY - NAMES libsbmlnetwork-static.lib sbmlnetwork-static.lib libsbmlnetwork-static sbmlnetwork-static libsbmlnetwork-staticmdd libsbmlnetwork-staticmd + NAMES libsbmlnetwork-static.lib sbmlnetwork-static.lib libsbmlnetwork-static sbmlnetwork-static libsbmlnetwork-staticmdd libsbmlnetwork-staticmd libsbmlnetwork-staticd PATHS /usr/lib /usr/local/lib ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dependencies/lib From ca64adc8e71ef764e366f11b27ea10ddbcef62fa Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 14:25:42 -0700 Subject: [PATCH 15/43] Error messages have changed. --- src/test/TestAntimonyErrors.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/TestAntimonyErrors.cpp b/src/test/TestAntimonyErrors.cpp index d4f749a9..b04d0366 100644 --- a/src/test/TestAntimonyErrors.cpp +++ b/src/test/TestAntimonyErrors.cpp @@ -301,13 +301,13 @@ END_TEST START_TEST (no_function_subelements) { - testError("function foo();3;end;foo.x = 3", "Error in model string, line 1: Invalid syntax 'foo.x'. The only thing that can be set on 'foo' this way is 'sboTerm'."); + testError("function foo();3;end;foo.x = 3", "Error in model string, line 1: Invalid syntax 'foo.x'. The only thing that can set 'foo' to a number is 'sboTerm'."); } END_TEST START_TEST (no_vectors1) { - testError("a = {3, 4}", "Error in model string, line 1: Curly brackets detected in formula: '{3, 4}': vectors are not supported in the current version of Antimony apart from their use in setting certain uncertainty parameters."); + testError("a = {3, 4}", "Error in model string, line 1: Curly brackets detected in formula: '{3, 4}': vectors are not supported in the current version of Antimony apart from their use in setting certain uncertainty or layout parameters."); } END_TEST From 009fe54a00b17f1edef60e6131b0d9e775b4b504 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 14:28:51 -0700 Subject: [PATCH 16/43] Try adding full name of library. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4fb1dc3..5a642e9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,7 +340,7 @@ endif() if(WITH_SBML) find_library(SBMLNETWORK_LIBRARY - NAMES libsbmlnetwork-static.lib sbmlnetwork-static.lib libsbmlnetwork-static sbmlnetwork-static libsbmlnetwork-staticmdd libsbmlnetwork-staticmd libsbmlnetwork-staticd + NAMES libsbmlnetwork-static.lib sbmlnetwork-static.lib libsbmlnetwork-static sbmlnetwork-static libsbmlnetwork-staticmdd libsbmlnetwork-staticmd libsbmlnetwork-staticd libsbmlnetwork-staticd.a PATHS /usr/lib /usr/local/lib ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/dependencies/lib From f9caa4301c75561435848d3d66b3fe70879c9a68 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 15:30:32 -0700 Subject: [PATCH 17/43] Add the DL library if defined. (We need it for SBMLNetwork) --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a642e9b..17050eac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,6 +355,8 @@ if(WITH_SBML) ) INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${SBMLNETWORK_INCLUDE_DIR} ) + set(LIBANTIMONY_LIBS ${LIBANTIMONY_LIBS} ${CMAKE_DL_LIBS} ) + endif() message(STATUS "Antimony libs: ${LIBANTIMONY_LIBS}") From 39717e6cbc97dd67941b21f1a0e01c61a50a121e Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 15:49:19 -0700 Subject: [PATCH 18/43] Remove now-unused types; fix missing case statements. --- src/antimony_api.cpp | 5 ++++ src/enums.h | 12 -------- src/layoutWrapper.cpp | 12 ++++++++ src/module.cpp | 2 +- src/typex.cpp | 64 +++---------------------------------------- src/variable.cpp | 22 +++++++++++---- 6 files changed, 39 insertions(+), 78 deletions(-) diff --git a/src/antimony_api.cpp b/src/antimony_api.cpp index afb8451f..b3894691 100644 --- a/src/antimony_api.cpp +++ b/src/antimony_api.cpp @@ -2064,6 +2064,11 @@ LIB_EXTERN char* printAllDataFor(const char* moduleName) ret << "\tEvent Trigger: " << symbolequations[var] << endl; } break; + case formulaALGEBRAIC: + if (string(symbolequations[var]) != "") { + ret << "\Algebraic rule: " << symbolequations[var] << endl; + } + break; } } if (getNumDNAStrands(moduleName) > 0) { diff --git a/src/enums.h b/src/enums.h index 99255d5d..d476b093 100644 --- a/src/enums.h +++ b/src/enums.h @@ -217,18 +217,6 @@ enum layout_type { lt_position = 0, lt_x, lt_y, - lt_start, - lt_startx, - lt_starty, - lt_end, - lt_endx, - lt_endy, - lt_mid1, - lt_mid1x, - lt_mid1y, - lt_mid2, - lt_mid2x, - lt_mid2y, lt_size, lt_height, lt_width, diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index fa3ebd0b..62196a8f 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -157,6 +157,10 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) return true; } return false; + case lt_position: + case lt_size: + assert(false); //Should be pairs + break; case lt_unknown: break; } @@ -224,6 +228,10 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const { string sid = m_parent->GetNameDelimitedBy("_"); string formstring = m_valFormula.ToSBMLString(); + if (formstring.empty()) { + assert(false); + return true; + } ASTNode* astn = parseStringToASTNode(formstring); string error = "Unable to set " + sid + "." + LayoutTypeToString(m_layout_type) + " to " + formstring + "."; if (IsPair(m_layout_type)) { @@ -258,6 +266,10 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const double lval = astn->getValue(); int ret = 0; switch (m_layout_type) { + case lt_position: + case lt_size: + assert(false); //Should be IsPair, above + break; case lt_x: ret = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, lval); break; diff --git a/src/module.cpp b/src/module.cpp index 4c228da8..d3405df4 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3229,7 +3229,7 @@ bool Module::SetAutoLayout(const string* argument, const double& value) // m_autolayout.gravity = value; //} else if (CaselessStrCmp(true, *argument, "maxNumConnectedEdges")) { - m_autolayout.maxNumConnectedEdges = round(value); + m_autolayout.maxNumConnectedEdges = int(round(value)); } return false; } diff --git a/src/typex.cpp b/src/typex.cpp index d27d7d1f..325af3ca 100644 --- a/src/typex.cpp +++ b/src/typex.cpp @@ -474,6 +474,8 @@ string ReturnTypeToString(const return_type rtype) return "constraints"; case allStoichiometries: return "stoichiometries"; + case allAlgebraicRules: + return "algebraic rules"; } assert(false); //uncaught type return "Uncaught type"; @@ -492,6 +494,8 @@ string FormulaTypeToString(const formula_type ftype) return "Kinetic law"; case formulaTRIGGER: return "Trigger"; + case formulaALGEBRAIC: + return "Algebraic rule"; } assert(false); //uncaught type return "uncaught type"; @@ -604,30 +608,6 @@ string LayoutTypeToString(const layout_type ltype) return "x"; case lt_y: return "y"; - case lt_start: - return "start"; - case lt_startx: - return "startx"; - case lt_starty: - return "starty"; - case lt_end: - return "end"; - case lt_endx: - return "end_x"; - case lt_endy: - return "end_y"; - case lt_mid1: - return "mid1"; - case lt_mid1x: - return "mid1_x"; - case lt_mid1y: - return "mid1_y"; - case lt_mid2: - return "mid2"; - case lt_mid2x: - return "mid2_x"; - case lt_mid2y: - return "mid2_y"; case lt_size: return "size"; case lt_height: @@ -671,42 +651,6 @@ layout_type LayoutStringToType(const string& ltype) if (CaselessStrCmp(false, ltype, "y")) { return lt_y; } - if (CaselessStrCmp(false, ltype, "start")) { - return lt_start; - } - if (CaselessStrCmp(false, ltype, "start_x")) { - return lt_startx; - } - if (CaselessStrCmp(false, ltype, "start_y")) { - return lt_starty; - } - if (CaselessStrCmp(false, ltype, "end")) { - return lt_end; - } - if (CaselessStrCmp(false, ltype, "end_x")) { - return lt_endx; - } - if (CaselessStrCmp(false, ltype, "end_y")) { - return lt_endy; - } - if (CaselessStrCmp(false, ltype, "mid1")) { - return lt_mid1; - } - if (CaselessStrCmp(false, ltype, "mid1_x")) { - return lt_mid1x; - } - if (CaselessStrCmp(false, ltype, "mid1_y")) { - return lt_mid1y; - } - if (CaselessStrCmp(false, ltype, "mid2")) { - return lt_mid2; - } - if (CaselessStrCmp(false, ltype, "mid2_x")) { - return lt_mid2x; - } - if (CaselessStrCmp(false, ltype, "mid2_y")) { - return lt_mid2y; - } if (CaselessStrCmp(false, ltype, "size")) { return lt_size; } diff --git a/src/variable.cpp b/src/variable.cpp index 0d8edb5d..a0adcbef 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -338,6 +338,7 @@ const Formula* Variable::GetAssignmentRuleOrKineticLaw() const case varUncertWrapper: case varLayoutWrapper: case varLayoutColorEtc: + case varAlgebraicRule: return &(g_registry.m_blankform); } assert(false); //uncaught type @@ -379,6 +380,7 @@ Formula* Variable::GetAssignmentRuleOrKineticLaw() case varUncertWrapper: case varLayoutWrapper: case varLayoutColorEtc: + case varAlgebraicRule: return &(g_registry.m_blankform); } assert(false); //uncaught type @@ -852,7 +854,8 @@ bool Variable::SetType(var_type newtype) case varUncertWrapper: case varLayoutWrapper: case varStoichiometry: - g_registry.SetError(error); return true; + case varAlgebraicRule: + g_registry.SetError(error); return true; } case varFormulaUndef: switch(newtype) { @@ -868,6 +871,7 @@ bool Variable::SetType(var_type newtype) case varDeleted: case varConstraint: case varStoichiometry: + case varAlgebraicRule: m_type = newtype; return false; case varUnitDefinition: @@ -915,7 +919,8 @@ bool Variable::SetType(var_type newtype) case varUncertWrapper: case varLayoutWrapper: case varStoichiometry: - g_registry.SetError(error); return true; + case varAlgebraicRule: + g_registry.SetError(error); return true; } case varFormulaOperator: switch(newtype) { @@ -940,7 +945,8 @@ bool Variable::SetType(var_type newtype) case varUncertWrapper: case varStoichiometry: case varLayoutWrapper: - g_registry.SetError(error); return true; + case varAlgebraicRule: + g_registry.SetError(error); return true; } case varReactionGene: switch(newtype) { @@ -965,7 +971,8 @@ bool Variable::SetType(var_type newtype) case varUncertWrapper: case varLayoutWrapper: case varStoichiometry: - g_registry.SetError(error); return true; + case varAlgebraicRule: + g_registry.SetError(error); return true; } case varReactionUndef: switch(newtype) { @@ -992,7 +999,8 @@ bool Variable::SetType(var_type newtype) case varUncertWrapper: case varLayoutWrapper: case varStoichiometry: - g_registry.SetError(error); return true; + case varAlgebraicRule: + g_registry.SetError(error); return true; } case varInteraction: case varEvent: @@ -1618,6 +1626,8 @@ bool Variable::SetSuperCompartment(Variable* var, var_type supertype) case varLayoutWrapper: case varConstraint: case varStoichiometry: + case varAlgebraicRule: + case varLayoutColorEtc: assert(false); // Those things don't have components return false; case varStrand: @@ -1842,6 +1852,7 @@ bool Variable::DeleteFromSubmodel(Variable* deletedvar) case varUndefined: case varCompartment: case varStoichiometry: + case varAlgebraicRule: switch (deletedvar->GetFormulaType()) { case formulaRATE: if (!rform->IsEmpty()) { @@ -1862,6 +1873,7 @@ bool Variable::DeleteFromSubmodel(Variable* deletedvar) break; case formulaKINETIC: case formulaTRIGGER: + case formulaALGEBRAIC: //Nothing extra needed. break; } From f5a3764c1daa6a788416aca657b8287369f6dfb1 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 16:40:43 -0700 Subject: [PATCH 19/43] Add more missing cases; add comments. --- CMakeLists.txt | 1 + src/layoutWrapper.cpp | 11 +++++------ src/module.cpp | 2 ++ src/variable.cpp | 27 +++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17050eac..4454fe80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -355,6 +355,7 @@ if(WITH_SBML) ) INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${SBMLNETWORK_INCLUDE_DIR} ) + # SBMLNETWORK uses stuff from the 'dl' library on some platforms. CMake defines CMAKE_DL_LIBS if so. set(LIBANTIMONY_LIBS ${LIBANTIMONY_LIBS} ${CMAKE_DL_LIBS} ) endif() diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 62196a8f..600599e0 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -250,12 +250,9 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, xval); ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, yval); break; - //case lt_start: - //case lt_end: - //case lt_mid1: - //case lt_mid2: - // assert(false); //Probably don't actually set these. - // break; + default: + assert(false); //Only the above two are 'IsPair' true + break; } if (ret1 == -1 || ret2 == -1) { g_registry.SetError(error); @@ -373,6 +370,8 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string double lval = astn->getValue(); int ret = 0; switch (m_layout_type) { + case lt_position: + case lt_size: case lt_x: case lt_y: assert(false); diff --git a/src/module.cpp b/src/module.cpp index d3405df4..d0e73672 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3043,6 +3043,7 @@ void Module::ConvertTime(Variable* tcf) case varSboTermWrapper: case varUncertWrapper: case varLayoutWrapper: + case varLayoutColorEtc: break; } } @@ -3120,6 +3121,7 @@ void Module::UndoTimeExtentConversions(Variable* tcf, Variable* xcf) case varSboTermWrapper: case varUncertWrapper: case varLayoutWrapper: + case varLayoutColorEtc: break; } } diff --git a/src/variable.cpp b/src/variable.cpp index a0adcbef..b9b48319 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -887,6 +887,7 @@ bool Variable::SetType(var_type newtype) case varStrand: case varSboTermWrapper: case varUncertWrapper: + case varLayoutWrapper: g_registry.SetError(error); return true; case varLayoutColorEtc: case varUndefined: @@ -1025,6 +1026,7 @@ bool Variable::SetType(var_type newtype) case varSboTermWrapper: case varUncertWrapper: case varLayoutWrapper: + case varAlgebraicRule: g_registry.SetError(error); return true; //the already-identical cases handled above. return true; } @@ -1112,6 +1114,9 @@ bool Variable::SetFormula(Formula* formula, bool isObjective) } m_valFormula = *formula; break; + case varAlgebraicRule: + g_registry.SetError("Cannot set '" + GetNameDelimitedBy(".") + "' to have the initial value '" + formula->ToDelimitedStringWithEllipses(".") + "' because it is an algebraic rule, which applies at all times, including time=0."); + return true; case varUnitDefinition: if (formula->MakeAllVariablesUnits()) return true; if (m_valUnitDef.SetFromFormula(formula)) return true; @@ -1512,6 +1517,12 @@ bool Variable::SetIsConst(bool constant) return true; } break; + case varAlgebraicRule: + if (!constant) { + g_registry.SetError(error + ", as 'constantness' is undefined for algebraic rules."); + return true; + } + break; case varStrand: if (!constant) { g_registry.SetError(error + ", as 'constantness' is undefined for DNA strands."); @@ -1536,6 +1547,12 @@ bool Variable::SetIsConst(bool constant) return true; } break; + case varLayoutColorEtc: + if (!constant) { + g_registry.SetError(error + ", as 'constantness' is undefined for things like colors."); + return true; + } + break; case varConstraint: if (!constant) { g_registry.SetError(error + ", as 'constantness' is undefined for constraints."); @@ -1677,6 +1694,8 @@ void Variable::SetComponentCompartments(bool frommodule) case varLayoutWrapper: case varConstraint: case varStoichiometry: + case varAlgebraicRule: + case varLayoutColorEtc: return; //No components to set case varReactionUndef: case varReactionGene: @@ -1892,6 +1911,7 @@ bool Variable::DeleteFromSubmodel(Variable* deletedvar) case varUncertWrapper: case varLayoutWrapper: case varConstraint: + case varLayoutColorEtc: //These types can't have rules to them. break; } @@ -2121,6 +2141,12 @@ bool Variable::Synchronize(Variable* clone, const Variable* conversionFactor) return true; } break; + case formulaALGEBRAIC: + if (clone->SetAlgebraicRule(0, &m_valFormula)) { + g_registry.AddErrorPrefix("Cannot synchronize " + GetNameDelimitedBy(".") + " with " + clone->GetNameDelimitedBy(".") + ": "); + return true; + } + break; case formulaKINETIC: case formulaTRIGGER: assert(false); //How did a reaction or trigger have a m_valFormula? @@ -2451,6 +2477,7 @@ bool Variable::AllowedInFormulas() const case varUncertWrapper: case varLayoutWrapper: case varConstraint: + case varAlgebraicRule: return false; } From 5939ef5eefa25977433ded6a243f98b12099df5e Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 16:44:00 -0700 Subject: [PATCH 20/43] Typo. --- src/antimony_api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/antimony_api.cpp b/src/antimony_api.cpp index b3894691..dc612b95 100644 --- a/src/antimony_api.cpp +++ b/src/antimony_api.cpp @@ -2066,7 +2066,7 @@ LIB_EXTERN char* printAllDataFor(const char* moduleName) break; case formulaALGEBRAIC: if (string(symbolequations[var]) != "") { - ret << "\Algebraic rule: " << symbolequations[var] << endl; + ret << "\tAlgebraic rule: " << symbolequations[var] << endl; } break; } From 11fe865c92e4045d1298fc585164d35d306e6990 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 17:08:09 -0700 Subject: [PATCH 21/43] Remove sprintf. Sprintf has been getting warnings for years; replace with stringstreams. --- src/antimony_api.cpp | 12 ++++-------- src/module.cpp | 6 +++--- src/reactantlist.cpp | 6 +++--- src/sbmlx.cpp | 6 +++--- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/antimony_api.cpp b/src/antimony_api.cpp index dc612b95..8321f504 100644 --- a/src/antimony_api.cpp +++ b/src/antimony_api.cpp @@ -2124,10 +2124,8 @@ LIB_EXTERN char* printAllDataFor(const char* moduleName) if (var > 0) { ret << " + "; } - if (leftrxnstoichs[rxn][var] > 1) { - char lnum[50]; - sprintf(lnum, "%g", leftrxnstoichs[rxn][var]); - ret << lnum; + if (leftrxnstoichs[rxn][var] != 1) { + ret << leftrxnstoichs[rxn][var]; } ret << leftrxnnames[rxn][var]; } @@ -2136,10 +2134,8 @@ LIB_EXTERN char* printAllDataFor(const char* moduleName) if (var > 0) { ret << " + "; } - if (rightrxnstoichs[rxn][var] > 1) { - char rnum[50]; - sprintf(rnum, "%g", rightrxnstoichs[rxn][var]); - ret << rnum; + if (rightrxnstoichs[rxn][var] != 1) { + ret << rightrxnstoichs[rxn][var]; } ret << rightrxnnames[rxn][var]; } diff --git a/src/module.cpp b/src/module.cpp index d0e73672..da635ee8 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -312,11 +312,11 @@ Variable* Module::AddNewNumberedVariable(const string name) string newvarname; Variable* foundvar = NULL; do { - char charnum[50]; - sprintf(charnum, "%li", num); + stringstream charnum; + charnum << num; num++; newvarname = name; - newvarname += charnum; + newvarname += charnum.str(); vector fullname; fullname.push_back(newvarname); foundvar = GetVariable(fullname); diff --git a/src/reactantlist.cpp b/src/reactantlist.cpp index fab69055..deb6bc96 100644 --- a/src/reactantlist.cpp +++ b/src/reactantlist.cpp @@ -142,9 +142,9 @@ string ReactantList::ToStringDelimitedBy(std::string cc) const retval += " "; } else if (get<0>(m_components[component]) != 1) { - char charnum[50]; - sprintf(charnum, "%g", get<0>(m_components[component])); - retval += charnum; + stringstream charnum; + charnum << get<0>(m_components[component]); + retval += charnum.str(); retval += ' '; } //Species reference: diff --git a/src/sbmlx.cpp b/src/sbmlx.cpp index 27580761..449824bb 100644 --- a/src/sbmlx.cpp +++ b/src/sbmlx.cpp @@ -40,11 +40,11 @@ string getNameFromSBMLObject(const SBase* sbml, string basename) long num=0; Variable* foundvar = NULL; do { - char charnum[50]; - sprintf(charnum, "%li", num); + stringstream charnum; + charnum << num; num++; name = basename; - name += charnum; + name += charnum.str(); vector fullname; fullname.push_back(name); foundvar = g_registry.CurrentModule()->GetVariable(fullname); From b6ab79dd820cf349d516d9357f5f7b9e9cf13628 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 17:15:00 -0700 Subject: [PATCH 22/43] Fix python warning. The "{" and "}" characters are actually already unique; I don't need to also check for the preceeding "\". --- src/bindings/python/createAntimonyLib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/python/createAntimonyLib.py b/src/bindings/python/createAntimonyLib.py index 17fadbca..a80981c2 100644 --- a/src/bindings/python/createAntimonyLib.py +++ b/src/bindings/python/createAntimonyLib.py @@ -141,9 +141,9 @@ def readHeaderFiles(headerfile): cline = line.strip(); if "@name" in line: continue - if "\{" in line: + if "{" in line: continue - if "\}" in line: + if "}" in line: continue cline = cline.replace("/**", "") cline = cline.replace("*/", "") From 74f357bdda5e59d451654405a9b618fc983e213a Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 16 Aug 2024 17:49:42 -0700 Subject: [PATCH 23/43] Fix more warnings. signed/unsigned issues; double/int issues. Fixing the latter now acutally allows defining algebraic rules with doubles, not just ints. --- src/annotated.cpp | 6 +++--- src/annotated.h | 2 +- src/module.cpp | 2 +- src/module.h | 2 +- src/registry.cpp | 28 ++++++++++++++++++++-------- src/registry.h | 8 ++++---- src/variable.cpp | 2 +- src/variable.h | 2 +- 8 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/annotated.cpp b/src/annotated.cpp index 9d890c67..f270d2b0 100644 --- a/src/annotated.cpp +++ b/src/annotated.cpp @@ -94,7 +94,7 @@ string Annotated::GetCreatorStringFor(const string& id) const { string ret = ""; ModelHistory* mh = const_cast(&m_history); - for (size_t v = 0; v < mh->getNumCreators(); v++) { + for (unsigned int v = 0; v < mh->getNumCreators(); v++) { string left = id + " creator" + to_string(v+1) + "."; ModelCreator* mc = mh->getCreator(v); if (mc->isSetName()) { @@ -318,7 +318,7 @@ void Annotated::AppendNotes(const std::vector& resources) } } -bool Annotated::addCreatorInfo(int creator_number, const string& creator_substr, const vector& resources) +bool Annotated::addCreatorInfo(unsigned int creator_number, const string& creator_substr, const vector& resources) { ModelCreator* creator = NULL; if (creator_number <= m_history.getNumCreators()) { @@ -518,7 +518,7 @@ void Annotated::PopulateCVTerms(SBase* sbmlobj) if (sbmlobj->isSetCreatedDate()) { SetCreated(sbmlobj->getCreatedDate()); } - for (size_t i = 0; i < sbmlobj->getNumModifiedDates(); i++) { + for (unsigned int i = 0; i < sbmlobj->getNumModifiedDates(); i++) { AppendModified(sbmlobj->getModifiedDate(i)); } if (sbmlobj->isSetModelHistory()) { diff --git a/src/annotated.h b/src/annotated.h index a8497934..1930043b 100644 --- a/src/annotated.h +++ b/src/annotated.h @@ -62,7 +62,7 @@ std::vector ResourcesToVector(const libsbml::CVTerm* t) const; void AppendBiolQualifiers(const libsbml::BiolQualifierType_t qual, const std::vector& resources); // appends notes (just strings) void AppendNotes(const std::vector& resources); - bool addCreatorInfo(int creator_number, const std::string& creator_substr, const std::vector& resources); + bool addCreatorInfo(unsigned int creator_number, const std::string& creator_substr, const std::vector& resources); void SetCreated(libsbml::Date* date); bool SetCreated(const std::string& date); bool SetCreated(const std::string& qual, const std::string& date); diff --git a/src/module.cpp b/src/module.cpp index da635ee8..a2ec6d68 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -364,7 +364,7 @@ Variable* Module::AddNewReaction(const ReactantList& left, rd_type divider, cons return var; } -bool Module::AddNewAlgebraicRule(int num, Formula* formula) +bool Module::AddNewAlgebraicRule(double num, Formula* formula) { Variable* newalgrule = AddNewNumberedVariable("_alg"); return newalgrule->SetAlgebraicRule(num, formula); diff --git a/src/module.h b/src/module.h index 23c86685..091131d8 100644 --- a/src/module.h +++ b/src/module.h @@ -130,7 +130,7 @@ class Module : public Annotated bool AddVariableToExportList(Variable* var); Variable* AddNewReaction(const ReactantList& left, rd_type divider, const ReactantList& right, Formula* formula); Variable* AddNewReaction(const ReactantList& left, rd_type divider, const ReactantList& right, Formula* formula, Variable* var); - bool AddNewAlgebraicRule(int val, Formula* formula); + bool AddNewAlgebraicRule(double val, Formula* formula); bool SetFormula(Formula* formula); void SetNewTopName(std::string newmodname, std::string newtopname); bool SetModule(const std::string* modname); diff --git a/src/registry.cpp b/src/registry.cpp index 82754f62..9c299c8b 100644 --- a/src/registry.cpp +++ b/src/registry.cpp @@ -1161,7 +1161,7 @@ AntimonyEvent* Registry::GetCurrentEvent() { return CurrentModule()->GetVariable(m_currentEvent)->GetEvent(); } -bool Registry::AddNewAlgebraicRuleToCurrent(int val, Formula* formula) +bool Registry::AddNewAlgebraicRuleToCurrent(double val, Formula* formula) { return CurrentModule()->AddNewAlgebraicRule(val, formula); } @@ -1523,9 +1523,15 @@ bool Registry::ProcessGlobalCVTerm(const string* name, const string* qual, vecto } } -bool Registry::ProcessCreatorTerm(Annotated* a, const string* creator, const string* cterm, int resource) +bool Registry::ProcessCreatorTerm(Annotated* a, const string* creator, const string* cterm, double resource) { - string val = to_string(resource); + if (abs(resource - round(resource)) > 0.000001) { + stringstream err; + err << "Unable to use " << resource << " as a creator term resource; only non-decimal numbers are allowed."; + g_registry.SetError(err.str()); + return true; + } + string val = to_string(round(resource)); vector vals; vals.push_back(val); return ProcessCreatorTerm(a, creator, cterm, &vals); @@ -1533,7 +1539,7 @@ bool Registry::ProcessCreatorTerm(Annotated* a, const string* creator, const str bool Registry::ProcessCreatorTerm(Annotated* a, const string* creator, const string* cterm, vector* resources) { - int creator_number = 0; + unsigned int creator_number = 0; if (*creator == "created") { if (resources->size() > 1) { @@ -1560,9 +1566,15 @@ bool Registry::ProcessCreatorTerm(Annotated* a, const string* creator, const str return false; } -bool Registry::ProcessGlobalCreatorTerm(const string* name, const string* creator, const string* cterm, int resource) +bool Registry::ProcessGlobalCreatorTerm(const string* name, const string* creator, const string* cterm, double resource) { - string val = to_string(resource); + if (abs(resource - round(resource)) > 0.000001) { + stringstream err; + err << "Unable to use " << resource << " as a creator term resource; only non-decimal numbers are allowed."; + g_registry.SetError(err.str()); + return true; + } + string val = to_string(round(resource)); vector vals; vals.push_back(val); return ProcessGlobalCreatorTerm(name, creator, cterm, &vals); @@ -1579,7 +1591,7 @@ bool Registry::ProcessGlobalCreatorTerm(const string* name, const string* creato delete resources; return true; } - int creator_number = 0; + unsigned int creator_number = 0; if (*creator == "created") { if (resources->size() > 1) { SetError("Unable to set multiple date elements at once."); @@ -1610,7 +1622,7 @@ bool Registry::ProcessGlobalCreatorTerm(const string* name, const string* creato } } -bool Registry::CheckCreatorString(const string& qualifier, int& creator_number) +bool Registry::CheckCreatorString(const string& qualifier, unsigned int& creator_number) { if (qualifier == "creator") { creator_number = 1; diff --git a/src/registry.h b/src/registry.h index b727f0ac..52c6e5b3 100644 --- a/src/registry.h +++ b/src/registry.h @@ -158,7 +158,7 @@ class Registry AntimonyEvent* GetCurrentEvent(); //Algebraic rules - bool AddNewAlgebraicRuleToCurrent(int val, Formula* formula); + bool AddNewAlgebraicRuleToCurrent(double val, Formula* formula); Variable* GetCurrentSubmodel(); void SetError(std::string error) {m_error = error;}; @@ -207,15 +207,15 @@ class Registry // CV terms bool ProcessGlobalCVTerm(const std::string* name, const std::string* qual, std::vector* resources); - bool ProcessCreatorTerm(Annotated* a, const std::string* creator, const std::string* cterm, int resource); + bool ProcessCreatorTerm(Annotated* a, const std::string* creator, const std::string* cterm, double resource); bool ProcessCreatorTerm(Annotated* a, const std::string* creator, const std::string* cterm, std::vector* resources); - bool ProcessGlobalCreatorTerm(const std::string* name, const std::string* creator, const std::string* cterm, int resource); + bool ProcessGlobalCreatorTerm(const std::string* name, const std::string* creator, const std::string* cterm, double resource); bool ProcessGlobalCreatorTerm(const std::string* name, const std::string* creator, const std::string* cterm, std::vector* resources); - bool CheckCreatorString(const std::string& qualifier, int& creator_number); + bool CheckCreatorString(const std::string& qualifier, unsigned int& creator_number); //Keeping track of malloc'd stuff so we can free it ourselves if need be. std::vector m_charstars; diff --git a/src/variable.cpp b/src/variable.cpp index b9b48319..d8de88c5 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -1262,7 +1262,7 @@ bool Variable::SetRateRule(Formula* formula) return false; } -bool Variable::SetAlgebraicRule(int val, Formula* formula) +bool Variable::SetAlgebraicRule(double val, Formula* formula) { if (IsPointer()) { return GetSameVariable()->SetAlgebraicRule(val, formula); diff --git a/src/variable.h b/src/variable.h index 1dd00dcc..06c24865 100644 --- a/src/variable.h +++ b/src/variable.h @@ -153,7 +153,7 @@ class Variable : public Annotated virtual bool SetFormula(Formula* formula, bool isObjective=false); bool SetAssignmentRule(Formula* formula); bool SetRateRule(Formula* formula); - bool SetAlgebraicRule(int val, Formula* formula); + bool SetAlgebraicRule(double val, Formula* formula); bool SetReaction(AntimonyReaction* rxn); bool SetModule(const std::string* modname); bool SetEvent(const AntimonyEvent* event); From cfc1d2719e0e794668764fec7814696dd3d1784c Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 20 Aug 2024 11:09:46 -0700 Subject: [PATCH 24/43] Write 'size' instead of height/width. --- src/module-sbml.cpp | 22 +++++++++++----------- src/module.cpp | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 03401232..de0e2608 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -3269,20 +3269,20 @@ void Module::LoadLayout(Model* sbml) form.Clear(); } - // Width + // Size val = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, varid); - if (val && val != defaults[type].width) { - LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_width); + double valh = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, varid); + if ((val && val != defaults[type].width) || (valh && valh != defaults[type].height)) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_size); + string text = "{"; + form.AddText(&text, true); form.AddNum(val); - lw->SetFormula(&form); - form.Clear(); - } + text = ","; + form.AddText(&text, true); + form.AddNum(valh); + text = "}"; + form.AddText(&text, true); - // Height - val = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, varid); - if (val && val != defaults[type].height) { - LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_height); - form.AddNum(val); lw->SetFormula(&form); form.Clear(); } diff --git a/src/module.cpp b/src/module.cpp index a2ec6d68..29155eb0 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -2393,6 +2393,7 @@ string Module::GetAntimony(set& usedmods, bool funcsincluded, boo } if (m_autolayout.use) { + retval += "\n"; retval += GetAntimonyAutolayout(indent); retval += "\n"; retval += GetAntimonyGeneralLayout(indent); From 4ddadfa390e2ae4d81729c70c16ee617eae74ba5 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 23 Aug 2024 16:31:39 -0700 Subject: [PATCH 25/43] A variety of fixes and updates: * It's now 'layout' that's on/off, not 'autolayout'. * X and Y are now set properly instead of to NaN. * More often export size if height or width is different. * Check valid color values. * Allow different capitalizations of layout keywords. --- src/antimony.tab.cpp | 2272 +++++++++++++++++++++-------------------- src/antimony.ypp | 50 +- src/layoutWrapper.cpp | 54 +- src/module.cpp | 25 +- src/module.h | 4 +- src/sbmlx.cpp | 13 + src/sbmlx.h | 2 + src/typex.cpp | 48 +- src/variable.cpp | 12 +- 9 files changed, 1287 insertions(+), 1193 deletions(-) diff --git a/src/antimony.tab.cpp b/src/antimony.tab.cpp index f2b4d483..1fdb74e6 100644 --- a/src/antimony.tab.cpp +++ b/src/antimony.tab.cpp @@ -721,16 +721,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1365 +#define YYLAST 1427 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 69 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 73 /* YYNRULES -- Number of rules. */ -#define YYNRULES 264 +#define YYNRULES 265 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 514 +#define YYNSTATES 515 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 300 @@ -790,27 +790,27 @@ static const yytype_int16 yyrline[] = 210, 213, 214, 215, 225, 226, 227, 230, 231, 237, 240, 243, 244, 247, 248, 249, 250, 251, 254, 255, 258, 259, 260, 261, 264, 269, 274, 279, 289, 299, - 309, 323, 337, 351, 367, 368, 369, 372, 373, 374, - 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 393, 401, 409, 417, 425, 433, - 443, 444, 445, 446, 447, 448, 452, 453, 454, 455, - 456, 459, 460, 461, 462, 463, 464, 465, 466, 467, - 468, 469, 470, 471, 472, 475, 476, 479, 480, 481, - 482, 483, 484, 485, 488, 489, 490, 491, 492, 495, - 496, 497, 500, 501, 502, 503, 504, 505, 506, 507, - 508, 511, 512, 515, 515, 516, 516, 520, 521, 522, - 523, 524, 528, 529, 533, 537, 538, 539, 540, 541, - 542, 543, 544, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 558, 559, 560, 561, 564, 565, 566, 567, - 568, 571, 572, 573, 574, 577, 578, 579, 580, 583, - 584, 585, 586, 590, 591, 592, 593, 594, 597, 598, - 599, 602, 605, 608, 609, 612, 613, 614, 615, 616, - 619, 620, 623, 623, 624, 624, 625, 625, 626, 626, - 629, 630, 633, 634, 641, 642, 643, 644, 645, 648, - 649, 652, 667, 668, 669, 670, 671, 672, 675, 678, - 679, 682, 683, 684, 686, 686, 689, 690, 695, 696, - 697, 700, 711, 721, 731, 741, 755, 769, 783, 799, - 801, 805, 806, 807, 808 + 309, 323, 337, 351, 365, 381, 382, 383, 386, 387, + 388, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 407, 415, 423, 431, 439, + 447, 457, 458, 459, 460, 461, 462, 466, 467, 468, + 469, 470, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 489, 490, 493, 494, + 495, 496, 497, 498, 499, 502, 503, 504, 505, 506, + 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 525, 526, 529, 529, 530, 530, 534, 535, + 536, 537, 538, 542, 543, 547, 551, 552, 553, 554, + 555, 556, 557, 558, 561, 562, 563, 564, 565, 566, + 567, 568, 569, 572, 573, 574, 575, 578, 579, 580, + 581, 582, 585, 586, 587, 588, 591, 592, 593, 594, + 597, 598, 599, 600, 604, 605, 606, 607, 608, 611, + 612, 613, 616, 619, 622, 623, 626, 627, 628, 629, + 630, 633, 634, 637, 637, 638, 638, 639, 639, 640, + 640, 643, 644, 647, 648, 655, 656, 657, 658, 659, + 662, 663, 666, 681, 682, 683, 684, 685, 686, 689, + 692, 693, 696, 697, 698, 700, 700, 703, 704, 709, + 710, 711, 714, 725, 735, 745, 755, 769, 783, 797, + 813, 815, 819, 820, 821, 822 }; #endif @@ -865,12 +865,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-403) +#define YYPACT_NINF (-394) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-91) +#define YYTABLE_NINF (-92) #define yytable_value_is_error(Yyn) \ 0 @@ -879,58 +879,58 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - -403, 759, -403, -403, 133, 25, -403, 240, 285, -403, - -403, -403, -403, -403, 196, 360, 143, 326, 25, 25, - 25, -403, 25, 287, 275, 25, 74, -403, -403, 250, - 278, 25, 303, 409, 286, 25, 396, -403, -403, -403, - -403, -403, 352, 107, 174, -403, -403, 61, 497, 403, - -403, 61, 61, 61, 61, -8, 72, 101, 158, 182, - 185, 251, 289, 61, 61, -403, 25, 61, 147, 61, - 61, -403, -403, 61, -403, -403, -403, -403, -403, 360, - -403, -403, 44, -403, -403, -403, -403, -403, -403, 44, - -403, -403, -403, 886, 41, 111, -403, 321, -403, -403, - -403, 126, 25, 25, 25, 25, 25, -403, 25, 282, - -403, 122, 25, 44, -403, -403, 46, 315, 336, -403, - -403, -403, -403, -403, 376, 229, 344, -403, 388, 397, - 216, -403, -403, -403, 407, -403, 414, -403, 25, -403, - 1, 25, 25, 25, 25, 25, 25, 25, 390, -403, - 438, 232, -403, 25, 44, 25, -403, 104, -403, 493, - 399, -403, 410, 417, 47, 25, 460, 3, -403, -403, - -403, -403, 25, 25, 25, 25, 25, 25, 25, 25, - -403, -403, 284, -403, 25, -403, -403, -403, 1081, -403, - -403, 1081, 1081, 463, 1081, 478, 479, -403, -403, -403, - -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, - 435, -403, -403, 44, -403, -403, -403, 436, -403, -403, - 442, 447, 1081, 1081, -403, -403, -403, -403, -403, -403, - -403, 25, 284, 450, -403, 225, 61, 441, 7, 506, - 225, 61, 510, 468, 110, 514, 481, 1300, 225, 484, - 485, -403, -403, -403, -403, -403, -403, -403, -403, -403, - 25, -403, 529, 490, 44, 13, 1081, -403, -403, 357, - 1081, 37, -403, 494, -403, 437, 497, 403, -403, -403, - -403, 25, 460, -403, 5, -403, -403, -403, -403, -403, - -403, -403, -403, -403, -403, 44, 1081, 489, 520, -403, - -403, 1081, 1081, 244, -403, 293, 217, -403, -403, 1081, - -403, -403, 1081, -403, 538, 209, -403, -403, 25, 537, - 297, 191, -403, -403, -403, 44, 261, 499, 1300, 539, - 324, 211, 25, 360, 501, 374, 173, -403, -403, -403, - -403, -403, 1081, -403, 235, 25, 25, -403, 951, -403, - 1081, 105, 15, 1081, 1081, 44, 44, 1016, -403, 1016, - 315, -403, -403, -403, -403, -403, 542, -403, 28, 1081, - 1081, 1081, -403, -403, 507, 380, 44, 503, -403, -403, - -403, 61, 225, -403, 517, 25, 1138, 505, -403, -403, - -403, 61, 225, 382, 241, -403, -403, -403, 1081, 1081, - -403, 490, 44, 44, 1081, -403, -403, 510, -403, 16, - -403, 25, -403, 1016, -403, 490, 217, 1081, 508, -403, - 125, -403, -403, 61, 25, 119, -403, -403, -3, -403, - 44, 394, -403, 234, -403, -403, 1300, 1081, 217, 433, - 1016, -403, 1016, 44, -403, 28, -403, -403, 201, 1081, - 61, 44, -403, -403, 518, 548, -403, 1300, -403, -403, - 518, 1192, -403, 28, -403, -403, 1016, -403, -403, 1081, - 821, -403, -403, 61, -403, 44, 299, 337, 509, 1246, - 411, 418, -403, 217, -403, -3, -403, 34, 65, 116, - -403, 12, -403, 530, -403, -403, -403, 28, -403, 25, - -403, 25, -403, 25, 44, -403, 555, -403, 44, -403, - -403, -403, 44, -403 + -394, 767, -394, -394, 167, 115, -394, 175, 253, -394, + -394, -394, -394, -394, 388, 239, 149, 329, 115, 115, + 115, -394, 115, 282, 258, 115, -26, -394, -394, 189, + 255, 115, 390, 401, 210, 115, 473, -394, -394, -394, + -394, -394, 499, 14, 74, -394, -394, 12, 353, 307, + -394, 12, 12, 12, 12, -3, 90, 141, 196, 198, + 208, 240, 246, 12, 12, -394, 115, 12, 64, 12, + 12, -394, -394, 12, -394, -394, -394, -394, -394, 239, + -394, -394, 75, -394, -394, -394, -394, -394, -394, 75, + -394, -394, -394, 894, 121, 183, -394, 309, -394, -394, + -394, 93, 115, 115, 115, 115, 115, -394, 115, 257, + -394, 184, 115, 75, -394, -394, 298, 263, 270, -394, + -394, -394, -394, -394, 312, 185, 286, -394, 326, 330, + 195, -394, -394, -394, 338, -394, 345, -394, 115, -394, + 66, 115, 115, 115, 115, 115, 115, 115, 313, -394, + 348, 197, -394, 115, 75, 115, -394, 77, -394, 267, + 317, -394, 335, 336, 27, 115, 409, 18, -394, -394, + -394, -394, 115, 115, 115, 115, 115, 115, 115, 115, + -394, -394, 194, -394, 115, -394, -394, -394, 1089, -394, + -394, 1089, 1089, 370, 1089, 389, 392, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + 357, -394, -394, 75, -394, -394, -394, 382, -394, -394, + 384, 387, 1089, 1089, -394, -394, -394, -394, -394, -394, + -394, 115, 194, 399, -394, 136, 12, 339, 80, 395, + 136, 12, 415, 373, 156, 435, 417, 1362, 136, 418, + 419, -394, -394, -394, -394, -394, -394, -394, -394, -394, + 115, -394, 457, 346, 75, 290, 1089, -394, -394, 40, + 1089, 169, -394, 420, -394, 344, 353, 307, -394, -394, + -394, 115, 409, -394, 30, -394, -394, -394, -394, -394, + -394, -394, -394, -394, -394, 75, 1089, 421, 444, -394, + -394, 1089, 1089, 362, -394, 206, 89, -394, -394, 1089, + -394, -394, 1089, -394, 477, -2, -394, -394, 115, 478, + 188, 209, -394, -394, -394, 75, 391, 438, 1362, 481, + 294, 214, 115, 239, 448, 227, 1146, -394, -394, -394, + -394, -394, 1089, -394, 218, 115, 115, -394, 959, -394, + 1089, 44, 31, 1089, 1089, 75, 75, 1024, -394, 1024, + 263, -394, -394, -394, -394, -394, 483, -394, 35, 1089, + 1089, 1089, -394, -394, 455, 393, 75, 450, -394, -394, + -394, 12, 136, -394, 416, 115, 1200, 454, -394, -394, + -394, 12, 136, 397, 207, -394, -394, -394, 1089, 1089, + -394, 346, 75, 75, 1089, -394, -394, 415, -394, 33, + -394, 115, -394, 1024, -394, 346, 89, 1089, 458, -394, + 172, -394, -394, 12, 115, 173, -394, -394, 8, -394, + 75, 412, -394, 142, -394, -394, 1362, 1089, 89, 414, + 1024, -394, 1024, 75, -394, 35, -394, -394, 153, 1089, + 12, 75, -394, -394, 422, 497, -394, 1362, -394, -394, + -394, 422, 1254, -394, 35, -394, -394, 1024, -394, -394, + 1089, 829, -394, -394, 12, -394, 75, 238, 274, 468, + 1308, 319, 331, -394, 89, -394, 8, -394, 55, 96, + 104, -394, -4, -394, 430, -394, -394, -394, 35, -394, + 115, -394, 115, -394, 115, 75, -394, 513, -394, 75, + -394, -394, -394, 75, -394 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -938,82 +938,82 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 2, 0, 1, 14, 0, 0, 131, 0, 37, 101, - 96, 97, 99, 100, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 239, 240, 0, - 0, 0, 0, 0, 0, 0, 0, 130, 129, 3, - 4, 6, 41, 79, 0, 13, 5, 0, 0, 0, - 83, 0, 0, 0, 0, 155, 156, 157, 158, 159, - 160, 161, 162, 0, 0, 203, 209, 0, 0, 0, - 0, 101, 12, 0, 11, 7, 8, 9, 10, 0, - 98, 37, 39, 127, 128, 125, 101, 124, 126, 91, - 101, 244, 101, 212, 0, 41, 42, 43, 193, 101, - 101, 0, 0, 0, 0, 0, 0, 178, 0, 0, - 199, 205, 206, 229, 181, 172, 0, 0, 0, 27, - 30, 29, 185, 16, 0, 0, 0, 145, 0, 0, - 19, 26, 25, 189, 0, 176, 0, 163, 0, 167, - 202, 0, 0, 0, 0, 0, 0, 0, 0, 198, - 0, 37, 210, 0, 92, 0, 101, 0, 101, 0, - 0, 70, 0, 0, 0, 0, 90, 0, 71, 82, - 72, 73, 0, 0, 0, 0, 0, 0, 0, 0, - 76, 74, 207, 75, 0, 77, 80, 81, 238, 78, - 101, 141, 232, 246, 235, 0, 0, 118, 117, 119, - 120, 123, 121, 104, 101, 105, 102, 106, 114, 101, - 0, 101, 122, 103, 109, 110, 222, 0, 101, 101, - 0, 0, 234, 236, 101, 195, 183, 174, 187, 191, - 165, 0, 208, 0, 241, 0, 0, 0, 0, 0, - 0, 0, 147, 23, 0, 0, 0, 0, 0, 0, - 0, 166, 101, 194, 182, 173, 186, 190, 177, 164, - 0, 38, 0, 248, 40, 0, 231, 140, 137, 134, - 133, 0, 101, 0, 101, 90, 0, 0, 204, 101, - 101, 0, 93, 101, 0, 101, 170, 175, 179, 184, - 188, 192, 196, 200, 211, 230, 233, 0, 0, 112, - 113, 214, 115, 0, 111, 0, 0, 101, 47, 44, - 101, 101, 237, 169, 0, 0, 264, 260, 34, 0, - 0, 0, 261, 259, 150, 148, 0, 0, 0, 0, + 2, 0, 1, 14, 0, 0, 132, 0, 37, 102, + 97, 98, 100, 101, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 240, 241, 0, + 0, 0, 0, 0, 0, 0, 0, 131, 130, 3, + 4, 6, 41, 80, 0, 13, 5, 0, 0, 0, + 84, 0, 0, 0, 0, 156, 157, 158, 159, 160, + 161, 162, 163, 0, 0, 204, 210, 0, 0, 0, + 0, 102, 12, 0, 11, 7, 8, 9, 10, 0, + 99, 37, 39, 128, 129, 126, 102, 125, 127, 92, + 102, 245, 102, 213, 0, 41, 42, 43, 194, 102, + 102, 0, 0, 0, 0, 0, 0, 179, 0, 0, + 200, 206, 207, 230, 182, 173, 0, 0, 0, 27, + 30, 29, 186, 16, 0, 0, 0, 146, 0, 0, + 19, 26, 25, 190, 0, 177, 0, 164, 0, 168, + 203, 0, 0, 0, 0, 0, 0, 0, 0, 199, + 0, 37, 211, 0, 93, 0, 102, 0, 102, 0, + 0, 71, 0, 0, 0, 0, 91, 0, 72, 83, + 73, 74, 0, 0, 0, 0, 0, 0, 0, 0, + 77, 75, 208, 76, 0, 78, 81, 82, 239, 79, + 102, 142, 233, 247, 236, 0, 0, 119, 118, 120, + 121, 124, 122, 105, 102, 106, 103, 107, 115, 102, + 0, 102, 123, 104, 110, 111, 223, 0, 102, 102, + 0, 0, 235, 237, 102, 196, 184, 175, 188, 192, + 166, 0, 209, 0, 242, 0, 0, 0, 0, 0, + 0, 0, 148, 23, 0, 0, 0, 0, 0, 0, + 0, 167, 102, 195, 183, 174, 187, 191, 178, 165, + 0, 38, 0, 249, 40, 0, 232, 141, 138, 135, + 134, 0, 102, 0, 102, 91, 0, 0, 205, 102, + 102, 0, 94, 102, 0, 102, 171, 176, 180, 185, + 189, 193, 197, 201, 212, 231, 234, 0, 0, 113, + 114, 215, 116, 0, 112, 0, 0, 102, 47, 44, + 102, 102, 238, 170, 0, 0, 265, 261, 34, 0, + 0, 0, 262, 260, 151, 149, 0, 0, 0, 0, 0, 0, 34, 37, 0, 0, 0, 51, 50, 54, - 101, 101, 201, 168, 0, 0, 0, 101, 216, 143, - 138, 0, 0, 132, 139, 94, 95, 48, 101, 48, - 0, 245, 222, 107, 101, 108, 0, 220, 0, 197, - 45, 46, 252, 242, 0, 0, 35, 0, 251, 253, - 254, 0, 0, 152, 0, 34, 0, 0, 57, 58, - 59, 0, 0, 0, 0, 20, 53, 52, 180, 171, - 250, 249, 136, 135, 142, 101, 222, 147, 101, 0, - 101, 0, 86, 48, 88, 247, 0, 116, 0, 221, - 0, 213, 243, 101, 0, 0, 263, 262, 48, 151, - 149, 0, 24, 0, 56, 55, 0, 218, 0, 0, - 48, 101, 48, 49, 85, 0, 101, 101, 0, 31, - 101, 36, 255, 256, 0, 0, 146, 0, 60, 61, - 0, 0, 222, 0, 152, 87, 48, 89, 215, 223, - 224, 28, 33, 32, 67, 64, 0, 0, 0, 0, - 0, 0, 18, 0, 217, 48, 84, 0, 0, 0, - 257, 0, 258, 0, 22, 62, 63, 0, 144, 0, - 227, 0, 225, 0, 65, 68, 0, 154, 153, 219, - 228, 226, 66, 69 + 102, 102, 202, 169, 0, 0, 0, 102, 217, 144, + 139, 0, 0, 133, 140, 95, 96, 48, 102, 48, + 0, 246, 223, 108, 102, 109, 0, 221, 0, 198, + 45, 46, 253, 243, 0, 0, 35, 0, 252, 254, + 255, 0, 0, 153, 0, 34, 0, 0, 57, 58, + 59, 0, 0, 0, 0, 20, 53, 52, 181, 172, + 251, 250, 137, 136, 143, 102, 223, 148, 102, 0, + 102, 0, 87, 48, 89, 248, 0, 117, 0, 222, + 0, 214, 244, 102, 0, 0, 264, 263, 48, 152, + 150, 0, 24, 0, 56, 55, 0, 219, 0, 0, + 48, 102, 48, 49, 86, 0, 102, 102, 0, 31, + 102, 36, 256, 257, 0, 0, 147, 0, 60, 61, + 62, 0, 0, 223, 0, 153, 88, 48, 90, 216, + 224, 225, 28, 33, 32, 68, 65, 0, 0, 0, + 0, 0, 0, 18, 0, 218, 48, 85, 0, 0, + 0, 258, 0, 259, 0, 22, 63, 64, 0, 145, + 0, 228, 0, 226, 0, 66, 69, 0, 155, 154, + 220, 229, 227, 67, 70 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, - 121, -294, -1, 0, 6, 541, -334, -326, 4, 118, - 120, 10, -403, -46, -40, 317, 365, -403, 21, 20, - -403, -403, -403, -403, -403, 172, 117, -403, -403, -403, - -403, -403, -403, -403, -403, -403, -403, -403, 423, 565, - -403, -403, -403, -403, -403, -369, -353, -402, -403, 366, - -403, -403, 426, -73, -403, -403, -403, -403, -403, -403, - -403, -403, -403 + -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, + 81, -322, -1, 0, 2, 549, -316, -326, 4, 69, + 71, 6, -394, -41, -39, 325, 322, -394, 21, 17, + -394, -394, -394, -394, -394, 128, 72, -394, -394, -394, + -394, -394, -394, -394, -394, -394, -394, -394, 379, 521, + -394, -394, -394, -394, -394, -393, -348, -309, -394, 324, + -394, -394, 381, -105, -394, -394, -394, -394, -394, -394, + -394, -394, -394 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { 0, 1, 39, 40, 246, 247, 327, 328, 41, 237, - 448, 375, 213, 96, 97, 98, 412, 336, 337, 476, - 477, 338, 47, 48, 49, 266, 303, 214, 215, 50, + 448, 375, 213, 96, 97, 98, 412, 336, 337, 477, + 478, 338, 47, 48, 49, 266, 303, 214, 215, 50, 51, 52, 53, 407, 242, 326, 428, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 216, 362, 406, 462, 368, 306, 421, 68, 267, + 67, 216, 362, 406, 463, 368, 306, 421, 68, 267, 69, 70, 71, 248, 72, 193, 298, 73, 74, 75, 76, 77, 78 }; @@ -1023,273 +1023,269 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 42, 43, 386, 167, 82, 45, 89, 44, 164, 416, - 163, 46, 163, 95, 150, 101, 95, 111, 113, 95, - 319, 95, 163, 163, 95, 414, 150, 505, 90, 92, - 95, 95, 95, 95, 140, 95, 99, 5, 393, 411, - 5, 154, 81, 468, 235, 81, 5, 445, 166, 5, - 172, 81, 240, 438, 81, 455, 345, 150, 217, 5, - 252, 484, 165, 233, 81, 182, 320, 161, 285, 463, - 358, 168, 169, 170, 171, 6, 506, 5, 263, 444, - 410, 441, 81, 180, 181, 500, 502, 183, 185, 186, - 187, 431, 419, 189, 456, 509, 347, 510, 499, 511, - 190, 95, 95, 95, 95, 95, 465, 95, 467, 483, - 461, 232, 283, 276, 497, -42, 5, 5, 284, 277, - 165, 81, 81, 329, 150, 37, 38, 123, 5, 501, - 173, 479, 486, 81, 452, 150, 453, 95, 150, 150, - 95, 95, 95, 95, 95, 95, 95, -42, 79, 152, - -42, 498, 264, 153, 265, 5, 269, 268, 275, 174, - 81, 6, 282, 166, 89, 154, -42, -42, -42, 330, - 408, 95, 95, 95, 95, 95, 95, 95, 95, 4, - 503, 454, 155, 295, 447, 5, 224, 6, 7, 80, - 333, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 100, 395, 184, 381, 22, 5, 94, - 25, 37, 38, 81, 156, 6, 175, 157, 27, 28, - 334, 335, 31, 32, 33, 34, 391, 35, 36, 245, - 95, 352, 471, 158, 159, 160, 351, 37, 38, 6, - 176, 325, 239, 177, 234, 262, 42, 43, 382, 458, - 400, 459, 5, 44, 245, 316, 317, 81, 392, 95, - 322, 323, 373, 124, 234, 37, 38, 125, 339, 234, - 89, 401, -17, 374, 154, 366, 166, 367, 83, 84, - 355, 356, 234, 315, 85, 234, 128, 415, 234, 37, - 38, 129, 119, 126, 234, 130, 460, 150, 5, 86, - 116, 363, 364, 81, 117, 409, 127, 87, 88, 178, - 120, 294, 378, 131, 379, 5, 134, 376, 383, 384, - 81, 380, 121, 83, 84, 132, 93, 42, 43, 85, - 118, 376, 91, 231, 44, 42, 43, 138, 5, 388, - 396, 389, 44, 81, 402, 403, 397, 179, 390, 102, - 166, 364, 87, 88, 92, 103, 365, 489, -90, -90, - 104, 218, 490, 105, 5, 150, 346, 420, 234, 151, - 150, -90, -90, -90, -90, 106, 107, 108, 109, 152, - 219, 220, 221, 430, 376, 42, 43, 129, 188, 236, - 396, 394, 44, 238, 153, 491, 397, 241, 83, 84, - 492, 426, 427, 191, 85, 243, 325, 192, 5, 194, - 443, 434, 435, 81, 244, 5, 222, 223, 165, 141, - 81, 5, 136, 451, 249, 142, 81, 87, 88, 5, - 143, 250, 281, 144, 81, 42, 43, 423, 424, 436, - 424, 260, 44, 450, 420, 145, 146, 147, 148, 5, - 150, 457, 424, 475, 81, 261, 42, 43, 280, 475, - 42, 43, 420, 44, 152, 396, 80, 44, 472, 489, - 450, 397, 5, 150, 495, 270, 491, 81, 42, 43, - 297, 496, 299, 396, 300, 44, 420, 420, 504, 397, - 464, 384, 508, 472, 304, 307, 420, 318, 420, 162, - 420, 310, 512, 162, 163, 5, 311, 296, 271, 314, - 81, 272, 10, 11, 12, 13, 10, 11, 12, 13, - 18, 301, 5, 321, -21, 324, 302, 81, 302, 5, - 5, 331, 429, 474, 81, 81, 309, 332, 27, 28, - 273, 312, 5, 340, 341, 507, 344, 81, 315, 360, - 349, 361, 274, 372, 377, 385, 387, 127, 110, 418, - 422, 114, 425, 115, 433, 478, 122, 446, 493, 342, - 513, 473, 133, 135, 137, 139, 305, 149, 480, 439, - 481, 485, 278, 112, 308, 279, 0, 0, 0, 348, - 0, 350, 0, 0, 0, 0, 353, 354, 0, 0, - 357, 0, 359, 0, 0, 0, 0, 0, 0, 0, + 42, 43, 386, 44, 82, 45, 89, 46, 167, 164, + 393, 506, 235, 95, 416, 101, 95, 111, 113, 95, + 240, 95, -42, 445, 95, 163, 6, 123, 90, 92, + 95, 95, 95, 95, 140, 95, 99, 163, 163, 5, + 163, 154, 165, 414, 81, 464, 263, 5, 166, 346, + 411, 373, 81, 150, -42, 172, 5, -42, 438, 165, + 507, 81, 374, 431, 161, 182, 455, 5, 168, 169, + 170, 171, 81, -42, -42, -42, 37, 38, 6, 150, + 180, 181, 155, 285, 183, 185, 186, 187, 150, 5, + 189, 498, 283, 319, 81, 358, 410, 444, 441, 419, + 190, 95, 95, 95, 95, 95, 150, 95, 5, 408, + 462, 232, 456, 81, 156, 484, 5, 157, 276, 500, + 277, 81, 184, 284, 466, 252, 468, 5, 37, 38, + 268, 480, 81, 158, 159, 160, 469, 95, 217, 320, + 95, 95, 95, 95, 95, 95, 95, 366, 173, 367, + 6, 487, 264, 224, 265, 485, 269, 458, 275, 459, + 502, 5, 282, 166, 89, 154, 81, 6, 504, 329, + 499, 95, 95, 95, 95, 95, 95, 95, 95, 501, + 503, 5, 79, 295, 472, 150, 81, 5, 452, 510, + 453, 511, 81, 512, 315, 460, 150, 150, 239, 174, + 37, 38, 124, 378, 461, 379, 125, 150, 245, 100, + 262, 152, 380, 83, 84, 330, 382, 37, 38, 85, + 245, 294, 5, 80, 381, 153, 392, 81, 347, 391, + 95, 447, 126, 400, 86, 454, 352, 351, 234, 401, + 129, 325, 87, 88, 394, 127, 42, 43, 234, 44, + 234, -17, 316, 317, 175, 415, 176, 322, 323, 95, + 234, 138, 234, 128, 364, 339, 177, 234, 129, 365, + 89, 234, 130, 162, 154, 119, 166, 83, 84, 5, + 355, 356, 271, 85, 81, 272, 10, 11, 12, 13, + 131, 83, 84, 120, 18, 116, 490, 85, 178, 117, + 91, 491, 132, 150, 179, 121, 87, 88, 231, 388, + 409, 389, 27, 28, 273, 233, 234, 376, 390, 5, + 87, 88, 165, 236, 81, 118, 274, 42, 43, 238, + 44, 376, 492, 345, 93, 42, 43, 493, 44, 241, + 396, 5, 397, 243, 402, 403, 81, 244, 5, 218, + 166, 281, 102, 81, 92, 249, 5, 150, 103, 162, + 163, 81, 250, 104, 260, 261, 105, 420, 219, 220, + 221, 152, 10, 11, 12, 13, 280, 490, 106, 107, + 108, 109, 496, 430, 376, 42, 43, 297, 44, 492, + 396, 80, 397, 299, 497, 318, 188, 300, 426, 427, + 5, 94, 5, 134, 315, 81, 325, 81, 434, 435, + 443, 191, 321, 5, 136, 192, 304, 194, 81, 363, + 364, 5, 150, 451, 222, 223, 81, 5, 5, -21, + 324, 429, 81, 81, 5, 42, 43, 475, 44, 81, + 450, 307, 5, 310, 420, 508, 311, 81, 383, 384, + 423, 424, 331, 476, 436, 424, 42, 43, 314, 44, + 476, 42, 43, 420, 44, 473, 396, 450, 397, 457, + 424, 465, 384, 332, 344, 361, 349, 340, 341, 42, + 43, 360, 44, 270, 396, 5, 397, 420, 420, 505, + 81, 473, 372, 509, 385, 377, 141, 420, 387, 420, + 418, 420, 142, 513, 127, -91, -91, 143, 422, 425, + 144, 5, 150, 433, 479, 296, 151, 446, -91, -91, + -91, -91, 145, 146, 147, 148, 152, 494, 514, 301, + 481, 474, 482, 305, 302, 439, 302, 486, 278, 112, + 279, 153, 308, 0, 309, 0, 0, 0, 0, 312, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 369, 0, 0, 370, 371, 0, + 0, 0, 0, 0, 0, 0, 110, 0, 0, 114, + 0, 115, 0, 0, 122, 0, 0, 342, 0, 0, + 133, 135, 137, 139, 0, 149, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 348, 0, 350, + 0, 0, 0, 0, 353, 354, 0, 0, 357, 0, + 359, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 225, 226, 227, 228, 229, 0, 230, - 0, 0, 0, 0, 0, 0, 0, 398, 399, 0, - 0, 0, 0, 0, 404, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 413, 0, 0, 0, 251, - 0, 417, 253, 254, 255, 256, 257, 258, 259, 0, + 0, 0, 369, 0, 0, 370, 371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 225, 226, 227, 228, 229, 0, 230, 0, 0, + 0, 0, 0, 0, 0, 398, 399, 0, 0, 0, + 0, 0, 404, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 413, 0, 0, 0, 251, 0, 417, + 253, 254, 255, 256, 257, 258, 259, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 286, 287, 288, 289, 290, 291, 292, - 293, 0, 437, 0, 0, 440, 0, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 449, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 466, 2, - 3, 0, 0, 469, 470, 4, 0, 449, 0, 0, - 0, 5, 313, 6, 7, 0, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, - 0, 21, 0, 22, 23, 24, 25, 0, 0, 0, - 26, 343, 0, 0, 27, 28, 29, 30, 31, 32, - 33, 34, 0, 35, 36, 0, 0, 0, 0, 0, - 0, 0, 0, 37, 38, 195, 196, 197, 198, 199, - 200, 201, 202, 5, 0, 0, 203, 0, 81, 0, - 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, - 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, - 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, - 0, 0, 0, 0, 208, 0, 0, 209, 0, 487, - 210, 488, 0, 211, 0, 0, 0, 212, 87, 88, - 195, 196, 197, 198, 199, 200, 201, 202, 5, 0, - 0, 203, 204, 81, 0, 0, 0, 0, 0, 0, - 205, 0, 0, 0, 0, 0, 206, 0, 0, 0, - 0, 207, 0, 0, 83, 84, 0, 0, 0, 0, - 85, 0, 0, 0, 0, 0, 0, 0, 0, 208, - 0, 0, 209, 0, 0, 210, 0, 0, 211, 0, - 0, 0, 212, 87, 88, 195, 196, 197, 198, 199, - 200, 201, 202, 5, 0, 0, 203, 405, 81, 0, - 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, - 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, - 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, - 0, 0, 0, 0, 208, 0, 0, 209, 0, 0, - 210, 0, 0, 211, 0, 0, 0, 212, 87, 88, - 195, 196, 197, 198, 199, 200, 201, 202, 5, 0, - 0, 203, 0, 81, 0, 0, 0, 0, 0, 0, - 205, 0, 0, 0, 0, 0, 206, 0, 0, 0, - 0, 207, 0, 0, 83, 84, 0, 0, 411, 0, - 85, 0, 0, 0, 0, 0, 0, 0, 0, 208, - 0, 0, 209, 0, 0, 210, 0, 0, 211, 0, - 0, 0, 212, 87, 88, 195, 196, 197, 198, 199, - 200, 201, 202, 5, 0, 0, 203, 0, 81, 0, - 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, - 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, - 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, - 0, 0, 0, 0, 208, 0, 0, 209, 0, 0, - 210, 0, 0, 211, 4, 0, 0, 212, 87, 88, - 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 0, 432, - 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, - 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, - 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, - 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 0, 482, 0, 0, 22, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, - 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, - 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, + 0, 286, 287, 288, 289, 290, 291, 292, 293, 0, + 437, 0, 0, 440, 0, 442, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 449, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 467, 2, 3, 0, + 0, 470, 471, 4, 0, 449, 0, 0, 0, 5, + 313, 6, 7, 0, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 0, 0, 21, + 0, 22, 23, 24, 25, 0, 0, 0, 26, 343, + 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, + 0, 35, 36, 0, 0, 0, 0, 0, 0, 0, + 0, 37, 38, 195, 196, 197, 198, 199, 200, 201, + 202, 5, 0, 0, 203, 0, 81, 0, 0, 0, + 0, 0, 0, 205, 0, 0, 0, 0, 0, 206, + 0, 0, 0, 0, 207, 0, 0, 83, 84, 0, + 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, + 0, 0, 208, 0, 0, 209, 0, 488, 210, 489, + 0, 211, 0, 0, 0, 212, 87, 88, 195, 196, + 197, 198, 199, 200, 201, 202, 5, 0, 0, 203, + 204, 81, 0, 0, 0, 0, 0, 0, 205, 0, + 0, 0, 0, 0, 206, 0, 0, 0, 0, 207, + 0, 0, 83, 84, 0, 0, 0, 0, 85, 0, + 0, 0, 0, 0, 0, 0, 0, 208, 0, 0, + 209, 0, 0, 210, 0, 0, 211, 0, 0, 0, + 212, 87, 88, 195, 196, 197, 198, 199, 200, 201, + 202, 5, 0, 0, 203, 405, 81, 0, 0, 0, + 0, 0, 0, 205, 0, 0, 0, 0, 0, 206, + 0, 0, 0, 0, 207, 0, 0, 83, 84, 0, + 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, + 0, 0, 208, 0, 0, 209, 0, 0, 210, 0, + 0, 211, 0, 0, 0, 212, 87, 88, 195, 196, + 197, 198, 199, 200, 201, 202, 5, 0, 0, 203, + 0, 81, 0, 0, 0, 0, 0, 0, 205, 0, + 0, 0, 0, 0, 206, 0, 0, 0, 0, 207, + 0, 0, 83, 84, 0, 0, 411, 0, 85, 0, + 0, 0, 0, 0, 0, 0, 0, 208, 0, 0, + 209, 0, 0, 210, 0, 0, 211, 0, 0, 0, + 212, 87, 88, 195, 196, 197, 198, 199, 200, 201, + 202, 5, 0, 0, 203, 0, 81, 0, 0, 0, + 0, 0, 0, 205, 0, 0, 0, 0, 0, 206, + 0, 0, 0, 0, 207, 0, 0, 83, 84, 0, + 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, + 0, 0, 208, 0, 0, 209, 0, 0, 210, 0, + 0, 211, 4, 0, 0, 212, 87, 88, 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 0, 494, 0, 0, + 15, 16, 17, 18, 19, 20, 0, 395, 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 0, 0, 0, 0, 22, 0, 0, 25, 0, 0, + 0, 432, 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, - 0, 0, 0, 0, 37, 38 + 4, 0, 0, 0, 37, 38, 5, 0, 6, 7, + 0, 333, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 0, 483, 0, 0, 22, 0, + 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, + 28, 334, 335, 31, 32, 33, 34, 0, 35, 36, + 0, 0, 0, 0, 4, 0, 0, 0, 37, 38, + 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 0, 495, + 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, + 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, + 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, + 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 0, 0, 0, 0, 22, 0, 0, 25, + 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, + 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, + 0, 0, 0, 0, 0, 0, 37, 38 }; static const yytype_int16 yycheck[] = { - 1, 1, 328, 49, 5, 1, 7, 1, 48, 362, - 7, 1, 7, 14, 13, 16, 17, 18, 19, 20, - 13, 22, 7, 7, 25, 359, 13, 15, 7, 8, - 31, 32, 33, 34, 35, 36, 15, 12, 332, 42, - 12, 42, 17, 445, 117, 17, 12, 416, 49, 12, - 58, 17, 125, 406, 17, 58, 43, 13, 17, 12, - 59, 463, 15, 17, 17, 66, 59, 47, 65, 438, - 65, 51, 52, 53, 54, 14, 64, 12, 151, 413, - 65, 65, 17, 63, 64, 487, 488, 67, 68, 69, - 70, 385, 64, 73, 428, 497, 59, 499, 64, 501, - 79, 102, 103, 104, 105, 106, 440, 108, 442, 462, - 436, 112, 65, 159, 483, 8, 12, 12, 164, 159, - 15, 17, 17, 13, 13, 64, 65, 53, 12, 64, - 58, 457, 466, 17, 15, 13, 17, 138, 13, 13, - 141, 142, 143, 144, 145, 146, 147, 40, 15, 27, - 43, 485, 153, 42, 155, 12, 157, 53, 159, 58, - 17, 14, 163, 164, 165, 166, 59, 60, 61, 59, - 65, 172, 173, 174, 175, 176, 177, 178, 179, 6, - 64, 62, 8, 184, 59, 12, 60, 14, 15, 56, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 60, 31, 58, 15, 34, 12, 13, - 37, 64, 65, 17, 40, 14, 58, 43, 45, 46, - 47, 48, 49, 50, 51, 52, 15, 54, 55, 13, - 231, 277, 31, 59, 60, 61, 276, 64, 65, 14, - 58, 242, 13, 58, 53, 13, 247, 247, 321, 15, - 15, 17, 12, 247, 13, 235, 236, 17, 331, 260, - 240, 241, 53, 13, 53, 64, 65, 17, 248, 53, - 271, 344, 56, 64, 275, 58, 277, 60, 38, 39, - 281, 282, 53, 58, 44, 53, 8, 360, 53, 64, - 65, 13, 17, 43, 53, 17, 62, 13, 12, 59, - 13, 57, 58, 17, 17, 351, 56, 67, 68, 58, - 35, 27, 15, 35, 17, 12, 13, 318, 57, 58, - 17, 24, 47, 38, 39, 47, 9, 328, 328, 44, - 43, 332, 47, 51, 328, 336, 336, 51, 12, 15, - 336, 17, 336, 17, 345, 346, 336, 58, 24, 23, - 351, 58, 67, 68, 333, 29, 63, 58, 6, 7, - 34, 40, 63, 37, 12, 13, 9, 368, 53, 17, - 13, 19, 20, 21, 22, 49, 50, 51, 52, 27, - 59, 60, 61, 384, 385, 386, 386, 13, 71, 53, - 386, 17, 386, 17, 42, 58, 386, 53, 38, 39, - 63, 381, 382, 86, 44, 17, 407, 90, 12, 92, - 411, 391, 392, 17, 17, 12, 99, 100, 15, 23, - 17, 12, 13, 424, 17, 29, 17, 67, 68, 12, - 34, 17, 15, 37, 17, 436, 436, 57, 58, 57, - 58, 51, 436, 423, 445, 49, 50, 51, 52, 12, - 13, 57, 58, 454, 17, 17, 457, 457, 59, 460, - 461, 461, 463, 457, 27, 461, 56, 461, 448, 58, - 450, 461, 12, 13, 63, 158, 58, 17, 479, 479, - 17, 63, 4, 479, 5, 479, 487, 488, 489, 479, - 57, 58, 493, 473, 59, 59, 497, 56, 499, 6, - 501, 59, 503, 6, 7, 12, 59, 190, 15, 59, - 17, 18, 19, 20, 21, 22, 19, 20, 21, 22, - 27, 204, 12, 17, 56, 15, 209, 17, 211, 12, - 12, 17, 15, 15, 17, 17, 219, 56, 45, 46, - 47, 224, 12, 59, 59, 15, 17, 17, 58, 60, - 56, 31, 59, 15, 17, 56, 17, 56, 17, 17, - 53, 20, 59, 22, 59, 17, 25, 59, 59, 252, - 15, 450, 31, 32, 33, 34, 211, 36, 460, 407, - 460, 464, 159, 18, 218, 159, -1, -1, -1, 272, - -1, 274, -1, -1, -1, -1, 279, 280, -1, -1, - 283, -1, 285, -1, -1, -1, -1, -1, -1, -1, + 1, 1, 328, 1, 5, 1, 7, 1, 49, 48, + 332, 15, 117, 14, 362, 16, 17, 18, 19, 20, + 125, 22, 8, 416, 25, 7, 14, 53, 7, 8, + 31, 32, 33, 34, 35, 36, 15, 7, 7, 12, + 7, 42, 15, 359, 17, 438, 151, 12, 49, 9, + 42, 53, 17, 13, 40, 58, 12, 43, 406, 15, + 64, 17, 64, 385, 47, 66, 58, 12, 51, 52, + 53, 54, 17, 59, 60, 61, 64, 65, 14, 13, + 63, 64, 8, 65, 67, 68, 69, 70, 13, 12, + 73, 484, 65, 13, 17, 65, 65, 413, 65, 64, + 79, 102, 103, 104, 105, 106, 13, 108, 12, 65, + 436, 112, 428, 17, 40, 463, 12, 43, 159, 64, + 159, 17, 58, 164, 440, 59, 442, 12, 64, 65, + 53, 457, 17, 59, 60, 61, 445, 138, 17, 59, + 141, 142, 143, 144, 145, 146, 147, 58, 58, 60, + 14, 467, 153, 60, 155, 464, 157, 15, 159, 17, + 64, 12, 163, 164, 165, 166, 17, 14, 64, 13, + 486, 172, 173, 174, 175, 176, 177, 178, 179, 488, + 489, 12, 15, 184, 31, 13, 17, 12, 15, 498, + 17, 500, 17, 502, 58, 53, 13, 13, 13, 58, + 64, 65, 13, 15, 62, 17, 17, 13, 13, 60, + 13, 27, 24, 38, 39, 59, 321, 64, 65, 44, + 13, 27, 12, 56, 15, 42, 331, 17, 59, 15, + 231, 59, 43, 15, 59, 62, 277, 276, 53, 344, + 13, 242, 67, 68, 17, 56, 247, 247, 53, 247, + 53, 56, 235, 236, 58, 360, 58, 240, 241, 260, + 53, 51, 53, 8, 58, 248, 58, 53, 13, 63, + 271, 53, 17, 6, 275, 17, 277, 38, 39, 12, + 281, 282, 15, 44, 17, 18, 19, 20, 21, 22, + 35, 38, 39, 35, 27, 13, 58, 44, 58, 17, + 47, 63, 47, 13, 58, 47, 67, 68, 51, 15, + 351, 17, 45, 46, 47, 17, 53, 318, 24, 12, + 67, 68, 15, 53, 17, 43, 59, 328, 328, 17, + 328, 332, 58, 43, 9, 336, 336, 63, 336, 53, + 336, 12, 336, 17, 345, 346, 17, 17, 12, 40, + 351, 15, 23, 17, 333, 17, 12, 13, 29, 6, + 7, 17, 17, 34, 51, 17, 37, 368, 59, 60, + 61, 27, 19, 20, 21, 22, 59, 58, 49, 50, + 51, 52, 63, 384, 385, 386, 386, 17, 386, 58, + 386, 56, 386, 4, 63, 56, 71, 5, 381, 382, + 12, 13, 12, 13, 58, 17, 407, 17, 391, 392, + 411, 86, 17, 12, 13, 90, 59, 92, 17, 57, + 58, 12, 13, 424, 99, 100, 17, 12, 12, 56, + 15, 15, 17, 17, 12, 436, 436, 15, 436, 17, + 423, 59, 12, 59, 445, 15, 59, 17, 57, 58, + 57, 58, 17, 454, 57, 58, 457, 457, 59, 457, + 461, 462, 462, 464, 462, 448, 462, 450, 462, 57, + 58, 57, 58, 56, 17, 31, 56, 59, 59, 480, + 480, 60, 480, 158, 480, 12, 480, 488, 489, 490, + 17, 474, 15, 494, 56, 17, 23, 498, 17, 500, + 17, 502, 29, 504, 56, 6, 7, 34, 53, 59, + 37, 12, 13, 59, 17, 190, 17, 59, 19, 20, + 21, 22, 49, 50, 51, 52, 27, 59, 15, 204, + 461, 450, 461, 211, 209, 407, 211, 465, 159, 18, + 159, 42, 218, -1, 219, -1, -1, -1, -1, 224, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 307, -1, -1, 310, 311, -1, + -1, -1, -1, -1, -1, -1, 17, -1, -1, 20, + -1, 22, -1, -1, 25, -1, -1, 252, -1, -1, + 31, 32, 33, 34, -1, 36, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 272, -1, 274, + -1, -1, -1, -1, 279, 280, -1, -1, 283, -1, + 285, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 102, 103, 104, 105, 106, -1, 108, - -1, -1, -1, -1, -1, -1, -1, 340, 341, -1, - -1, -1, -1, -1, 347, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 358, -1, -1, -1, 138, - -1, 364, 141, 142, 143, 144, 145, 146, 147, -1, + -1, -1, 307, -1, -1, 310, 311, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 102, 103, 104, 105, 106, -1, 108, -1, -1, + -1, -1, -1, -1, -1, 340, 341, -1, -1, -1, + -1, -1, 347, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 358, -1, -1, -1, 138, -1, 364, + 141, 142, 143, 144, 145, 146, 147, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 172, 173, 174, 175, 176, 177, 178, - 179, -1, 405, -1, -1, 408, -1, 410, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 423, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 441, 0, - 1, -1, -1, 446, 447, 6, -1, 450, -1, -1, - -1, 12, 231, 14, 15, -1, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, - -1, 32, -1, 34, 35, 36, 37, -1, -1, -1, - 41, 260, -1, -1, 45, 46, 47, 48, 49, 50, - 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, - -1, -1, -1, 64, 65, 4, 5, 6, 7, 8, - 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, - -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, - -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, - 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, -1, 56, -1, 58, - 59, 60, -1, 62, -1, -1, -1, 66, 67, 68, - 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, - -1, 15, 16, 17, -1, -1, -1, -1, -1, -1, - 24, -1, -1, -1, -1, -1, 30, -1, -1, -1, - -1, 35, -1, -1, 38, 39, -1, -1, -1, -1, - 44, -1, -1, -1, -1, -1, -1, -1, -1, 53, - -1, -1, 56, -1, -1, 59, -1, -1, 62, -1, - -1, -1, 66, 67, 68, 4, 5, 6, 7, 8, - 9, 10, 11, 12, -1, -1, 15, 16, 17, -1, - -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, - -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, - 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, -1, 56, -1, -1, - 59, -1, -1, 62, -1, -1, -1, 66, 67, 68, - 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, - -1, 15, -1, 17, -1, -1, -1, -1, -1, -1, - 24, -1, -1, -1, -1, -1, 30, -1, -1, -1, - -1, 35, -1, -1, 38, 39, -1, -1, 42, -1, - 44, -1, -1, -1, -1, -1, -1, -1, -1, 53, - -1, -1, 56, -1, -1, 59, -1, -1, 62, -1, - -1, -1, 66, 67, 68, 4, 5, 6, 7, 8, - 9, 10, 11, 12, -1, -1, 15, -1, 17, -1, - -1, -1, -1, -1, -1, 24, -1, -1, -1, -1, - -1, 30, -1, -1, -1, -1, 35, -1, -1, 38, - 39, -1, -1, -1, -1, 44, -1, -1, -1, -1, - -1, -1, -1, -1, 53, -1, -1, 56, -1, -1, - 59, -1, -1, 62, 6, -1, -1, 66, 67, 68, - 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, - -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, - -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, - 52, -1, 54, 55, -1, -1, -1, -1, 6, -1, - -1, -1, 64, 65, 12, -1, 14, 15, -1, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, -1, 31, -1, -1, 34, -1, -1, 37, - -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, - 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, - -1, -1, 6, -1, -1, -1, 64, 65, 12, -1, + -1, 172, 173, 174, 175, 176, 177, 178, 179, -1, + 405, -1, -1, 408, -1, 410, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 423, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 441, 0, 1, -1, + -1, 446, 447, 6, -1, 450, -1, -1, -1, 12, + 231, 14, 15, -1, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, + -1, 34, 35, 36, 37, -1, -1, -1, 41, 260, + -1, -1, 45, 46, 47, 48, 49, 50, 51, 52, + -1, 54, 55, -1, -1, -1, -1, -1, -1, -1, + -1, 64, 65, 4, 5, 6, 7, 8, 9, 10, + 11, 12, -1, -1, 15, -1, 17, -1, -1, -1, + -1, -1, -1, 24, -1, -1, -1, -1, -1, 30, + -1, -1, -1, -1, 35, -1, -1, 38, 39, -1, + -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, + -1, -1, 53, -1, -1, 56, -1, 58, 59, 60, + -1, 62, -1, -1, -1, 66, 67, 68, 4, 5, + 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, + 16, 17, -1, -1, -1, -1, -1, -1, 24, -1, + -1, -1, -1, -1, 30, -1, -1, -1, -1, 35, + -1, -1, 38, 39, -1, -1, -1, -1, 44, -1, + -1, -1, -1, -1, -1, -1, -1, 53, -1, -1, + 56, -1, -1, 59, -1, -1, 62, -1, -1, -1, + 66, 67, 68, 4, 5, 6, 7, 8, 9, 10, + 11, 12, -1, -1, 15, 16, 17, -1, -1, -1, + -1, -1, -1, 24, -1, -1, -1, -1, -1, 30, + -1, -1, -1, -1, 35, -1, -1, 38, 39, -1, + -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, + -1, -1, 53, -1, -1, 56, -1, -1, 59, -1, + -1, 62, -1, -1, -1, 66, 67, 68, 4, 5, + 6, 7, 8, 9, 10, 11, 12, -1, -1, 15, + -1, 17, -1, -1, -1, -1, -1, -1, 24, -1, + -1, -1, -1, -1, 30, -1, -1, -1, -1, 35, + -1, -1, 38, 39, -1, -1, 42, -1, 44, -1, + -1, -1, -1, -1, -1, -1, -1, 53, -1, -1, + 56, -1, -1, 59, -1, -1, 62, -1, -1, -1, + 66, 67, 68, 4, 5, 6, 7, 8, 9, 10, + 11, 12, -1, -1, 15, -1, 17, -1, -1, -1, + -1, -1, -1, 24, -1, -1, -1, -1, -1, 30, + -1, -1, -1, -1, 35, -1, -1, 38, 39, -1, + -1, -1, -1, 44, -1, -1, -1, -1, -1, -1, + -1, -1, 53, -1, -1, 56, -1, -1, 59, -1, + -1, 62, 6, -1, -1, 66, 67, 68, 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, -1, -1, @@ -1297,10 +1293,26 @@ static const yytype_int16 yycheck[] = 54, 55, -1, -1, -1, -1, 6, -1, -1, -1, 64, 65, 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - -1, -1, -1, -1, 34, -1, -1, 37, -1, -1, + -1, 31, -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, -1, -1, - -1, -1, -1, -1, 64, 65 + 6, -1, -1, -1, 64, 65, 12, -1, 14, 15, + -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, -1, 31, -1, -1, 34, -1, + -1, 37, -1, -1, -1, -1, -1, -1, -1, 45, + 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, + -1, -1, -1, -1, 6, -1, -1, -1, 64, 65, + 12, -1, 14, 15, -1, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, + -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, + -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, + 52, -1, 54, 55, -1, -1, -1, -1, 6, -1, + -1, -1, 64, 65, 12, -1, 14, 15, -1, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, + -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, + 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, + -1, -1, -1, -1, -1, -1, 64, 65 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1353,12 +1365,12 @@ static const yytype_uint8 yystos[] = 81, 80, 31, 59, 98, 98, 57, 94, 125, 104, 94, 65, 94, 81, 85, 124, 59, 59, 79, 94, 98, 81, 15, 17, 62, 58, 85, 57, 15, 17, - 62, 86, 123, 124, 57, 85, 94, 85, 126, 94, - 94, 31, 98, 79, 15, 81, 88, 89, 17, 86, - 88, 89, 31, 125, 126, 105, 85, 58, 60, 58, - 63, 58, 63, 59, 31, 63, 63, 124, 85, 64, - 126, 64, 126, 64, 81, 15, 64, 15, 81, 126, - 126, 126, 81, 15 + 53, 62, 86, 123, 124, 57, 85, 94, 85, 126, + 94, 94, 31, 98, 79, 15, 81, 88, 89, 17, + 86, 88, 89, 31, 125, 126, 105, 85, 58, 60, + 58, 63, 58, 63, 59, 31, 63, 63, 124, 85, + 64, 126, 64, 126, 64, 81, 15, 64, 15, 81, + 126, 126, 126, 81, 15 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1370,27 +1382,27 @@ static const yytype_uint8 yyr1[] = 77, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 83, 83, 84, 84, 84, 84, 84, 85, 85, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 88, 88, 88, 89, 89, 89, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, - 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, - 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 95, 95, 96, 96, 96, - 96, 96, 96, 96, 97, 97, 97, 97, 97, 98, - 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 100, 100, 102, 101, 103, 101, 104, 104, 104, - 104, 104, 105, 105, 105, 106, 106, 106, 106, 106, - 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 108, 108, 108, 108, 109, 109, 109, 109, - 109, 110, 110, 110, 110, 111, 111, 111, 111, 112, - 112, 112, 112, 113, 113, 113, 113, 113, 114, 114, - 114, 115, 115, 116, 116, 117, 117, 117, 117, 117, - 118, 118, 120, 119, 121, 119, 122, 119, 123, 119, - 124, 124, 125, 125, 126, 126, 126, 126, 126, 127, - 127, 128, 129, 129, 129, 129, 129, 129, 130, 131, - 131, 132, 132, 132, 134, 133, 135, 135, 136, 136, - 136, 137, 137, 137, 137, 137, 137, 137, 137, 138, - 139, 140, 140, 140, 141 + 87, 87, 87, 87, 87, 88, 88, 88, 89, 89, + 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, + 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, + 91, 92, 92, 92, 92, 92, 92, 93, 93, 93, + 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, + 94, 94, 94, 94, 94, 94, 95, 95, 96, 96, + 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, + 98, 98, 98, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 100, 100, 102, 101, 103, 101, 104, 104, + 104, 104, 104, 105, 105, 105, 106, 106, 106, 106, + 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, + 107, 107, 107, 108, 108, 108, 108, 109, 109, 109, + 109, 109, 110, 110, 110, 110, 111, 111, 111, 111, + 112, 112, 112, 112, 113, 113, 113, 113, 113, 114, + 114, 114, 115, 115, 116, 116, 117, 117, 117, 117, + 117, 118, 118, 120, 119, 121, 119, 122, 119, 123, + 119, 124, 124, 125, 125, 126, 126, 126, 126, 126, + 127, 127, 128, 129, 129, 129, 129, 129, 129, 130, + 131, 131, 132, 132, 132, 134, 133, 135, 135, 136, + 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, + 138, 139, 140, 140, 140, 141 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1402,27 +1414,27 @@ static const yytype_int8 yyr2[] = 2, 1, 2, 2, 0, 1, 3, 1, 3, 2, 3, 1, 1, 1, 3, 4, 4, 3, 0, 2, 1, 1, 2, 2, 4, 6, 6, 5, 5, 5, - 7, 7, 9, 9, 1, 3, 4, 1, 3, 4, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, - 2, 2, 2, 1, 8, 6, 5, 7, 5, 7, - 1, 2, 2, 3, 4, 4, 1, 1, 2, 1, - 1, 0, 2, 2, 2, 2, 2, 4, 4, 2, - 2, 3, 3, 3, 2, 1, 3, 1, 1, 1, + 7, 7, 7, 9, 9, 1, 3, 4, 1, 3, + 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 2, 2, 2, 1, 8, 6, 5, 7, 5, + 7, 1, 2, 2, 3, 4, 4, 1, 1, 2, + 1, 1, 0, 2, 2, 2, 2, 2, 4, 4, + 2, 2, 3, 3, 3, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 3, 3, 5, 5, 3, 4, 4, - 3, 3, 5, 0, 9, 0, 7, 0, 1, 3, - 1, 3, 0, 5, 5, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 3, 3, 3, 2, 4, 4, - 3, 5, 2, 3, 3, 3, 2, 3, 2, 3, - 5, 2, 3, 3, 3, 2, 3, 3, 3, 2, - 3, 3, 3, 2, 3, 3, 3, 5, 2, 2, - 3, 4, 2, 1, 3, 2, 2, 2, 3, 1, - 2, 3, 0, 6, 0, 8, 0, 8, 0, 10, - 1, 2, 0, 5, 3, 5, 6, 5, 6, 2, - 3, 1, 3, 4, 3, 3, 3, 4, 2, 1, - 1, 1, 3, 4, 0, 5, 0, 3, 3, 5, - 5, 5, 5, 5, 5, 7, 7, 9, 9, 4, - 4, 4, 6, 6, 4 + 1, 1, 1, 4, 3, 3, 5, 5, 3, 4, + 4, 3, 3, 5, 0, 9, 0, 7, 0, 1, + 3, 1, 3, 0, 5, 5, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 3, 3, 3, 2, 4, + 4, 3, 5, 2, 3, 3, 3, 2, 3, 2, + 3, 5, 2, 3, 3, 3, 2, 3, 3, 3, + 2, 3, 3, 3, 2, 3, 3, 3, 5, 2, + 2, 3, 4, 2, 1, 3, 2, 2, 2, 3, + 1, 2, 3, 0, 6, 0, 8, 0, 8, 0, + 10, 1, 2, 0, 5, 3, 5, 6, 5, 6, + 2, 3, 1, 3, 4, 3, 3, 3, 4, 2, + 1, 1, 1, 3, 4, 0, 5, 0, 3, 3, + 5, 5, 5, 5, 5, 5, 7, 7, 9, 9, + 4, 4, 4, 6, 6, 4 }; @@ -2158,91 +2170,91 @@ yyparse (void) case 3: /* input: input import */ #line 163 "antimony.ypp" {} -#line 2162 "antimony.tab.cpp" +#line 2174 "antimony.tab.cpp" break; case 4: /* input: input module */ #line 164 "antimony.ypp" { /*cout << endl << $2->ToString() << endl << endl;*/ } -#line 2168 "antimony.tab.cpp" +#line 2180 "antimony.tab.cpp" break; case 5: /* input: input modulepart */ #line 165 "antimony.ypp" {} -#line 2174 "antimony.tab.cpp" +#line 2186 "antimony.tab.cpp" break; case 6: /* input: input function */ #line 166 "antimony.ypp" {} -#line 2180 "antimony.tab.cpp" +#line 2192 "antimony.tab.cpp" break; case 7: /* input: input modulename */ #line 167 "antimony.ypp" {} -#line 2186 "antimony.tab.cpp" +#line 2198 "antimony.tab.cpp" break; case 8: /* input: input functionname */ #line 168 "antimony.ypp" {} -#line 2192 "antimony.tab.cpp" +#line 2204 "antimony.tab.cpp" break; case 9: /* input: input modulecvterm */ #line 169 "antimony.ypp" {} -#line 2198 "antimony.tab.cpp" +#line 2210 "antimony.tab.cpp" break; case 10: /* input: input functioncvterm */ #line 170 "antimony.ypp" {} -#line 2204 "antimony.tab.cpp" +#line 2216 "antimony.tab.cpp" break; case 11: /* input: input toplevel_sbo */ #line 171 "antimony.ypp" {} -#line 2210 "antimony.tab.cpp" +#line 2222 "antimony.tab.cpp" break; case 12: /* input: input annotationBlock */ #line 172 "antimony.ypp" {} -#line 2216 "antimony.tab.cpp" +#line 2228 "antimony.tab.cpp" break; case 13: /* input: input moduleannotation */ #line 173 "antimony.ypp" {} -#line 2222 "antimony.tab.cpp" +#line 2234 "antimony.tab.cpp" break; case 14: /* input: input error */ #line 174 "antimony.ypp" {YYABORT;} -#line 2228 "antimony.tab.cpp" +#line 2240 "antimony.tab.cpp" break; case 15: /* input: input "an error" */ #line 175 "antimony.ypp" {YYABORT;} -#line 2234 "antimony.tab.cpp" +#line 2246 "antimony.tab.cpp" break; case 16: /* import: "'import'" "text string" */ #line 178 "antimony.ypp" { if (g_registry.OpenFile(*((yyvsp[0].word)))==0) YYABORT;} -#line 2240 "antimony.tab.cpp" +#line 2252 "antimony.tab.cpp" break; case 17: /* $@1: %empty */ #line 181 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2246 "antimony.tab.cpp" +#line 2258 "antimony.tab.cpp" break; case 18: /* module: "'model' or 'module'" "element name" $@1 '(' variableexportlist ')' modulebody "'end'" */ @@ -2252,13 +2264,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2256 "antimony.tab.cpp" +#line 2268 "antimony.tab.cpp" break; case 19: /* $@2: %empty */ #line 187 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2262 "antimony.tab.cpp" +#line 2274 "antimony.tab.cpp" break; case 20: /* module: "'model' or 'module'" "element name" $@2 modulebody "'end'" */ @@ -2268,13 +2280,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2272 "antimony.tab.cpp" +#line 2284 "antimony.tab.cpp" break; case 21: /* $@3: %empty */ #line 193 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2278 "antimony.tab.cpp" +#line 2290 "antimony.tab.cpp" break; case 22: /* module: "'model' or 'module'" '*' "element name" $@3 '(' variableexportlist ')' modulebody "'end'" */ @@ -2284,13 +2296,13 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2288 "antimony.tab.cpp" +#line 2300 "antimony.tab.cpp" break; case 23: /* $@4: %empty */ #line 199 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2294 "antimony.tab.cpp" +#line 2306 "antimony.tab.cpp" break; case 24: /* module: "'model' or 'module'" '*' "element name" $@4 modulebody "'end'" */ @@ -2300,85 +2312,85 @@ yyparse (void) if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2304 "antimony.tab.cpp" +#line 2316 "antimony.tab.cpp" break; case 25: /* module: "'model' or 'module'" "name of an existing module" */ #line 204 "antimony.ypp" {g_registry.SetError("module '" + *((yyvsp[0].word)) + "' already defined."); YYABORT;} -#line 2310 "antimony.tab.cpp" +#line 2322 "antimony.tab.cpp" break; case 26: /* module: "'model' or 'module'" "name of an existing function" */ #line 205 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a module because it is already a defined function."); YYABORT;} -#line 2316 "antimony.tab.cpp" +#line 2328 "antimony.tab.cpp" break; case 27: /* $@5: %empty */ #line 208 "antimony.ypp" {g_registry.NewUserFunction((yyvsp[0].word));} -#line 2322 "antimony.tab.cpp" +#line 2334 "antimony.tab.cpp" break; case 28: /* function: "'function'" "element name" $@5 '(' variableexportlist ')' spacedformula "'end'" */ #line 208 "antimony.ypp" {if (g_registry.SetUserFunction((yyvsp[-1].formula))) YYABORT;} -#line 2328 "antimony.tab.cpp" +#line 2340 "antimony.tab.cpp" break; case 29: /* function: "'function'" "name of an existing module" */ #line 209 "antimony.ypp" {g_registry.SetError("Cannot use '" + *((yyvsp[0].word)) +"' as a function name because it is already the name of a module."); YYABORT;} -#line 2334 "antimony.tab.cpp" +#line 2346 "antimony.tab.cpp" break; case 30: /* function: "'function'" "name of an existing function" */ #line 210 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a new function because it is already a defined function."); YYABORT;} -#line 2340 "antimony.tab.cpp" +#line 2352 "antimony.tab.cpp" break; case 31: /* spacedformula: formula */ #line 213 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2346 "antimony.tab.cpp" +#line 2358 "antimony.tab.cpp" break; case 32: /* spacedformula: lineend spacedformula */ #line 214 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2352 "antimony.tab.cpp" +#line 2364 "antimony.tab.cpp" break; case 33: /* spacedformula: spacedformula lineend */ #line 215 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula);} -#line 2358 "antimony.tab.cpp" +#line 2370 "antimony.tab.cpp" break; case 34: /* variableexportlist: %empty */ #line 225 "antimony.ypp" {} -#line 2364 "antimony.tab.cpp" +#line 2376 "antimony.tab.cpp" break; case 35: /* variableexportlist: variable */ #line 226 "antimony.ypp" {if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2370 "antimony.tab.cpp" +#line 2382 "antimony.tab.cpp" break; case 36: /* variableexportlist: variableexportlist ',' variable */ #line 227 "antimony.ypp" { if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2376 "antimony.tab.cpp" +#line 2388 "antimony.tab.cpp" break; case 37: /* variable: "element name" */ #line 230 "antimony.ypp" {(yyval.variable) = g_registry.AddVariableToCurrent((yyvsp[0].word)); } -#line 2382 "antimony.tab.cpp" +#line 2394 "antimony.tab.cpp" break; case 38: /* variable: variable '.' "element name" */ @@ -2389,97 +2401,97 @@ yyparse (void) YYABORT; } } -#line 2393 "antimony.tab.cpp" +#line 2405 "antimony.tab.cpp" break; case 39: /* variable: '$' variable */ #line 237 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable); if ((yyval.variable)->SetIsConst(true)) YYABORT;} -#line 2399 "antimony.tab.cpp" +#line 2411 "antimony.tab.cpp" break; case 40: /* variablein: variable "'in'" variable */ #line 240 "antimony.ypp" {if ((yyvsp[-2].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; (yyval.variable) = (yyvsp[-2].variable);} -#line 2405 "antimony.tab.cpp" +#line 2417 "antimony.tab.cpp" break; case 41: /* varmaybein: variable */ #line 243 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2411 "antimony.tab.cpp" +#line 2423 "antimony.tab.cpp" break; case 42: /* varmaybein: variablein */ #line 244 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2417 "antimony.tab.cpp" +#line 2429 "antimony.tab.cpp" break; case 43: /* varmaybeis: varmaybein */ #line 247 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2423 "antimony.tab.cpp" +#line 2435 "antimony.tab.cpp" break; case 44: /* varmaybeis: varmaybein '=' formula */ #line 248 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 2429 "antimony.tab.cpp" +#line 2441 "antimony.tab.cpp" break; case 45: /* varmaybeis: varmaybein ':' '=' formula */ #line 249 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT; } -#line 2435 "antimony.tab.cpp" +#line 2447 "antimony.tab.cpp" break; case 46: /* varmaybeis: varmaybein '\'' '=' formula */ #line 250 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT; } -#line 2441 "antimony.tab.cpp" +#line 2453 "antimony.tab.cpp" break; case 47: /* varmaybeis: varmaybein "'has'" unitdef */ #line 251 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 2447 "antimony.tab.cpp" +#line 2459 "antimony.tab.cpp" break; case 48: /* maybein: %empty */ #line 254 "antimony.ypp" {(yyval.variable) = NULL;} -#line 2453 "antimony.tab.cpp" +#line 2465 "antimony.tab.cpp" break; case 49: /* maybein: "'in'" variable */ #line 255 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2459 "antimony.tab.cpp" +#line 2471 "antimony.tab.cpp" break; case 50: /* modulebody: modulepart */ #line 258 "antimony.ypp" {} -#line 2465 "antimony.tab.cpp" +#line 2477 "antimony.tab.cpp" break; case 51: /* modulebody: moduleannotation */ #line 259 "antimony.ypp" {} -#line 2471 "antimony.tab.cpp" +#line 2483 "antimony.tab.cpp" break; case 52: /* modulebody: modulebody modulepart */ #line 260 "antimony.ypp" {} -#line 2477 "antimony.tab.cpp" +#line 2489 "antimony.tab.cpp" break; case 53: /* modulebody: modulebody moduleannotation */ #line 261 "antimony.ypp" {} -#line 2483 "antimony.tab.cpp" +#line 2495 "antimony.tab.cpp" break; case 54: /* moduleannotation: "'model' or 'module'" "element name" stringlist lineend */ @@ -2488,7 +2500,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCVTerm(&modname,(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT; } -#line 2492 "antimony.tab.cpp" +#line 2504 "antimony.tab.cpp" break; case 55: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" stringlist lineend */ @@ -2497,7 +2509,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT; } -#line 2501 "antimony.tab.cpp" +#line 2513 "antimony.tab.cpp" break; case 56: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" "number" lineend */ @@ -2506,7 +2518,7 @@ yyparse (void) string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT; } -#line 2510 "antimony.tab.cpp" +#line 2522 "antimony.tab.cpp" break; case 57: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "number" */ @@ -2520,35 +2532,35 @@ yyparse (void) YYABORT; } } -#line 2524 "antimony.tab.cpp" +#line 2536 "antimony.tab.cpp" break; case 58: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "element name" */ #line 290 "antimony.ypp" { Module* module = g_registry.CurrentModule(); - if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { - if (module->SetAutoLayout((yyvsp[0].word))) YYABORT; + if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "layout")) { + if (module->SetLayout((yyvsp[0].word))) YYABORT; } else { - g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a string is 'layout'."); YYABORT; } } -#line 2538 "antimony.tab.cpp" +#line 2550 "antimony.tab.cpp" break; case 59: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "name of a pre-defined constant" */ #line 300 "antimony.ypp" { Module* module = g_registry.CurrentModule(); - if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { - if (module->SetAutoLayout((yyvsp[0].word))) YYABORT; + if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "layout")) { + if (module->SetLayout((yyvsp[0].word))) YYABORT; } else { - g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a string is 'layout'."); YYABORT; } } -#line 2552 "antimony.tab.cpp" +#line 2564 "antimony.tab.cpp" break; case 60: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "number" */ @@ -2564,9 +2576,9 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 2570 "antimony.tab.cpp" +#line 2582 "antimony.tab.cpp" break; case 61: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "element name" */ @@ -2582,13 +2594,31 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 2588 "antimony.tab.cpp" +#line 2600 "antimony.tab.cpp" break; - case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ + case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "text string" */ #line 338 "antimony.ypp" + { Module* module = g_registry.CurrentModule(); + if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { + if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; + } + else if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "layout")) { + if (module->SetLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + module->SetLayout("on"); + } +#line 2618 "antimony.tab.cpp" + break; + + case 63: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ +#line 352 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -2600,13 +2630,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 2606 "antimony.tab.cpp" +#line 2636 "antimony.tab.cpp" break; - case 63: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' numlist '}' */ -#line 352 "antimony.ypp" + case 64: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' numlist '}' */ +#line 366 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -2618,133 +2648,133 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 2624 "antimony.tab.cpp" +#line 2654 "antimony.tab.cpp" break; - case 64: /* variablelist: variable */ -#line 367 "antimony.ypp" + case 65: /* variablelist: variable */ +#line 381 "antimony.ypp" { (yyval.variablelist) = new std::vector(); (yyval.variablelist)->push_back((yyvsp[0].variable));} -#line 2630 "antimony.tab.cpp" +#line 2660 "antimony.tab.cpp" break; - case 65: /* variablelist: variablelist ',' variable */ -#line 368 "antimony.ypp" + case 66: /* variablelist: variablelist ',' variable */ +#line 382 "antimony.ypp" { (yyval.variablelist) = (yyvsp[-2].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } -#line 2636 "antimony.tab.cpp" +#line 2666 "antimony.tab.cpp" break; - case 66: /* variablelist: variablelist ',' '\n' variable */ -#line 369 "antimony.ypp" + case 67: /* variablelist: variablelist ',' '\n' variable */ +#line 383 "antimony.ypp" { (yyval.variablelist) = (yyvsp[-3].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } -#line 2642 "antimony.tab.cpp" +#line 2672 "antimony.tab.cpp" break; - case 67: /* numlist: "number" */ -#line 372 "antimony.ypp" + case 68: /* numlist: "number" */ +#line 386 "antimony.ypp" { (yyval.numlist) = new std::vector(); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2648 "antimony.tab.cpp" +#line 2678 "antimony.tab.cpp" break; - case 68: /* numlist: numlist ',' "number" */ -#line 373 "antimony.ypp" + case 69: /* numlist: numlist ',' "number" */ +#line 387 "antimony.ypp" { (yyval.numlist) = (yyvsp[-2].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2654 "antimony.tab.cpp" +#line 2684 "antimony.tab.cpp" break; - case 69: /* numlist: numlist ',' '\n' "number" */ -#line 374 "antimony.ypp" + case 70: /* numlist: numlist ',' '\n' "number" */ +#line 388 "antimony.ypp" { (yyval.numlist) = (yyvsp[-3].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2660 "antimony.tab.cpp" +#line 2690 "antimony.tab.cpp" break; - case 70: /* modulepart: reaction lineend */ -#line 377 "antimony.ypp" + case 71: /* modulepart: reaction lineend */ +#line 391 "antimony.ypp" {} -#line 2666 "antimony.tab.cpp" +#line 2696 "antimony.tab.cpp" break; - case 71: /* modulepart: assignment lineend */ -#line 378 "antimony.ypp" + case 72: /* modulepart: assignment lineend */ +#line 392 "antimony.ypp" {} -#line 2672 "antimony.tab.cpp" +#line 2702 "antimony.tab.cpp" break; - case 72: /* modulepart: submodule lineend */ -#line 379 "antimony.ypp" + case 73: /* modulepart: submodule lineend */ +#line 393 "antimony.ypp" {} -#line 2678 "antimony.tab.cpp" +#line 2708 "antimony.tab.cpp" break; - case 73: /* modulepart: varinitialize lineend */ -#line 380 "antimony.ypp" + case 74: /* modulepart: varinitialize lineend */ +#line 394 "antimony.ypp" {} -#line 2684 "antimony.tab.cpp" +#line 2714 "antimony.tab.cpp" break; - case 74: /* modulepart: dnadef lineend */ -#line 381 "antimony.ypp" + case 75: /* modulepart: dnadef lineend */ +#line 395 "antimony.ypp" {} -#line 2690 "antimony.tab.cpp" +#line 2720 "antimony.tab.cpp" break; - case 75: /* modulepart: event lineend */ -#line 382 "antimony.ypp" + case 76: /* modulepart: event lineend */ +#line 396 "antimony.ypp" {} -#line 2696 "antimony.tab.cpp" +#line 2726 "antimony.tab.cpp" break; - case 76: /* modulepart: unitinit lineend */ -#line 383 "antimony.ypp" + case 77: /* modulepart: unitinit lineend */ +#line 397 "antimony.ypp" {} -#line 2702 "antimony.tab.cpp" +#line 2732 "antimony.tab.cpp" break; - case 77: /* modulepart: deletion lineend */ -#line 384 "antimony.ypp" + case 78: /* modulepart: deletion lineend */ +#line 398 "antimony.ypp" {} -#line 2708 "antimony.tab.cpp" +#line 2738 "antimony.tab.cpp" break; - case 78: /* modulepart: cvterm lineend */ -#line 385 "antimony.ypp" + case 79: /* modulepart: cvterm lineend */ +#line 399 "antimony.ypp" {} -#line 2714 "antimony.tab.cpp" +#line 2744 "antimony.tab.cpp" break; - case 79: /* modulepart: variablein */ -#line 386 "antimony.ypp" + case 80: /* modulepart: variablein */ +#line 400 "antimony.ypp" {} -#line 2720 "antimony.tab.cpp" +#line 2750 "antimony.tab.cpp" break; - case 80: /* modulepart: constraint lineend */ -#line 387 "antimony.ypp" + case 81: /* modulepart: constraint lineend */ +#line 401 "antimony.ypp" {} -#line 2726 "antimony.tab.cpp" +#line 2756 "antimony.tab.cpp" break; - case 81: /* modulepart: objective lineend */ -#line 388 "antimony.ypp" + case 82: /* modulepart: objective lineend */ +#line 402 "antimony.ypp" {} -#line 2732 "antimony.tab.cpp" +#line 2762 "antimony.tab.cpp" break; - case 82: /* modulepart: algrule lineend */ -#line 389 "antimony.ypp" + case 83: /* modulepart: algrule lineend */ +#line 403 "antimony.ypp" {} -#line 2738 "antimony.tab.cpp" +#line 2768 "antimony.tab.cpp" break; - case 83: /* modulepart: lineend */ -#line 390 "antimony.ypp" + case 84: /* modulepart: lineend */ +#line 404 "antimony.ypp" {} -#line 2744 "antimony.tab.cpp" +#line 2774 "antimony.tab.cpp" break; - case 84: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ -#line 394 "antimony.ypp" + case 85: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ +#line 408 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-7].variable), 0); if (var == NULL) YYABORT; @@ -2752,11 +2782,11 @@ yyparse (void) if ((yyvsp[-7].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2756 "antimony.tab.cpp" +#line 2786 "antimony.tab.cpp" break; - case 85: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ -#line 402 "antimony.ypp" + case 86: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ +#line 416 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 0); if (var == NULL) YYABORT; @@ -2764,11 +2794,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2768 "antimony.tab.cpp" +#line 2798 "antimony.tab.cpp" break; - case 86: /* reaction: reactantList reactionDivider ';' formula maybein */ -#line 410 "antimony.ypp" + case 87: /* reaction: reactantList reactionDivider ';' formula maybein */ +#line 424 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), 1); if (var == NULL) YYABORT; @@ -2776,11 +2806,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2780 "antimony.tab.cpp" +#line 2810 "antimony.tab.cpp" break; - case 87: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ -#line 418 "antimony.ypp" + case 88: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ +#line 432 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 1); if (var == NULL) YYABORT; @@ -2788,11 +2818,11 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2792 "antimony.tab.cpp" +#line 2822 "antimony.tab.cpp" break; - case 88: /* reaction: reactionDivider reactantList ';' formula maybein */ -#line 426 "antimony.ypp" + case 89: /* reaction: reactionDivider reactantList ';' formula maybein */ +#line 440 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 2); if (var == NULL) YYABORT; @@ -2800,11 +2830,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2804 "antimony.tab.cpp" +#line 2834 "antimony.tab.cpp" break; - case 89: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ -#line 434 "antimony.ypp" + case 90: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ +#line 448 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 2); if (var == NULL) YYABORT; @@ -2812,867 +2842,867 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2816 "antimony.tab.cpp" +#line 2846 "antimony.tab.cpp" break; - case 90: /* reactantList: variable */ -#line 443 "antimony.ypp" + case 91: /* reactantList: variable */ +#line 457 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2822 "antimony.tab.cpp" +#line 2852 "antimony.tab.cpp" break; - case 91: /* reactantList: "number" variable */ -#line 444 "antimony.ypp" + case 92: /* reactantList: "number" variable */ +#line 458 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2828 "antimony.tab.cpp" +#line 2858 "antimony.tab.cpp" break; - case 92: /* reactantList: variable variable */ -#line 445 "antimony.ypp" + case 93: /* reactantList: variable variable */ +#line 459 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2834 "antimony.tab.cpp" +#line 2864 "antimony.tab.cpp" break; - case 93: /* reactantList: reactantList '+' variable */ -#line 446 "antimony.ypp" + case 94: /* reactantList: reactantList '+' variable */ +#line 460 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-2].reactantList); if((yyvsp[-2].reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2840 "antimony.tab.cpp" +#line 2870 "antimony.tab.cpp" break; - case 94: /* reactantList: reactantList '+' "number" variable */ -#line 447 "antimony.ypp" + case 95: /* reactantList: reactantList '+' "number" variable */ +#line 461 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2846 "antimony.tab.cpp" +#line 2876 "antimony.tab.cpp" break; - case 95: /* reactantList: reactantList '+' variable variable */ -#line 448 "antimony.ypp" + case 96: /* reactantList: reactantList '+' variable variable */ +#line 462 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2852 "antimony.tab.cpp" +#line 2882 "antimony.tab.cpp" break; - case 96: /* reactionDivider: "->" */ -#line 452 "antimony.ypp" + case 97: /* reactionDivider: "->" */ +#line 466 "antimony.ypp" {(yyval.reactionDivider) = rdBecomes;} -#line 2858 "antimony.tab.cpp" +#line 2888 "antimony.tab.cpp" break; - case 97: /* reactionDivider: "-|" */ -#line 453 "antimony.ypp" + case 98: /* reactionDivider: "-|" */ +#line 467 "antimony.ypp" {(yyval.reactionDivider) = rdInhibits;} -#line 2864 "antimony.tab.cpp" +#line 2894 "antimony.tab.cpp" break; - case 98: /* reactionDivider: '-' '(' */ -#line 454 "antimony.ypp" + case 99: /* reactionDivider: '-' '(' */ +#line 468 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2870 "antimony.tab.cpp" +#line 2900 "antimony.tab.cpp" break; - case 99: /* reactionDivider: "-o" */ -#line 455 "antimony.ypp" + case 100: /* reactionDivider: "-o" */ +#line 469 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2876 "antimony.tab.cpp" +#line 2906 "antimony.tab.cpp" break; - case 100: /* reactionDivider: "=>" */ -#line 456 "antimony.ypp" + case 101: /* reactionDivider: "=>" */ +#line 470 "antimony.ypp" {(yyval.reactionDivider) = rdBecomesIrreversibly;} -#line 2882 "antimony.tab.cpp" +#line 2912 "antimony.tab.cpp" break; - case 101: /* formula: %empty */ -#line 459 "antimony.ypp" + case 102: /* formula: %empty */ +#line 473 "antimony.ypp" {(yyval.formula) = g_registry.NewBlankFormula(); } -#line 2888 "antimony.tab.cpp" +#line 2918 "antimony.tab.cpp" break; - case 102: /* formula: formula "..." */ -#line 460 "antimony.ypp" + case 103: /* formula: formula "..." */ +#line 474 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddEllipses();} -#line 2894 "antimony.tab.cpp" +#line 2924 "antimony.tab.cpp" break; - case 103: /* formula: formula variable */ -#line 461 "antimony.ypp" + case 104: /* formula: formula variable */ +#line 475 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); if((yyvsp[-1].formula)->AddVariable((yyvsp[0].variable))) YYABORT; } -#line 2900 "antimony.tab.cpp" +#line 2930 "antimony.tab.cpp" break; - case 104: /* formula: formula "number" */ -#line 462 "antimony.ypp" + case 105: /* formula: formula "number" */ +#line 476 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddNum((yyvsp[0].num)); } -#line 2906 "antimony.tab.cpp" +#line 2936 "antimony.tab.cpp" break; - case 105: /* formula: formula "name of a pre-defined constant" */ -#line 463 "antimony.ypp" + case 106: /* formula: formula "name of a pre-defined constant" */ +#line 477 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2912 "antimony.tab.cpp" +#line 2942 "antimony.tab.cpp" break; - case 106: /* formula: formula "name of an existing function" */ -#line 464 "antimony.ypp" + case 107: /* formula: formula "name of an existing function" */ +#line 478 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2918 "antimony.tab.cpp" +#line 2948 "antimony.tab.cpp" break; - case 107: /* formula: formula '(' commaformula ')' */ -#line 465 "antimony.ypp" + case 108: /* formula: formula '(' commaformula ')' */ +#line 479 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddParentheses(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2924 "antimony.tab.cpp" +#line 2954 "antimony.tab.cpp" break; - case 108: /* formula: formula '{' commaformula '}' */ -#line 466 "antimony.ypp" + case 109: /* formula: formula '{' commaformula '}' */ +#line 480 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddCurlyBrackets(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2930 "antimony.tab.cpp" +#line 2960 "antimony.tab.cpp" break; - case 109: /* formula: formula mathThing */ -#line 467 "antimony.ypp" + case 110: /* formula: formula mathThing */ +#line 481 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddMathThing((yyvsp[0].character)); } -#line 2936 "antimony.tab.cpp" +#line 2966 "antimony.tab.cpp" break; - case 110: /* formula: formula inequality */ -#line 468 "antimony.ypp" + case 111: /* formula: formula inequality */ +#line 482 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddInequality((yyvsp[0].inequality)); } -#line 2942 "antimony.tab.cpp" +#line 2972 "antimony.tab.cpp" break; - case 111: /* formula: formula '=' '=' */ -#line 469 "antimony.ypp" + case 112: /* formula: formula '=' '=' */ +#line 483 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('='); (yyvsp[-2].formula)->AddMathThing('='); } -#line 2948 "antimony.tab.cpp" +#line 2978 "antimony.tab.cpp" break; - case 112: /* formula: formula '&' '&' */ -#line 470 "antimony.ypp" + case 113: /* formula: formula '&' '&' */ +#line 484 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('&'); (yyvsp[-2].formula)->AddMathThing('&'); } -#line 2954 "antimony.tab.cpp" +#line 2984 "antimony.tab.cpp" break; - case 113: /* formula: formula '|' '|' */ -#line 471 "antimony.ypp" + case 114: /* formula: formula '|' '|' */ +#line 485 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('|'); (yyvsp[-2].formula)->AddMathThing('|'); } -#line 2960 "antimony.tab.cpp" +#line 2990 "antimony.tab.cpp" break; - case 114: /* formula: formula "text string" */ -#line 472 "antimony.ypp" + case 115: /* formula: formula "text string" */ +#line 486 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word), true); } -#line 2966 "antimony.tab.cpp" +#line 2996 "antimony.tab.cpp" break; - case 115: /* commaformula: formula */ -#line 475 "antimony.ypp" + case 116: /* commaformula: formula */ +#line 489 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2972 "antimony.tab.cpp" +#line 3002 "antimony.tab.cpp" break; - case 116: /* commaformula: commaformula ',' formula */ -#line 476 "antimony.ypp" + case 117: /* commaformula: commaformula ',' formula */ +#line 490 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyval.formula)->AddMathThing(','); (yyval.formula)->AddFormula((yyvsp[0].formula)); } -#line 2978 "antimony.tab.cpp" +#line 3008 "antimony.tab.cpp" break; - case 117: /* mathThing: '+' */ -#line 479 "antimony.ypp" + case 118: /* mathThing: '+' */ +#line 493 "antimony.ypp" {(yyval.character) = '+';} -#line 2984 "antimony.tab.cpp" +#line 3014 "antimony.tab.cpp" break; - case 118: /* mathThing: '-' */ -#line 480 "antimony.ypp" + case 119: /* mathThing: '-' */ +#line 494 "antimony.ypp" {(yyval.character) = '-';} -#line 2990 "antimony.tab.cpp" +#line 3020 "antimony.tab.cpp" break; - case 119: /* mathThing: '*' */ -#line 481 "antimony.ypp" + case 120: /* mathThing: '*' */ +#line 495 "antimony.ypp" {(yyval.character) = '*';} -#line 2996 "antimony.tab.cpp" +#line 3026 "antimony.tab.cpp" break; - case 120: /* mathThing: '/' */ -#line 482 "antimony.ypp" + case 121: /* mathThing: '/' */ +#line 496 "antimony.ypp" {(yyval.character) = '/';} -#line 3002 "antimony.tab.cpp" +#line 3032 "antimony.tab.cpp" break; - case 121: /* mathThing: '^' */ -#line 483 "antimony.ypp" + case 122: /* mathThing: '^' */ +#line 497 "antimony.ypp" {(yyval.character) = '^';} -#line 3008 "antimony.tab.cpp" +#line 3038 "antimony.tab.cpp" break; - case 122: /* mathThing: '!' */ -#line 484 "antimony.ypp" + case 123: /* mathThing: '!' */ +#line 498 "antimony.ypp" {(yyval.character) = '!';} -#line 3014 "antimony.tab.cpp" +#line 3044 "antimony.tab.cpp" break; - case 123: /* mathThing: '%' */ -#line 485 "antimony.ypp" + case 124: /* mathThing: '%' */ +#line 499 "antimony.ypp" {(yyval.character) = '%';} -#line 3020 "antimony.tab.cpp" +#line 3050 "antimony.tab.cpp" break; - case 124: /* inequality: '<' */ -#line 488 "antimony.ypp" + case 125: /* inequality: '<' */ +#line 502 "antimony.ypp" {(yyval.inequality) = constLT;} -#line 3026 "antimony.tab.cpp" +#line 3056 "antimony.tab.cpp" break; - case 125: /* inequality: "<=" */ -#line 489 "antimony.ypp" + case 126: /* inequality: "<=" */ +#line 503 "antimony.ypp" {(yyval.inequality) = constLEQ;} -#line 3032 "antimony.tab.cpp" +#line 3062 "antimony.tab.cpp" break; - case 126: /* inequality: '>' */ -#line 490 "antimony.ypp" + case 127: /* inequality: '>' */ +#line 504 "antimony.ypp" {(yyval.inequality) = constGT;} -#line 3038 "antimony.tab.cpp" +#line 3068 "antimony.tab.cpp" break; - case 127: /* inequality: ">=" */ -#line 491 "antimony.ypp" + case 128: /* inequality: ">=" */ +#line 505 "antimony.ypp" {(yyval.inequality) = constGEQ;} -#line 3044 "antimony.tab.cpp" +#line 3074 "antimony.tab.cpp" break; - case 128: /* inequality: "!=" */ -#line 492 "antimony.ypp" + case 129: /* inequality: "!=" */ +#line 506 "antimony.ypp" {(yyval.inequality) = constNEQ;} -#line 3050 "antimony.tab.cpp" +#line 3080 "antimony.tab.cpp" break; - case 129: /* lineend: ';' */ -#line 495 "antimony.ypp" + case 130: /* lineend: ';' */ +#line 509 "antimony.ypp" {} -#line 3056 "antimony.tab.cpp" +#line 3086 "antimony.tab.cpp" break; - case 130: /* lineend: '\n' */ -#line 496 "antimony.ypp" + case 131: /* lineend: '\n' */ +#line 510 "antimony.ypp" {} -#line 3062 "antimony.tab.cpp" +#line 3092 "antimony.tab.cpp" break; - case 131: /* lineend: "end of line" */ -#line 497 "antimony.ypp" + case 132: /* lineend: "end of line" */ +#line 511 "antimony.ypp" {} -#line 3068 "antimony.tab.cpp" +#line 3098 "antimony.tab.cpp" break; - case 132: /* assignment: varmaybein ':' maxormin formula */ -#line 500 "antimony.ypp" + case 133: /* assignment: varmaybein ':' maxormin formula */ +#line 514 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[-3].variable), (yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3074 "antimony.tab.cpp" +#line 3104 "antimony.tab.cpp" break; - case 133: /* assignment: varmaybein '=' formula */ -#line 501 "antimony.ypp" + case 134: /* assignment: varmaybein '=' formula */ +#line 515 "antimony.ypp" {if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 3080 "antimony.tab.cpp" +#line 3110 "antimony.tab.cpp" break; - case 134: /* assignment: varmaybein "'is'" variable */ -#line 502 "antimony.ypp" + case 135: /* assignment: varmaybein "'is'" variable */ +#line 516 "antimony.ypp" {if ((yyvsp[-2].variable)->Synchronize((yyvsp[0].variable), NULL)) YYABORT;} -#line 3086 "antimony.tab.cpp" +#line 3116 "antimony.tab.cpp" break; - case 135: /* assignment: varmaybein "'is'" variable '/' variable */ -#line 503 "antimony.ypp" + case 136: /* assignment: varmaybein "'is'" variable '/' variable */ +#line 517 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[-2].variable), (yyvsp[0].variable))) YYABORT;} -#line 3092 "antimony.tab.cpp" +#line 3122 "antimony.tab.cpp" break; - case 136: /* assignment: varmaybein '*' variable "'is'" variable */ -#line 504 "antimony.ypp" + case 137: /* assignment: varmaybein '*' variable "'is'" variable */ +#line 518 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[0].variable), (yyvsp[-2].variable))) YYABORT;} -#line 3098 "antimony.tab.cpp" +#line 3128 "antimony.tab.cpp" break; - case 137: /* assignment: varmaybein "'is'" "text string" */ -#line 505 "antimony.ypp" + case 138: /* assignment: varmaybein "'is'" "text string" */ +#line 519 "antimony.ypp" {if ((yyvsp[-2].variable)->SetDisplayName(*((yyvsp[0].word)))) YYABORT;} -#line 3104 "antimony.tab.cpp" +#line 3134 "antimony.tab.cpp" break; - case 138: /* assignment: varmaybein ':' '=' formula */ -#line 506 "antimony.ypp" + case 139: /* assignment: varmaybein ':' '=' formula */ +#line 520 "antimony.ypp" {if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT;} -#line 3110 "antimony.tab.cpp" +#line 3140 "antimony.tab.cpp" break; - case 139: /* assignment: varmaybein '\'' '=' formula */ -#line 507 "antimony.ypp" + case 140: /* assignment: varmaybein '\'' '=' formula */ +#line 521 "antimony.ypp" {if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT;} -#line 3116 "antimony.tab.cpp" +#line 3146 "antimony.tab.cpp" break; - case 140: /* assignment: varmaybein "'has'" unitdef */ -#line 508 "antimony.ypp" + case 141: /* assignment: varmaybein "'has'" unitdef */ +#line 522 "antimony.ypp" {if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 3122 "antimony.tab.cpp" +#line 3152 "antimony.tab.cpp" break; - case 141: /* algrule: "number" '=' formula */ -#line 511 "antimony.ypp" + case 142: /* algrule: "number" '=' formula */ +#line 525 "antimony.ypp" {if (g_registry.AddNewAlgebraicRuleToCurrent((yyvsp[-2].num), (yyvsp[0].formula))) YYABORT; } -#line 3128 "antimony.tab.cpp" +#line 3158 "antimony.tab.cpp" break; - case 142: /* algrule: varmaybein ':' "number" '=' formula */ -#line 512 "antimony.ypp" + case 143: /* algrule: varmaybein ':' "number" '=' formula */ +#line 526 "antimony.ypp" {if ((yyvsp[-4].variable)->SetAlgebraicRule((yyvsp[-2].num), (yyvsp[0].formula)) ) YYABORT;} -#line 3134 "antimony.tab.cpp" +#line 3164 "antimony.tab.cpp" break; - case 143: /* $@6: %empty */ -#line 515 "antimony.ypp" + case 144: /* $@6: %empty */ +#line 529 "antimony.ypp" {if ((yyvsp[-3].variable)->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3140 "antimony.tab.cpp" +#line 3170 "antimony.tab.cpp" break; - case 144: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ -#line 515 "antimony.ypp" + case 145: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ +#line 529 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if ((yyvsp[-8].variable)->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3146 "antimony.tab.cpp" +#line 3176 "antimony.tab.cpp" break; - case 145: /* $@7: %empty */ -#line 516 "antimony.ypp" + case 146: /* $@7: %empty */ +#line 530 "antimony.ypp" {if(g_registry.CurrentModule()->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3152 "antimony.tab.cpp" +#line 3182 "antimony.tab.cpp" break; - case 146: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ -#line 516 "antimony.ypp" + case 147: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ +#line 530 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if (g_registry.GetCurrentSubmodel()->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3158 "antimony.tab.cpp" +#line 3188 "antimony.tab.cpp" break; - case 147: /* variableimportlist: %empty */ -#line 520 "antimony.ypp" + case 148: /* variableimportlist: %empty */ +#line 534 "antimony.ypp" {} -#line 3164 "antimony.tab.cpp" +#line 3194 "antimony.tab.cpp" break; - case 148: /* variableimportlist: variable */ -#line 521 "antimony.ypp" + case 149: /* variableimportlist: variable */ +#line 535 "antimony.ypp" {if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3170 "antimony.tab.cpp" +#line 3200 "antimony.tab.cpp" break; - case 149: /* variableimportlist: variableimportlist ',' variable */ -#line 522 "antimony.ypp" + case 150: /* variableimportlist: variableimportlist ',' variable */ +#line 536 "antimony.ypp" { if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3176 "antimony.tab.cpp" +#line 3206 "antimony.tab.cpp" break; - case 150: /* variableimportlist: "number" */ -#line 523 "antimony.ypp" + case 151: /* variableimportlist: "number" */ +#line 537 "antimony.ypp" {if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3182 "antimony.tab.cpp" +#line 3212 "antimony.tab.cpp" break; - case 151: /* variableimportlist: variableimportlist ',' "number" */ -#line 524 "antimony.ypp" + case 152: /* variableimportlist: variableimportlist ',' "number" */ +#line 538 "antimony.ypp" { if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3188 "antimony.tab.cpp" +#line 3218 "antimony.tab.cpp" break; - case 152: /* submodifications: %empty */ -#line 528 "antimony.ypp" + case 153: /* submodifications: %empty */ +#line 542 "antimony.ypp" {} -#line 3194 "antimony.tab.cpp" +#line 3224 "antimony.tab.cpp" break; - case 153: /* submodifications: submodifications ',' "element name" '=' variable */ -#line 529 "antimony.ypp" + case 154: /* submodifications: submodifications ',' "element name" '=' variable */ +#line 543 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].variable));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].variable))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3202 "antimony.tab.cpp" +#line 3232 "antimony.tab.cpp" break; - case 154: /* submodifications: submodifications ',' "element name" '=' "number" */ -#line 533 "antimony.ypp" + case 155: /* submodifications: submodifications ',' "element name" '=' "number" */ +#line 547 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].num));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].num))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3210 "antimony.tab.cpp" +#line 3240 "antimony.tab.cpp" break; - case 155: /* varinitialize: specinit */ -#line 537 "antimony.ypp" + case 156: /* varinitialize: specinit */ +#line 551 "antimony.ypp" { } -#line 3216 "antimony.tab.cpp" +#line 3246 "antimony.tab.cpp" break; - case 156: /* varinitialize: formulainit */ -#line 538 "antimony.ypp" + case 157: /* varinitialize: formulainit */ +#line 552 "antimony.ypp" { } -#line 3222 "antimony.tab.cpp" +#line 3252 "antimony.tab.cpp" break; - case 157: /* varinitialize: reactioninit */ -#line 539 "antimony.ypp" + case 158: /* varinitialize: reactioninit */ +#line 553 "antimony.ypp" { } -#line 3228 "antimony.tab.cpp" +#line 3258 "antimony.tab.cpp" break; - case 158: /* varinitialize: dnainit */ -#line 540 "antimony.ypp" + case 159: /* varinitialize: dnainit */ +#line 554 "antimony.ypp" { } -#line 3234 "antimony.tab.cpp" +#line 3264 "antimony.tab.cpp" break; - case 159: /* varinitialize: geneinit */ -#line 541 "antimony.ypp" + case 160: /* varinitialize: geneinit */ +#line 555 "antimony.ypp" { } -#line 3240 "antimony.tab.cpp" +#line 3270 "antimony.tab.cpp" break; - case 160: /* varinitialize: operatorinit */ -#line 542 "antimony.ypp" + case 161: /* varinitialize: operatorinit */ +#line 556 "antimony.ypp" { } -#line 3246 "antimony.tab.cpp" +#line 3276 "antimony.tab.cpp" break; - case 161: /* varinitialize: compartmentinit */ -#line 543 "antimony.ypp" + case 162: /* varinitialize: compartmentinit */ +#line 557 "antimony.ypp" { } -#line 3252 "antimony.tab.cpp" +#line 3282 "antimony.tab.cpp" break; - case 162: /* varinitialize: varconstinit */ -#line 544 "antimony.ypp" + case 163: /* varinitialize: varconstinit */ +#line 558 "antimony.ypp" { } -#line 3258 "antimony.tab.cpp" +#line 3288 "antimony.tab.cpp" break; - case 163: /* specinit: "'species'" varmaybeis */ -#line 547 "antimony.ypp" + case 164: /* specinit: "'species'" varmaybeis */ +#line 561 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3264 "antimony.tab.cpp" +#line 3294 "antimony.tab.cpp" break; - case 164: /* specinit: "'var'" "'species'" varmaybeis */ -#line 548 "antimony.ypp" + case 165: /* specinit: "'var'" "'species'" varmaybeis */ +#line 562 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3270 "antimony.tab.cpp" +#line 3300 "antimony.tab.cpp" break; - case 165: /* specinit: "'const'" "'species'" varmaybeis */ -#line 549 "antimony.ypp" + case 166: /* specinit: "'const'" "'species'" varmaybeis */ +#line 563 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3276 "antimony.tab.cpp" +#line 3306 "antimony.tab.cpp" break; - case 166: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ -#line 550 "antimony.ypp" + case 167: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ +#line 564 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3282 "antimony.tab.cpp" +#line 3312 "antimony.tab.cpp" break; - case 167: /* specinit: "'substanceOnly'" varmaybeis */ -#line 551 "antimony.ypp" + case 168: /* specinit: "'substanceOnly'" varmaybeis */ +#line 565 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3288 "antimony.tab.cpp" +#line 3318 "antimony.tab.cpp" break; - case 168: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ -#line 552 "antimony.ypp" + case 169: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ +#line 566 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3294 "antimony.tab.cpp" +#line 3324 "antimony.tab.cpp" break; - case 169: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ -#line 553 "antimony.ypp" + case 170: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ +#line 567 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3300 "antimony.tab.cpp" +#line 3330 "antimony.tab.cpp" break; - case 170: /* specinit: specinit ',' varmaybeis */ -#line 554 "antimony.ypp" + case 171: /* specinit: specinit ',' varmaybeis */ +#line 568 "antimony.ypp" {(yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3306 "antimony.tab.cpp" +#line 3336 "antimony.tab.cpp" break; - case 171: /* specinit: "'species'" '.' "element name" '=' formula */ -#line 555 "antimony.ypp" + case 172: /* specinit: "'species'" '.' "element name" '=' formula */ +#line 569 "antimony.ypp" {if (g_registry.CurrentModule()->AddSpeciesLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} -#line 3312 "antimony.tab.cpp" +#line 3342 "antimony.tab.cpp" break; - case 172: /* formulainit: "'formula'" varmaybeis */ -#line 558 "antimony.ypp" + case 173: /* formulainit: "'formula'" varmaybeis */ +#line 572 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3318 "antimony.tab.cpp" +#line 3348 "antimony.tab.cpp" break; - case 173: /* formulainit: "'var'" "'formula'" varmaybeis */ -#line 559 "antimony.ypp" + case 174: /* formulainit: "'var'" "'formula'" varmaybeis */ +#line 573 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3324 "antimony.tab.cpp" +#line 3354 "antimony.tab.cpp" break; - case 174: /* formulainit: "'const'" "'formula'" varmaybeis */ -#line 560 "antimony.ypp" + case 175: /* formulainit: "'const'" "'formula'" varmaybeis */ +#line 574 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3330 "antimony.tab.cpp" +#line 3360 "antimony.tab.cpp" break; - case 175: /* formulainit: formulainit ',' varmaybeis */ -#line 561 "antimony.ypp" + case 176: /* formulainit: formulainit ',' varmaybeis */ +#line 575 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3336 "antimony.tab.cpp" +#line 3366 "antimony.tab.cpp" break; - case 176: /* reactioninit: "'reaction'" varmaybeis */ -#line 564 "antimony.ypp" + case 177: /* reactioninit: "'reaction'" varmaybeis */ +#line 578 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3342 "antimony.tab.cpp" +#line 3372 "antimony.tab.cpp" break; - case 177: /* reactioninit: "'var'" "'reaction'" varmaybeis */ -#line 565 "antimony.ypp" + case 178: /* reactioninit: "'var'" "'reaction'" varmaybeis */ +#line 579 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3348 "antimony.tab.cpp" +#line 3378 "antimony.tab.cpp" break; - case 178: /* reactioninit: "'const'" "'reaction'" */ -#line 566 "antimony.ypp" + case 179: /* reactioninit: "'const'" "'reaction'" */ +#line 580 "antimony.ypp" {g_registry.SetError("Reactions may not be set 'const'."); YYABORT; } -#line 3354 "antimony.tab.cpp" +#line 3384 "antimony.tab.cpp" break; - case 179: /* reactioninit: reactioninit ',' varmaybeis */ -#line 567 "antimony.ypp" + case 180: /* reactioninit: reactioninit ',' varmaybeis */ +#line 581 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3360 "antimony.tab.cpp" +#line 3390 "antimony.tab.cpp" break; - case 180: /* reactioninit: "'reaction'" '.' "element name" '=' formula */ -#line 568 "antimony.ypp" + case 181: /* reactioninit: "'reaction'" '.' "element name" '=' formula */ +#line 582 "antimony.ypp" {if (g_registry.CurrentModule()->AddReactionLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} -#line 3366 "antimony.tab.cpp" +#line 3396 "antimony.tab.cpp" break; - case 181: /* dnainit: "'DNA'" varmaybeis */ -#line 571 "antimony.ypp" + case 182: /* dnainit: "'DNA'" varmaybeis */ +#line 585 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3372 "antimony.tab.cpp" +#line 3402 "antimony.tab.cpp" break; - case 182: /* dnainit: "'var'" "'DNA'" varmaybeis */ -#line 572 "antimony.ypp" + case 183: /* dnainit: "'var'" "'DNA'" varmaybeis */ +#line 586 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3378 "antimony.tab.cpp" +#line 3408 "antimony.tab.cpp" break; - case 183: /* dnainit: "'const'" "'DNA'" varmaybeis */ -#line 573 "antimony.ypp" + case 184: /* dnainit: "'const'" "'DNA'" varmaybeis */ +#line 587 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3384 "antimony.tab.cpp" +#line 3414 "antimony.tab.cpp" break; - case 184: /* dnainit: dnainit ',' varmaybeis */ -#line 574 "antimony.ypp" + case 185: /* dnainit: dnainit ',' varmaybeis */ +#line 588 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3390 "antimony.tab.cpp" +#line 3420 "antimony.tab.cpp" break; - case 185: /* geneinit: "'gene'" varmaybeis */ -#line 577 "antimony.ypp" + case 186: /* geneinit: "'gene'" varmaybeis */ +#line 591 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3396 "antimony.tab.cpp" +#line 3426 "antimony.tab.cpp" break; - case 186: /* geneinit: "'var'" "'gene'" varmaybeis */ -#line 578 "antimony.ypp" + case 187: /* geneinit: "'var'" "'gene'" varmaybeis */ +#line 592 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3402 "antimony.tab.cpp" +#line 3432 "antimony.tab.cpp" break; - case 187: /* geneinit: "'const'" "'gene'" varmaybeis */ -#line 579 "antimony.ypp" + case 188: /* geneinit: "'const'" "'gene'" varmaybeis */ +#line 593 "antimony.ypp" {g_registry.SetError("Genes may not be set 'const'."); YYABORT; } -#line 3408 "antimony.tab.cpp" +#line 3438 "antimony.tab.cpp" break; - case 188: /* geneinit: geneinit ',' varmaybeis */ -#line 580 "antimony.ypp" + case 189: /* geneinit: geneinit ',' varmaybeis */ +#line 594 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3414 "antimony.tab.cpp" +#line 3444 "antimony.tab.cpp" break; - case 189: /* operatorinit: "'operator'" varmaybeis */ -#line 583 "antimony.ypp" + case 190: /* operatorinit: "'operator'" varmaybeis */ +#line 597 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3420 "antimony.tab.cpp" +#line 3450 "antimony.tab.cpp" break; - case 190: /* operatorinit: "'var'" "'operator'" varmaybeis */ -#line 584 "antimony.ypp" + case 191: /* operatorinit: "'var'" "'operator'" varmaybeis */ +#line 598 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3426 "antimony.tab.cpp" +#line 3456 "antimony.tab.cpp" break; - case 191: /* operatorinit: "'const'" "'operator'" varmaybeis */ -#line 585 "antimony.ypp" + case 192: /* operatorinit: "'const'" "'operator'" varmaybeis */ +#line 599 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3432 "antimony.tab.cpp" +#line 3462 "antimony.tab.cpp" break; - case 192: /* operatorinit: operatorinit ',' varmaybeis */ -#line 586 "antimony.ypp" + case 193: /* operatorinit: operatorinit ',' varmaybeis */ +#line 600 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3438 "antimony.tab.cpp" +#line 3468 "antimony.tab.cpp" break; - case 193: /* compartmentinit: "'compartment'" varmaybeis */ -#line 590 "antimony.ypp" + case 194: /* compartmentinit: "'compartment'" varmaybeis */ +#line 604 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3444 "antimony.tab.cpp" +#line 3474 "antimony.tab.cpp" break; - case 194: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ -#line 591 "antimony.ypp" + case 195: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ +#line 605 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3450 "antimony.tab.cpp" +#line 3480 "antimony.tab.cpp" break; - case 195: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ -#line 592 "antimony.ypp" + case 196: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ +#line 606 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3456 "antimony.tab.cpp" +#line 3486 "antimony.tab.cpp" break; - case 196: /* compartmentinit: compartmentinit ',' varmaybeis */ -#line 593 "antimony.ypp" + case 197: /* compartmentinit: compartmentinit ',' varmaybeis */ +#line 607 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3462 "antimony.tab.cpp" +#line 3492 "antimony.tab.cpp" break; - case 197: /* compartmentinit: "'compartment'" '.' "element name" '=' formula */ -#line 594 "antimony.ypp" + case 198: /* compartmentinit: "'compartment'" '.' "element name" '=' formula */ +#line 608 "antimony.ypp" {if (g_registry.CurrentModule()->AddCompartmentLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} -#line 3468 "antimony.tab.cpp" +#line 3498 "antimony.tab.cpp" break; - case 198: /* varconstinit: "'var'" varmaybeis */ -#line 597 "antimony.ypp" + case 199: /* varconstinit: "'var'" varmaybeis */ +#line 611 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst();} -#line 3474 "antimony.tab.cpp" +#line 3504 "antimony.tab.cpp" break; - case 199: /* varconstinit: "'const'" varmaybeis */ -#line 598 "antimony.ypp" + case 200: /* varconstinit: "'const'" varmaybeis */ +#line 612 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst();} -#line 3480 "antimony.tab.cpp" +#line 3510 "antimony.tab.cpp" break; - case 200: /* varconstinit: varconstinit ',' varmaybeis */ -#line 599 "antimony.ypp" + case 201: /* varconstinit: varconstinit ',' varmaybeis */ +#line 613 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst();} -#line 3486 "antimony.tab.cpp" +#line 3516 "antimony.tab.cpp" break; - case 201: /* unitinit: "'unit'" variable '=' formula */ -#line 602 "antimony.ypp" + case 202: /* unitinit: "'unit'" variable '=' formula */ +#line 616 "antimony.ypp" {if ((yyvsp[-2].variable)->SetType(varUnitDefinition)) YYABORT; if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[-2].variable)->GetUnitDef()->SetFromFormula((yyvsp[0].formula))) YYABORT;} -#line 3494 "antimony.tab.cpp" +#line 3524 "antimony.tab.cpp" break; - case 202: /* unitinit: "'unit'" variable */ -#line 605 "antimony.ypp" + case 203: /* unitinit: "'unit'" variable */ +#line 619 "antimony.ypp" {if ((yyvsp[0].variable)->SetType(varUnitDefinition)) YYABORT;} -#line 3500 "antimony.tab.cpp" +#line 3530 "antimony.tab.cpp" break; - case 203: /* dnadef: dnastrand */ -#line 608 "antimony.ypp" + case 204: /* dnadef: dnastrand */ +#line 622 "antimony.ypp" {if (g_registry.SaveWorkingStrand()) YYABORT;} -#line 3506 "antimony.tab.cpp" +#line 3536 "antimony.tab.cpp" break; - case 204: /* dnadef: varmaybein ':' dnastrand */ -#line 609 "antimony.ypp" + case 205: /* dnadef: varmaybein ':' dnastrand */ +#line 623 "antimony.ypp" {if (g_registry.SetStrandAs((yyvsp[-2].variable))) YYABORT;} -#line 3512 "antimony.tab.cpp" +#line 3542 "antimony.tab.cpp" break; - case 205: /* dnastrand: "--" variable */ -#line 612 "antimony.ypp" + case 206: /* dnastrand: "--" variable */ +#line 626 "antimony.ypp" {if (g_registry.SetNewUpstreamOpen((yyvsp[0].variable))) YYABORT;} -#line 3518 "antimony.tab.cpp" +#line 3548 "antimony.tab.cpp" break; - case 206: /* dnastrand: "--" dnamiddle */ -#line 613 "antimony.ypp" + case 207: /* dnastrand: "--" dnamiddle */ +#line 627 "antimony.ypp" {g_registry.SetOpenUpstream(); } -#line 3524 "antimony.tab.cpp" +#line 3554 "antimony.tab.cpp" break; - case 207: /* dnastrand: dnamiddle variable */ -#line 614 "antimony.ypp" + case 208: /* dnastrand: dnamiddle variable */ +#line 628 "antimony.ypp" {if (g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3530 "antimony.tab.cpp" +#line 3560 "antimony.tab.cpp" break; - case 208: /* dnastrand: "--" dnamiddle variable */ -#line 615 "antimony.ypp" + case 209: /* dnastrand: "--" dnamiddle variable */ +#line 629 "antimony.ypp" {g_registry.SetOpenUpstream(); if(g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3536 "antimony.tab.cpp" +#line 3566 "antimony.tab.cpp" break; - case 209: /* dnastrand: dnamiddle */ -#line 616 "antimony.ypp" + case 210: /* dnastrand: dnamiddle */ +#line 630 "antimony.ypp" { } -#line 3542 "antimony.tab.cpp" +#line 3572 "antimony.tab.cpp" break; - case 210: /* dnamiddle: variable "--" */ -#line 619 "antimony.ypp" + case 211: /* dnamiddle: variable "--" */ +#line 633 "antimony.ypp" {if (g_registry.SetNewDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3548 "antimony.tab.cpp" +#line 3578 "antimony.tab.cpp" break; - case 211: /* dnamiddle: dnamiddle variable "--" */ -#line 620 "antimony.ypp" + case 212: /* dnamiddle: dnamiddle variable "--" */ +#line 634 "antimony.ypp" {if (g_registry.SetDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3554 "antimony.tab.cpp" +#line 3584 "antimony.tab.cpp" break; - case 212: /* $@8: %empty */ -#line 623 "antimony.ypp" + case 213: /* $@8: %empty */ +#line 637 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula))) YYABORT;} -#line 3560 "antimony.tab.cpp" +#line 3590 "antimony.tab.cpp" break; - case 213: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ -#line 623 "antimony.ypp" + case 214: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ +#line 637 "antimony.ypp" {} -#line 3566 "antimony.tab.cpp" +#line 3596 "antimony.tab.cpp" break; - case 214: /* $@9: %empty */ -#line 624 "antimony.ypp" + case 215: /* $@9: %empty */ +#line 638 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula))) YYABORT;} -#line 3572 "antimony.tab.cpp" +#line 3602 "antimony.tab.cpp" break; - case 215: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ -#line 624 "antimony.ypp" + case 216: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ +#line 638 "antimony.ypp" {} -#line 3578 "antimony.tab.cpp" +#line 3608 "antimony.tab.cpp" break; - case 216: /* $@10: %empty */ -#line 625 "antimony.ypp" + case 217: /* $@10: %empty */ +#line 639 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula), (yyvsp[-3].variable))) YYABORT;} -#line 3584 "antimony.tab.cpp" +#line 3614 "antimony.tab.cpp" break; - case 217: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ -#line 625 "antimony.ypp" + case 218: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ +#line 639 "antimony.ypp" {} -#line 3590 "antimony.tab.cpp" +#line 3620 "antimony.tab.cpp" break; - case 218: /* $@11: %empty */ -#line 626 "antimony.ypp" + case 219: /* $@11: %empty */ +#line 640 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula), (yyvsp[-5].variable))) YYABORT;} -#line 3596 "antimony.tab.cpp" +#line 3626 "antimony.tab.cpp" break; - case 219: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ -#line 626 "antimony.ypp" + case 220: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ +#line 640 "antimony.ypp" {} -#line 3602 "antimony.tab.cpp" +#line 3632 "antimony.tab.cpp" break; - case 220: /* colonret: ':' */ -#line 629 "antimony.ypp" + case 221: /* colonret: ':' */ +#line 643 "antimony.ypp" {} -#line 3608 "antimony.tab.cpp" +#line 3638 "antimony.tab.cpp" break; - case 221: /* colonret: colonret '\n' */ -#line 630 "antimony.ypp" + case 222: /* colonret: colonret '\n' */ +#line 644 "antimony.ypp" {} -#line 3614 "antimony.tab.cpp" +#line 3644 "antimony.tab.cpp" break; - case 222: /* eventmodifications: %empty */ -#line 633 "antimony.ypp" + case 223: /* eventmodifications: %empty */ +#line 647 "antimony.ypp" {} -#line 3620 "antimony.tab.cpp" +#line 3650 "antimony.tab.cpp" break; - case 223: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ -#line 634 "antimony.ypp" + case 224: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ +#line 648 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "priority")) {g_registry.GetCurrentEvent()->SetPriority(*(yyvsp[0].formula));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "t0")) {if (g_registry.GetCurrentEvent()->SetInitialValue(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "fromTrigger")) {if (g_registry.GetCurrentEvent()->SetUseValuesFromTriggerTime(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "persistent")) {if (g_registry.GetCurrentEvent()->SetPersistent(*(yyvsp[0].formula))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in event defintion. You may use the terms 'priority', 't0', 'fromTrigger', and 'persistent' here to set those properties of an event."); YYABORT;}} -#line 3630 "antimony.tab.cpp" +#line 3660 "antimony.tab.cpp" break; - case 224: /* assignmentlist: variable '=' formula */ -#line 641 "antimony.ypp" + case 225: /* assignmentlist: variable '=' formula */ +#line 655 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3636 "antimony.tab.cpp" +#line 3666 "antimony.tab.cpp" break; - case 225: /* assignmentlist: variable '=' formula ':' assignmentlist */ -#line 642 "antimony.ypp" + case 226: /* assignmentlist: variable '=' formula ':' assignmentlist */ +#line 656 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3642 "antimony.tab.cpp" +#line 3672 "antimony.tab.cpp" break; - case 226: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ -#line 643 "antimony.ypp" + case 227: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ +#line 657 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3648 "antimony.tab.cpp" +#line 3678 "antimony.tab.cpp" break; - case 227: /* assignmentlist: variable '=' formula ',' assignmentlist */ -#line 644 "antimony.ypp" + case 228: /* assignmentlist: variable '=' formula ',' assignmentlist */ +#line 658 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3654 "antimony.tab.cpp" +#line 3684 "antimony.tab.cpp" break; - case 228: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ -#line 645 "antimony.ypp" + case 229: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ +#line 659 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3660 "antimony.tab.cpp" +#line 3690 "antimony.tab.cpp" break; - case 229: /* deletion: "'delete'" variable */ -#line 648 "antimony.ypp" + case 230: /* deletion: "'delete'" variable */ +#line 662 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3666 "antimony.tab.cpp" +#line 3696 "antimony.tab.cpp" break; - case 230: /* deletion: deletion ',' variable */ -#line 649 "antimony.ypp" + case 231: /* deletion: deletion ',' variable */ +#line 663 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3672 "antimony.tab.cpp" +#line 3702 "antimony.tab.cpp" break; - case 231: /* unitdef: formula */ -#line 652 "antimony.ypp" + case 232: /* unitdef: formula */ +#line 666 "antimony.ypp" { if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[0].formula)->IsSingleVariable()) { @@ -3686,125 +3716,125 @@ yyparse (void) (yyval.variable) = g_registry.CurrentModule()->AddOrFindUnitDef(ud); } } -#line 3690 "antimony.tab.cpp" +#line 3720 "antimony.tab.cpp" break; - case 232: /* constraint: "number" inequality formula */ -#line 667 "antimony.ypp" + case 233: /* constraint: "number" inequality formula */ +#line 681 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3696 "antimony.tab.cpp" +#line 3726 "antimony.tab.cpp" break; - case 233: /* constraint: '-' "number" inequality formula */ -#line 668 "antimony.ypp" + case 234: /* constraint: '-' "number" inequality formula */ +#line 682 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint(-(yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3702 "antimony.tab.cpp" +#line 3732 "antimony.tab.cpp" break; - case 234: /* constraint: "name of a pre-defined constant" inequality formula */ -#line 669 "antimony.ypp" + case 235: /* constraint: "name of a pre-defined constant" inequality formula */ +#line 683 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3708 "antimony.tab.cpp" +#line 3738 "antimony.tab.cpp" break; - case 235: /* constraint: "element name" inequality formula */ -#line 670 "antimony.ypp" + case 236: /* constraint: "element name" inequality formula */ +#line 684 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3714 "antimony.tab.cpp" +#line 3744 "antimony.tab.cpp" break; - case 236: /* constraint: "'constraint'" ':' formula */ -#line 671 "antimony.ypp" + case 237: /* constraint: "'constraint'" ':' formula */ +#line 685 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[0].formula))) YYABORT;} -#line 3720 "antimony.tab.cpp" +#line 3750 "antimony.tab.cpp" break; - case 237: /* constraint: "'constraint'" variable ':' formula */ -#line 672 "antimony.ypp" + case 238: /* constraint: "'constraint'" variable ':' formula */ +#line 686 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3726 "antimony.tab.cpp" +#line 3756 "antimony.tab.cpp" break; - case 238: /* objective: maxormin formula */ -#line 675 "antimony.ypp" + case 239: /* objective: maxormin formula */ +#line 689 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3732 "antimony.tab.cpp" +#line 3762 "antimony.tab.cpp" break; - case 239: /* maxormin: "'maximize'" */ -#line 678 "antimony.ypp" + case 240: /* maxormin: "'maximize'" */ +#line 692 "antimony.ypp" {(yyval.maxormin) = true;} -#line 3738 "antimony.tab.cpp" +#line 3768 "antimony.tab.cpp" break; - case 240: /* maxormin: "'minimize'" */ -#line 679 "antimony.ypp" + case 241: /* maxormin: "'minimize'" */ +#line 693 "antimony.ypp" {(yyval.maxormin) = false;} -#line 3744 "antimony.tab.cpp" +#line 3774 "antimony.tab.cpp" break; - case 241: /* stringlist: "text string" */ -#line 682 "antimony.ypp" + case 242: /* stringlist: "text string" */ +#line 696 "antimony.ypp" { (yyval.stringlist) = new std::vector(); (yyval.stringlist)->push_back(*((yyvsp[0].word))); } -#line 3750 "antimony.tab.cpp" +#line 3780 "antimony.tab.cpp" break; - case 242: /* stringlist: stringlist ',' "text string" */ -#line 683 "antimony.ypp" + case 243: /* stringlist: stringlist ',' "text string" */ +#line 697 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-2].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3756 "antimony.tab.cpp" +#line 3786 "antimony.tab.cpp" break; - case 243: /* stringlist: stringlist ',' '\n' "text string" */ -#line 684 "antimony.ypp" + case 244: /* stringlist: stringlist ',' '\n' "text string" */ +#line 698 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-3].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3762 "antimony.tab.cpp" +#line 3792 "antimony.tab.cpp" break; - case 244: /* $@12: %empty */ -#line 686 "antimony.ypp" + case 245: /* $@12: %empty */ +#line 700 "antimony.ypp" {if (g_registry.SetCurrentModuleIf((yyvsp[0].word), (yyvsp[-1].word))) YYABORT;} -#line 3768 "antimony.tab.cpp" +#line 3798 "antimony.tab.cpp" break; - case 245: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ -#line 686 "antimony.ypp" + case 246: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ +#line 700 "antimony.ypp" {g_registry.RevertToPreviousModule();} -#line 3774 "antimony.tab.cpp" +#line 3804 "antimony.tab.cpp" break; - case 246: /* annotations: %empty */ -#line 689 "antimony.ypp" + case 247: /* annotations: %empty */ +#line 703 "antimony.ypp" {} -#line 3780 "antimony.tab.cpp" +#line 3810 "antimony.tab.cpp" break; - case 247: /* annotations: "element name" ':' stringlist */ -#line 690 "antimony.ypp" + case 248: /* annotations: "element name" ':' stringlist */ +#line 704 "antimony.ypp" {string modname = g_registry.CurrentModuleName(); g_registry.ProcessGlobalCVTerm(&modname, (yyvsp[-2].word), (yyvsp[0].stringlist));} -#line 3786 "antimony.tab.cpp" +#line 3816 "antimony.tab.cpp" break; - case 248: /* cvterm: variable "element name" stringlist */ -#line 695 "antimony.ypp" + case 249: /* cvterm: variable "element name" stringlist */ +#line 709 "antimony.ypp" {if (g_registry.CurrentModule()->ProcessCVTerm((yyvsp[-2].variable),(yyvsp[-1].word),(yyvsp[0].stringlist))) YYABORT;} -#line 3792 "antimony.tab.cpp" +#line 3822 "antimony.tab.cpp" break; - case 249: /* cvterm: variable "element name" '.' "element name" stringlist */ -#line 696 "antimony.ypp" + case 250: /* cvterm: variable "element name" '.' "element name" stringlist */ +#line 710 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].stringlist))) YYABORT;} -#line 3798 "antimony.tab.cpp" +#line 3828 "antimony.tab.cpp" break; - case 250: /* cvterm: variable "element name" '.' "element name" "number" */ -#line 697 "antimony.ypp" + case 251: /* cvterm: variable "element name" '.' "element name" "number" */ +#line 711 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].num))) YYABORT;} -#line 3804 "antimony.tab.cpp" +#line 3834 "antimony.tab.cpp" break; - case 251: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ -#line 701 "antimony.ypp" + case 252: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ +#line 715 "antimony.ypp" { Module* module = g_registry.GetModule(*(yyvsp[-4].word)); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); @@ -3814,11 +3844,11 @@ yyparse (void) YYABORT; } } -#line 3818 "antimony.tab.cpp" +#line 3848 "antimony.tab.cpp" break; - case 252: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ -#line 712 "antimony.ypp" + case 253: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ +#line 726 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { function->SetSBOTerm(lround((yyvsp[0].num))); @@ -3828,39 +3858,39 @@ yyparse (void) YYABORT; } } -#line 3832 "antimony.tab.cpp" +#line 3862 "antimony.tab.cpp" break; - case 253: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ -#line 722 "antimony.ypp" + case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ +#line 736 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { - if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; + if (function->SetLayout((yyvsp[0].word))) YYABORT; } else { - g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set on '" + *((yyvsp[-4].word)) + "' to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set on '" + *((yyvsp[-4].word)) + "' to a string is 'layout'."); YYABORT; } } -#line 3846 "antimony.tab.cpp" +#line 3876 "antimony.tab.cpp" break; - case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "name of a pre-defined constant" */ -#line 732 "antimony.ypp" + case 255: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "name of a pre-defined constant" */ +#line 746 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { - if (function->SetAutoLayout((yyvsp[0].word))) YYABORT; + if (function->SetLayout((yyvsp[0].word))) YYABORT; } else { - g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set on '" + *((yyvsp[-4].word)) + "' to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set on '" + *((yyvsp[-4].word)) + "' to a string is 'layout'."); YYABORT; } } -#line 3860 "antimony.tab.cpp" +#line 3890 "antimony.tab.cpp" break; - case 255: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ -#line 742 "antimony.ypp" + case 256: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ +#line 756 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; @@ -3872,13 +3902,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 3878 "antimony.tab.cpp" +#line 3908 "antimony.tab.cpp" break; - case 256: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ -#line 756 "antimony.ypp" + case 257: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ +#line 770 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; @@ -3890,13 +3920,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 3896 "antimony.tab.cpp" +#line 3926 "antimony.tab.cpp" break; - case 257: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ -#line 770 "antimony.ypp" + case 258: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ +#line 784 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -3908,13 +3938,13 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 3914 "antimony.tab.cpp" +#line 3944 "antimony.tab.cpp" break; - case 258: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ -#line 784 "antimony.ypp" + case 259: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ +#line 798 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -3926,49 +3956,49 @@ yyparse (void) g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-6].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } -#line 3932 "antimony.tab.cpp" +#line 3962 "antimony.tab.cpp" break; - case 259: /* modulename: "name of an existing module" "'is'" "text string" lineend */ -#line 800 "antimony.ypp" + case 260: /* modulename: "name of an existing module" "'is'" "text string" lineend */ +#line 814 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3938 "antimony.tab.cpp" +#line 3968 "antimony.tab.cpp" break; - case 260: /* functionname: "name of an existing function" "'is'" "text string" lineend */ -#line 802 "antimony.ypp" + case 261: /* functionname: "name of an existing function" "'is'" "text string" lineend */ +#line 816 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3944 "antimony.tab.cpp" +#line 3974 "antimony.tab.cpp" break; - case 261: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ -#line 805 "antimony.ypp" + case 262: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ +#line 819 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3950 "antimony.tab.cpp" +#line 3980 "antimony.tab.cpp" break; - case 262: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ -#line 806 "antimony.ypp" + case 263: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ +#line 820 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT;} -#line 3956 "antimony.tab.cpp" +#line 3986 "antimony.tab.cpp" break; - case 263: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ -#line 807 "antimony.ypp" + case 264: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ +#line 821 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT;} -#line 3962 "antimony.tab.cpp" +#line 3992 "antimony.tab.cpp" break; - case 264: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ -#line 808 "antimony.ypp" + case 265: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ +#line 822 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3968 "antimony.tab.cpp" +#line 3998 "antimony.tab.cpp" break; -#line 3972 "antimony.tab.cpp" +#line 4002 "antimony.tab.cpp" default: break; } @@ -4192,7 +4222,7 @@ yyparse (void) return yyresult; } -#line 810 "antimony.ypp" +#line 824 "antimony.ypp" diff --git a/src/antimony.ypp b/src/antimony.ypp index ff195c4b..072ab7c8 100644 --- a/src/antimony.ypp +++ b/src/antimony.ypp @@ -288,21 +288,21 @@ moduleannotation: MODULE ANTWORD stringlist lineend } | MODULE '.' ANTWORD '=' ANTWORD { Module* module = g_registry.CurrentModule(); - if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { - if (module->SetAutoLayout($5)) YYABORT; + if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5)) YYABORT; } else { - g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a string is 'layout'."); YYABORT; } } | MODULE '.' ANTWORD '=' CONSTANT { Module* module = g_registry.CurrentModule(); - if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { - if (module->SetAutoLayout($5)) YYABORT; + if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5)) YYABORT; } else { - g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a string is 'layout'."); YYABORT; } } @@ -318,7 +318,7 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } | MODULE '.' ANTWORD '.' ANTWORD '=' ANTWORD { Module* module = g_registry.CurrentModule(); @@ -332,7 +332,21 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); + } + | MODULE '.' ANTWORD '.' ANTWORD '=' TEXTSTRING + { Module* module = g_registry.CurrentModule(); + if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { + if (module->SetAutoLayout($5, $7)) YYABORT; + } + else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { + if (module->SetLayout($5, $7)) YYABORT; + } + else { + g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); + YYABORT; + } + module->SetLayout("on"); } | MODULE '.' ANTWORD '.' ANTWORD '=' '{' variablelist '}' { Module* module = g_registry.CurrentModule(); @@ -346,7 +360,7 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } | MODULE '.' ANTWORD '.' ANTWORD '=' '{' numlist '}' { Module* module = g_registry.CurrentModule(); @@ -360,7 +374,7 @@ moduleannotation: MODULE ANTWORD stringlist lineend g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } ; @@ -721,20 +735,20 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM | MODNAME '.' ANTWORD '=' ANTWORD { Module* function = g_registry.GetModule(*$1); if (function && $3 && CaselessStrCmp(true, *($3), "autolayout")) { - if (function->SetAutoLayout($5)) YYABORT; + if (function->SetLayout($5)) YYABORT; } else { - g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set on '" + *($1) + "' to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set on '" + *($1) + "' to a string is 'layout'."); YYABORT; } } | MODNAME '.' ANTWORD '=' CONSTANT { Module* function = g_registry.GetModule(*$1); if (function && $3 && CaselessStrCmp(true, *($3), "autolayout")) { - if (function->SetAutoLayout($5)) YYABORT; + if (function->SetLayout($5)) YYABORT; } else { - g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set on '" + *($1) + "' to a string is 'autolayout'."); + g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set on '" + *($1) + "' to a string is 'layout'."); YYABORT; } } @@ -750,7 +764,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } | MODNAME '.' ANTWORD '.' ANTWORD '=' ANTWORD { Module* module = g_registry.CurrentModule(); @@ -764,7 +778,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } | MODNAME '.' ANTWORD '.' ANTWORD '=' '{' variablelist '}' { Module* module = g_registry.CurrentModule(); @@ -778,7 +792,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } | MODNAME '.' ANTWORD '.' ANTWORD '=' '{' numlist '}' { Module* module = g_registry.CurrentModule(); @@ -792,7 +806,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); YYABORT; } - module->SetAutoLayout("on"); + module->SetLayout("on"); } // JKM for naming modules and functions (display names) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 600599e0..3d853a27 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -73,7 +73,22 @@ const Variable* LayoutWrapper::GetSameVariable() const bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) { if (Variable::SetFormula(formula, isObjective)) { - return true; + string formstring = formula->ToSBMLString(); + ColorDefinition cd; + if (!cd.setColorValue(formstring)) { + formstring = "#" + formstring; + if (!cd.setColorValue(formstring)) { + return true; + } + formula->Clear(); + formula->AddText(&formstring, true); + } + //If it's a valid color definition, we can use it + m_valFormula = *formula; + } + + if (formula->IsEmpty()) { + assert(false); } if (IsPair(m_layout_type)) { @@ -106,9 +121,12 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) else { string formstring = m_valFormula.ToSBMLString(); ASTNode* astn = parseStringToASTNode(formstring); - double lval = astn->getValue(); + double lval = util_NaN(); + if (astn) { + lval = astn->getValue(); + } string strval = ""; - if (astn->getType() == AST_NAME) { + if (astn && astn->getType() == AST_NAME) { strval = astn->getName(); } if (formula->IsOneComponent()) { @@ -133,7 +151,7 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) case lt_color: case lt_fontcolor: case lt_linecolor: - if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(formstring)) { + if (!isValidColorValue(formstring)) { g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "'. '" + formula->ToDelimitedStringWithEllipses(".") + "' is not a valid color value. Try standard color names like 'red' or 'blue', or use an RGB value of the form \"#000000\" (including the quotation marks)."); return true; } @@ -216,7 +234,11 @@ string LayoutWrapper::CreateLayoutParamsAntimonySyntax(const string& indent) con { string ret = ""; if (!m_valFormula.IsEmpty()) { - ret = indent + GetNameDelimitedBy(".") + " = " + m_valFormula.ToDelimitedStringWithEllipses(".") + "\n"; + string strval = m_valFormula.ToDelimitedStringWithEllipses("."); + if (strval[0] == '#') { + strval = '"' + strval + '"'; + } + ret = indent + GetNameDelimitedBy(".") + " = " + strval + "\n"; } if (!m_displayname.empty()) { ret += indent + GetNameDelimitedBy(".") + " is \"" + m_displayname + "\"\n"; @@ -256,11 +278,15 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const } if (ret1 == -1 || ret2 == -1) { g_registry.SetError(error); + delete astn; return true; } } else { - double lval = astn->getValue(); + double lval = util_NaN(); + if (astn) { + lval = astn->getValue(); + } int ret = 0; switch (m_layout_type) { case lt_position: @@ -297,19 +323,19 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const break; case lt_fontstyle: case lt_fontweight: - if (CaselessStrCmp(false, formstring, "bold")) { + if (CaselessStrCmp(true, formstring, "bold")) { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, sid, formstring); } - if (CaselessStrCmp(false, formstring, "italic")) { + if (CaselessStrCmp(true, formstring, "italic")) { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, sid, formstring); } - if (CaselessStrCmp(false, formstring, "normal")) { + if (CaselessStrCmp(true, formstring, "normal")) { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, sid, formstring); if (ret == 0) { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, sid, formstring); } } - if (CaselessStrCmp(false, formstring, "bold_italic")) { + if (CaselessStrCmp(true, formstring, "bold_italic")) { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontWeight(sbml, sid, "bold"); if (ret == 0) { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFontStyle(sbml, sid, "italic"); @@ -490,7 +516,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string break; case lt_fontstyle: case lt_fontweight: - if (CaselessStrCmp(false, formstring, "bold")) { + if (CaselessStrCmp(true, formstring, "bold")) { if (group == "species") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, formstring); } @@ -508,7 +534,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string assert(false); } } - if (CaselessStrCmp(false, formstring, "italic")) { + if (CaselessStrCmp(true, formstring, "italic")) { if (group == "species") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontStyle(sbml, 0, formstring); } @@ -526,7 +552,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string assert(false); } } - if (CaselessStrCmp(false, formstring, "normal")) { + if (CaselessStrCmp(true, formstring, "normal")) { if (group == "species") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, formstring); } @@ -562,7 +588,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string } } } - if (CaselessStrCmp(false, formstring, "bold_italic")) { + if (CaselessStrCmp(true, formstring, "bold_italic")) { if (group == "species") { ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesFontWeight(sbml, 0, "bold"); } diff --git a/src/module.cpp b/src/module.cpp index 29155eb0..5e0261c4 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3138,7 +3138,7 @@ void Module::SetSBOTerm(int sboTerm) } } -bool Module::SetAutoLayout(const string* isset) +bool Module::SetLayout(const string* isset) { if (CaselessStrCmp(true, *isset, "on") || CaselessStrCmp(true, *isset, "true")) { @@ -3147,16 +3147,16 @@ bool Module::SetAutoLayout(const string* isset) } else if (CaselessStrCmp(true, *isset, "off") || CaselessStrCmp(true, *isset, "false")) { - g_registry.SetError("The only way to turn off autolayout to not include any layout information in the Antimony model. Do not try to set model.autolayout to '" + *isset + "'."); + g_registry.SetError("The only way to turn off layout to not include any layout information in the Antimony model. Do not try to set model.layout to '" + *isset + "'."); return true; } - g_registry.SetError("Unable to set autolayout to '" + *isset + "': it can only be used to turn on autolayout by setting it to 'true' or 'on'."); + g_registry.SetError("Unable to set layout to '" + *isset + "': it can only be used to turn on layout by setting it to 'true' or 'on'."); return true; } -bool Module::SetAutoLayout(const std::string& isset) +bool Module::SetLayout(const std::string& isset) { - return SetAutoLayout(&isset); + return SetLayout(&isset); } bool Module::SetAutoLayout(const std::string* argument, const std::string* value) @@ -3335,7 +3335,7 @@ bool Module::SetLayout(const std::string* argument, const std::string* value) } if (type == "color") { - if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(*value)) { + if (!isValidColorValue(*value)) { g_registry.SetError("Unable to set layout." + *argument + " to '" + *value + "': that's not a valid color. Try something like 'red' or 'blue' or a hex color of the form '#FF0000'."); return true; } @@ -3662,7 +3662,7 @@ string Module::GetAntimonyAutolayout(const string& indent) const { stringstream ret; ret << indent << "# Autolayout options" << endl; - ret << indent << "model.autolayout = on" << endl; + ret << indent << "model.layout = on" << endl; //if (m_autolayout.stiffness != 10) { // ret << indent << "model.autolayout.stiffness = " << m_autolayout.stiffness << endl; //} @@ -3704,7 +3704,7 @@ string Module::GetAntimonyGeneralLayout(const string& indent) const { stringstream ret; ret << indent << "# General layout defaults" << endl; - if (m_layout.height && m_layout.width) { + if (m_layout.height || m_layout.width) { ret << indent << "model.layout.size = {" << m_layout.width << ", " << m_layout.height << "}" << endl; } else if (m_layout.height) { @@ -3717,7 +3717,14 @@ string Module::GetAntimonyGeneralLayout(const string& indent) const ret << indent << "model.layout.style = " << m_layout.style << endl; } if (m_layout.background != "") { - ret << indent << "model.layout.background = " << m_layout.background << endl; + string colorstring; + if (m_layout.background[0] == '#') { + colorstring = '"' + m_layout.background + '"'; + } + else { + colorstring = m_layout.background; + } + ret << indent << "model.layout.background = " << colorstring << endl; } if (m_layout.align_top.size()) { ret << indent << getSetString(m_layout.align_top); diff --git a/src/module.h b/src/module.h index 091131d8..fc332441 100644 --- a/src/module.h +++ b/src/module.h @@ -196,8 +196,8 @@ class Module : public Annotated bool GetNeedDefaultCompartment() const; virtual void SetSBOTerm(int sboTerm); - virtual bool SetAutoLayout(const std::string* isset); - virtual bool SetAutoLayout(const std::string& isset); + virtual bool SetLayout(const std::string* isset); + virtual bool SetLayout(const std::string& isset); virtual bool SetAutoLayout(const std::string* argument, const std::string* value); virtual bool SetAutoLayout(const std::string* argument, const double& value); virtual bool SetAutoLayout(const std::string* argument, const std::vector* values); diff --git a/src/sbmlx.cpp b/src/sbmlx.cpp index 449824bb..179992cc 100644 --- a/src/sbmlx.cpp +++ b/src/sbmlx.cpp @@ -6,6 +6,7 @@ #include "formula.h" #include "registry.h" #include "typex.h" +#include using namespace std; using namespace libsbml; @@ -805,4 +806,16 @@ bool FluxesMatch(const FluxBound* fb1, const FluxBound* fb2) return true; } +bool isValidColorValue(string formstring) +{ + if (!LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(formstring)) { + ColorDefinition cd; + if (!cd.setColorValue(formstring)) { + return false; + } + } + return true; +} + + #endif \ No newline at end of file diff --git a/src/sbmlx.h b/src/sbmlx.h index 8ca96405..2015d1ce 100644 --- a/src/sbmlx.h +++ b/src/sbmlx.h @@ -51,4 +51,6 @@ constraint_type getConstraintTypeFrom(libsbml::FluxBoundOperation_t fbtype); bool FluxesMatch(const libsbml::FluxBound* fb1, const libsbml::FluxBound* fb2); #endif +bool isValidColorValue(std::string formstring); + #endif diff --git a/src/typex.cpp b/src/typex.cpp index 325af3ca..919d3991 100644 --- a/src/typex.cpp +++ b/src/typex.cpp @@ -641,62 +641,62 @@ string LayoutTypeToString(const layout_type ltype) layout_type LayoutStringToType(const string& ltype) { - if (CaselessStrCmp(false, ltype, "position") || - CaselessStrCmp(false, ltype, "pos")) { + if (CaselessStrCmp(true, ltype, "position") || + CaselessStrCmp(true, ltype, "pos")) { return lt_position; } - if (CaselessStrCmp(false, ltype, "x")) { + if (CaselessStrCmp(true, ltype, "x")) { return lt_x; } - if (CaselessStrCmp(false, ltype, "y")) { + if (CaselessStrCmp(true, ltype, "y")) { return lt_y; } - if (CaselessStrCmp(false, ltype, "size")) { + if (CaselessStrCmp(true, ltype, "size")) { return lt_size; } - if (CaselessStrCmp(false, ltype, "height")) { + if (CaselessStrCmp(true, ltype, "height")) { return lt_height; } - if (CaselessStrCmp(false, ltype, "width")) { + if (CaselessStrCmp(true, ltype, "width")) { return lt_width; } - if (CaselessStrCmp(false, ltype, "color")) { + if (CaselessStrCmp(true, ltype, "color")) { return lt_color; } - if (CaselessStrCmp(false, ltype, "fillcolor")) { + if (CaselessStrCmp(true, ltype, "fillcolor")) { return lt_color; } - if (CaselessStrCmp(false, ltype, "font")) { + if (CaselessStrCmp(true, ltype, "font")) { return lt_font; } - if (CaselessStrCmp(false, ltype, "fontsize")) { + if (CaselessStrCmp(true, ltype, "fontsize")) { return lt_fontsize; } - if (CaselessStrCmp(false, ltype, "fontcolor")) { + if (CaselessStrCmp(true, ltype, "fontcolor")) { return lt_fontcolor; } - if (CaselessStrCmp(false, ltype, "fontweight")) { + if (CaselessStrCmp(true, ltype, "fontweight")) { return lt_fontweight; } - if (CaselessStrCmp(false, ltype, "fontstyle")) { + if (CaselessStrCmp(true, ltype, "fontstyle")) { return lt_fontstyle; } - if (CaselessStrCmp(false, ltype, "linethickness")) { + if (CaselessStrCmp(true, ltype, "linethickness")) { return lt_linewidth; } - if (CaselessStrCmp(false, ltype, "linewidth")) { + if (CaselessStrCmp(true, ltype, "linewidth")) { return lt_linewidth; } - if (CaselessStrCmp(false, ltype, "strokewidth")) { + if (CaselessStrCmp(true, ltype, "strokewidth")) { return lt_linewidth; } - if (CaselessStrCmp(false, ltype, "borderwidth")) { + if (CaselessStrCmp(true, ltype, "borderwidth")) { return lt_linewidth; } - if (CaselessStrCmp(false, ltype, "linecolor")) { + if (CaselessStrCmp(true, ltype, "linecolor")) { return lt_linecolor; } - if (CaselessStrCmp(false, ltype, "shape")) { + if (CaselessStrCmp(true, ltype, "shape")) { return lt_shape; } return lt_unknown; @@ -704,16 +704,16 @@ layout_type LayoutStringToType(const string& ltype) bool isValidFontStyle(const std::string& ftype) { - if (CaselessStrCmp(false, ftype, "bold")) { + if (CaselessStrCmp(true, ftype, "bold")) { return true; } - if (CaselessStrCmp(false, ftype, "italic")) { + if (CaselessStrCmp(true, ftype, "italic")) { return true; } - if (CaselessStrCmp(false, ftype, "normal")) { + if (CaselessStrCmp(true, ftype, "normal")) { return true; } - if (CaselessStrCmp(false, ftype, "bold_italic")) { + if (CaselessStrCmp(true, ftype, "bold_italic")) { return true; } return false; diff --git a/src/variable.cpp b/src/variable.cpp index d8de88c5..279f71be 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -1044,11 +1044,13 @@ bool Variable::SetFormula(Formula* formula, bool isObjective) string formstring = formula->ToSBMLString(GetStrandVars()); if (formstring.size() > 0) { ASTNode_t* ASTform = parseStringToASTNode(formstring); - char* err = SBML_getLastParseL3Error(); - string errstring(err); - free(err); - if (ASTform == NULL && !errstring.empty()) { - g_registry.SetError("In the formula \"" + formula->ToDelimitedStringWithEllipses(".") + "\": " + errstring); + if (ASTform == NULL) { + char* err = SBML_getLastParseL3Error(); + string errstring(err); + free(err); + if (!errstring.empty()) { + g_registry.SetError("In the formula \"" + formula->ToDelimitedStringWithEllipses(".") + "\": " + errstring); + } return true; } delete ASTform; From fa9ea45c8e15c00953b1b1e3c21d3f26a74cbd25 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 23 Aug 2024 18:02:31 -0700 Subject: [PATCH 26/43] Clean up output; get 'group defaults'. --- src/layoutWrapper.cpp | 2 +- src/module-sbml.cpp | 384 ++++++++++++++++++++++++++++++++++++------ src/module.cpp | 59 ++++--- src/module.h | 1 - 4 files changed, 364 insertions(+), 82 deletions(-) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 3d853a27..f3d9538e 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -235,7 +235,7 @@ string LayoutWrapper::CreateLayoutParamsAntimonySyntax(const string& indent) con string ret = ""; if (!m_valFormula.IsEmpty()) { string strval = m_valFormula.ToDelimitedStringWithEllipses("."); - if (strval[0] == '#') { + if (strval[0] == '#' || (strval.find('-') != string::npos) || (strval.find(' ') != string::npos)) { strval = '"' + strval + '"'; } ret = indent + GetNameDelimitedBy(".") + " = " + strval + "\n"; diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index de0e2608..aed65e55 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2449,6 +2449,7 @@ void Module::CreateSBMLModel(bool comp) // Layout/Render! if (m_autolayout.use) { LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true); // , m_autolayout.lockedNodeIds); + //For some reason, the following line is REQUIRED; otherwise I get linking errors(!) about how 'autolayout' is missing. WTF?? LS DEBUG LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); if (m_layout.width != 0) { LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(&m_sbml, m_layout.width); @@ -2519,9 +2520,10 @@ void Module::CreateSBMLModel(bool comp) //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_autolayout.lockedNodeIds.size() > 0) { - double J0x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "J0"); + double S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); - J0x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "J0"); + S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); + S1x = S1x; } } } @@ -3137,6 +3139,18 @@ void Module::UpdateRateOf(Model* model) } } +string getFontStyleFrom(string ital, string weight) +{ + if (weight == "bold") { + if (ital == "italic") { + return "bold_italic"; + } + return weight; + } + return ital; +} + + struct layoutInfo { double width = -1; double height = -1; @@ -3150,49 +3164,317 @@ struct layoutInfo { string shape = ""; }; -layoutInfo getDefaultLayoutInfo() +layoutInfo getDefaultSpeciesLayoutInfo(map style, std::vector& speciesLayouts, SBMLDocument* doc) { layoutInfo ret; - ret.color = "white"; - ret.linecolor = "black"; - ret.linewidth = 2; - ret.font = "sans-serif"; - ret.fontcolor = "black"; - ret.fontsize = 10; - ret.fontstyle = "normal"; - ret.shape = "rectangle"; + ret.width = 60; + ret.height = 36; + + ret.color = style["species-fill-color"]; + string color = LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFillColor(doc); + if (color != ret.color) { + ret.color = color; + LayoutWrapper* lw = new LayoutWrapper(lt_color, "species"); + Formula form; + form.AddText(&color, true); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + ret.linecolor = style["species-border-color"]; + string linecolor = LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeColor(doc); + if (linecolor != ret.linecolor) { + ret.linecolor = linecolor; + LayoutWrapper* lw = new LayoutWrapper(lt_linecolor, "species"); + Formula form; + form.AddText(&linecolor, true); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + ret.linewidth = atof(style["species-border-width"].c_str()); + double linewidth = LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeWidth(doc); + if (linewidth != ret.linewidth) { + ret.linewidth = linewidth; + LayoutWrapper* lw = new LayoutWrapper(lt_linewidth, "species"); + Formula form; + form.AddNum(linewidth); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + ret.font = "sans-serif"; // style["species-font-style"]; + string font = LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontFamily(doc); + if (font != ret.font) { + ret.font = font; + LayoutWrapper* lw = new LayoutWrapper(lt_font, "species"); + Formula form; + form.AddText(&font, true); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + ret.fontcolor = style["species-font-color"]; + string fontcolor = LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontColor(doc); + if (fontcolor != ret.fontcolor) { + ret.fontcolor = fontcolor; + LayoutWrapper* lw = new LayoutWrapper(lt_fontcolor, "species"); + Formula form; + form.AddText(&fontcolor, true); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + ret.fontsize = atof(style["species-font-size"].c_str()); + double fontsize = LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontSizeAsDouble(doc); + if (fontsize != ret.fontsize) { + ret.fontsize = fontsize; + LayoutWrapper* lw = new LayoutWrapper(lt_fontsize, "species"); + Formula form; + form.AddNum(fontsize); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + ret.fontstyle = getFontStyleFrom(style["species-font-style"], style["species-font-weight"]); + string fontstyle = getFontStyleFrom(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontStyle(doc), LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontWeight(doc)); + if (fontstyle != ret.fontstyle) { + ret.fontstyle = fontstyle; + LayoutWrapper* lw = new LayoutWrapper(lt_fontstyle, "species"); + Formula form; + form.AddText(&fontstyle, true); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + ret.shape = style["species-geometric-shape"]; + string shape = LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesGeometricShapeType(doc); + if (shape != ret.shape) { + ret.shape = shape; + LayoutWrapper* lw = new LayoutWrapper(lt_shape, "species"); + Formula form; + form.AddText(&shape, true); + lw->SetFormula(&form); + speciesLayouts.push_back(lw); + } + + //{ "species-border-radius-x", "6" }, + //{ "species-border-radius-y", "3.6" }, return ret; } -layoutInfo getDefaultSpeciesLayoutInfo() +layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vector& compartmentLayouts, SBMLDocument* doc) { - layoutInfo ret = getDefaultLayoutInfo(); - ret.width = 60; - ret.height = 36; - ret.fontsize = 24; + layoutInfo ret; + + ret.color = style["compartment-fill-color"]; + string color = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFillColor(doc); + if (color != ret.color) { + ret.color = color; + LayoutWrapper* lw = new LayoutWrapper(lt_color, "compartment"); + Formula form; + form.AddText(&color, true); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + + ret.linecolor = style["compartment-border-color"]; + string linecolor = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeColor(doc); + if (linecolor != ret.linecolor) { + ret.linecolor = linecolor; + LayoutWrapper* lw = new LayoutWrapper(lt_linecolor, "compartment"); + Formula form; + form.AddText(&linecolor, true); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + + ret.linewidth = atof(style["compartment-border-width"].c_str()); + double linewidth = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeWidth(doc); + if (linewidth != ret.linewidth) { + ret.linewidth = linewidth; + LayoutWrapper* lw = new LayoutWrapper(lt_linewidth, "compartment"); + Formula form; + form.AddNum(linewidth); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + + ret.font = "sans-serif"; // style["compartment-font-style"]; + string font = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontFamily(doc); + if (font != ret.font) { + ret.font = font; + LayoutWrapper* lw = new LayoutWrapper(lt_font, "compartment"); + Formula form; + form.AddText(&font, true); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + + ret.fontcolor = style["compartment-font-color"]; + string fontcolor = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontColor(doc); + if (fontcolor != ret.fontcolor) { + ret.fontcolor = fontcolor; + LayoutWrapper* lw = new LayoutWrapper(lt_fontcolor, "compartment"); + Formula form; + form.AddText(&fontcolor, true); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + + ret.fontsize = atof(style["compartment-font-size"].c_str()); + double fontsize = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontSizeAsDouble(doc); + if (fontsize != ret.fontsize) { + ret.fontsize = fontsize; + LayoutWrapper* lw = new LayoutWrapper(lt_fontsize, "compartment"); + Formula form; + form.AddNum(fontsize); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + + ret.fontstyle = getFontStyleFrom(style["compartment-font-style"], style["compartment-font-weight"]); + string fontstyle = getFontStyleFrom(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontStyle(doc), LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontWeight(doc)); + if (fontstyle != ret.fontstyle) { + ret.fontstyle = fontstyle; + LayoutWrapper* lw = new LayoutWrapper(lt_fontstyle, "compartment"); + Formula form; + form.AddText(&fontstyle, true); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + + ret.shape = style["compartment-geometric-shape"]; + string shape = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentGeometricShapeType(doc); + if (shape != ret.shape) { + ret.shape = shape; + LayoutWrapper* lw = new LayoutWrapper(lt_shape, "compartment"); + Formula form; + form.AddText(&shape, true); + lw->SetFormula(&form); + compartmentLayouts.push_back(lw); + } + return ret; + + //{ "compartment-border-radius-x", "25" }, + //{ "compartment-border-radius-y", "25" }, + //{ "compartment-text-horizontal-alignment", "middle" }, + //{ "compartment-text-vertical-alignment", "bottom" }, } -layoutInfo getDefaultCompartmentLayoutInfo() +layoutInfo getDefaultReactionLayoutInfo(map style, std::vector& reactionLayouts, SBMLDocument* doc) { - layoutInfo ret = getDefaultLayoutInfo(); - ret.fontsize = 10; - ret.color = "lightgray"; - ret.linecolor = "darkcyan"; - ret.fontcolor = "darkcyan"; + layoutInfo ret; + + ret.color = "white"; //LS DEBUG style["reaction-fill-color"]; + string color = LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFillColor(doc); + if (color != ret.color) { + ret.color = color; + LayoutWrapper* lw = new LayoutWrapper(lt_color, "reaction"); + Formula form; + form.AddText(&color, true); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } + + ret.linecolor = style["reaction-line-color"]; + string linecolor = LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeColor(doc); + if (linecolor != ret.linecolor) { + ret.linecolor = linecolor; + LayoutWrapper* lw = new LayoutWrapper(lt_linecolor, "reaction"); + Formula form; + form.AddText(&linecolor, true); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } + + ret.linewidth = atof(style["reaction-line-width"].c_str()); + double linewidth = LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeWidth(doc); + if (linewidth != ret.linewidth) { + ret.linewidth = linewidth; + LayoutWrapper* lw = new LayoutWrapper(lt_linewidth, "reaction"); + Formula form; + form.AddNum(linewidth); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } + + ret.font = "sans-serif"; // style["reaction-font-style"]; + string font = LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontFamily(doc); + if (font != ret.font) { + ret.font = font; + LayoutWrapper* lw = new LayoutWrapper(lt_font, "reaction"); + Formula form; + form.AddText(&font, true); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } + + ret.fontcolor = style["reaction-font-color"]; + string fontcolor = LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontColor(doc); + if (fontcolor != ret.fontcolor) { + ret.fontcolor = fontcolor; + LayoutWrapper* lw = new LayoutWrapper(lt_fontcolor, "reaction"); + Formula form; + form.AddText(&fontcolor, true); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } + + ret.fontsize = atof(style["reaction-font-size"].c_str()); + double fontsize = LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontSizeAsDouble(doc); + if (fontsize != ret.fontsize) { + ret.fontsize = fontsize; + LayoutWrapper* lw = new LayoutWrapper(lt_fontsize, "reaction"); + Formula form; + form.AddNum(fontsize); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } + + ret.fontstyle = getFontStyleFrom(style["reaction-font-style"], style["reaction-font-weight"]); + string fontstyle = getFontStyleFrom(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontStyle(doc), LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontWeight(doc)); + if (fontstyle != ret.fontstyle) { + ret.fontstyle = fontstyle; + LayoutWrapper* lw = new LayoutWrapper(lt_fontstyle, "reaction"); + Formula form; + form.AddText(&fontstyle, true); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } + + ret.shape = "ellipse"; //LS DEBUG: style["reaction-geometric-shape"]; + string shape = LIBSBMLNETWORK_CPP_NAMESPACE::getReactionGeometricShapeType(doc); + if (shape != ret.shape) { + ret.shape = shape; + LayoutWrapper* lw = new LayoutWrapper(lt_shape, "reaction"); + Formula form; + form.AddText(&shape, true); + lw->SetFormula(&form); + reactionLayouts.push_back(lw); + } return ret; } -layoutInfo getDefaultReactionLayoutInfo() +string convertColorIfNeeded(string sval, SBMLDocument* doc) { - layoutInfo ret = getDefaultLayoutInfo(); - ret.fontsize = 12; - ret.fontcolor = "darkslategray"; - ret.shape = "ellipse"; - return ret; + if (sval.empty() || sval[0] == '#' || LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(sval)) { + return sval; + } + ColorDefinition* cd = LIBSBMLNETWORK_CPP_NAMESPACE::getColorDefinition(doc, sval); + if (cd) { + return cd->getValue(); + } + if (sval == "none") { + return ""; + } + assert(false); + return sval; } + void Module::LoadLayout(Model* sbml) { const LayoutModelPlugin* lplugin = static_cast(sbml->getPlugin("layout")); @@ -3200,21 +3482,29 @@ void Module::LoadLayout(Model* sbml) m_autolayout.use = true; //Use SBMLNetwork to read stuff instead of reading from the document directly. SBMLDocument* doc = sbml->getSBMLDocument(); - layoutInfo gendefault = getDefaultLayoutInfo(); m_layout.height = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc); m_layout.width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc); + //Get default style and more-specific style + map default_style = LIBSBMLNETWORK_CPP_NAMESPACE::getPredefinedStyleFeatures("default"); + string style = "default"; //LS DEBUG: change to getDefaultStyle when Adel implements that. + map new_style = LIBSBMLNETWORK_CPP_NAMESPACE::getPredefinedStyleFeatures(style); + if (style != "default") { + m_layout.style = style; + } + new_style.insert(default_style.begin(), default_style.end()); + //Background color string background = LIBSBMLNETWORK_CPP_NAMESPACE::getBackgroundColor(doc); - if (background != gendefault.color) { + if (background != new_style["background-color"]) { m_layout.background = background; } //LS DEBUG: Figure out how to get the style, and to get the general defaults map defaults; - defaults[varSpeciesUndef] = getDefaultSpeciesLayoutInfo(); - defaults[varReactionUndef] = getDefaultReactionLayoutInfo(); - defaults[varCompartment] = getDefaultCompartmentLayoutInfo(); + defaults[varSpeciesUndef] = getDefaultSpeciesLayoutInfo(new_style, m_speciesLayouts, doc); + defaults[varReactionUndef] = getDefaultReactionLayoutInfo(new_style, m_reactionLayouts, doc); + defaults[varCompartment] = getDefaultCompartmentLayoutInfo(new_style, m_compartmentLayouts, doc); Formula form; for (size_t v = 0; v < m_variables.size(); v++) { @@ -3289,6 +3579,7 @@ void Module::LoadLayout(Model* sbml) // Fill color sval = LIBSBMLNETWORK_CPP_NAMESPACE::getFillColor(doc, varid); + sval = convertColorIfNeeded(sval, doc); if (!sval.empty() && sval != defaults[type].color) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_color); form.AddText(&sval, true); @@ -3298,6 +3589,7 @@ void Module::LoadLayout(Model* sbml) // Line color sval = LIBSBMLNETWORK_CPP_NAMESPACE::getStrokeColor(doc, varid); + sval = convertColorIfNeeded(sval, doc); if (!sval.empty() && sval != defaults[type].linecolor) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_linecolor); form.AddText(&sval, true); @@ -3325,6 +3617,7 @@ void Module::LoadLayout(Model* sbml) // Font color sval = LIBSBMLNETWORK_CPP_NAMESPACE::getFontColor(doc, varid); + sval = convertColorIfNeeded(sval, doc); if (!sval.empty() && sval != defaults[type].fontcolor) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontcolor); form.AddText(&sval, true); @@ -3333,25 +3626,16 @@ void Module::LoadLayout(Model* sbml) } // Font size - //val = LIBSBMLNETWORK_CPP_NAMESPACE::getFontSize(doc, varid); - //if (val && val != defaults[type].fontsize) { - // LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontsize); - // form.AddNum(val); - // lw->SetFormula(&form); - // form.Clear(); - //} + val = LIBSBMLNETWORK_CPP_NAMESPACE::getFontSizeAsDouble(doc, varid); + if (val && val != defaults[type].fontsize) { + LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontsize); + form.AddNum(val); + lw->SetFormula(&form); + form.Clear(); + } // Font style - sval = LIBSBMLNETWORK_CPP_NAMESPACE::getFontStyle(doc, varid); - string isbold = LIBSBMLNETWORK_CPP_NAMESPACE::getFontWeight(doc, varid); - if (isbold == "bold") { - if (sval == "italic") { - sval = "bold_italic"; - } - else { - sval = "bold"; - } - } + sval = getFontStyleFrom(LIBSBMLNETWORK_CPP_NAMESPACE::getFontStyle(doc, varid), LIBSBMLNETWORK_CPP_NAMESPACE::getFontWeight(doc, varid)); if (!sval.empty() && sval != defaults[type].fontstyle) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontstyle); form.AddText(&sval, true); diff --git a/src/module.cpp b/src/module.cpp index 5e0261c4..a8678eeb 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -2393,8 +2393,6 @@ string Module::GetAntimony(set& usedmods, bool funcsincluded, boo } if (m_autolayout.use) { - retval += "\n"; - retval += GetAntimonyAutolayout(indent); retval += "\n"; retval += GetAntimonyGeneralLayout(indent); retval += "\n"; @@ -3658,10 +3656,21 @@ string Module::ValidateLayoutArgument(const string* argument) return "none"; } -string Module::GetAntimonyAutolayout(const string& indent) const +string getSetString(set list) +{ + string ret = "{"; + for (auto li = list.begin(); li != list.end(); li++) { + ret += " " + *li + ","; + } + ret[ret.size() - 1] = ' '; + ret += "}"; + return ret; +} + +string Module::GetAntimonyGeneralLayout(const string& indent) const { stringstream ret; - ret << indent << "# Autolayout options" << endl; + ret << indent << "# General layout options" << endl; ret << indent << "model.layout = on" << endl; //if (m_autolayout.stiffness != 10) { // ret << indent << "model.autolayout.stiffness = " << m_autolayout.stiffness << endl; @@ -3685,25 +3694,6 @@ string Module::GetAntimonyAutolayout(const string& indent) const ret << indent << "model.autolayout.useNameAsTextLabel = off" << endl; } - - return ret.str(); -} - -string getSetString(set list) -{ - string ret = "{"; - for (auto li = list.begin(); li != list.end(); li++) { - ret += " " + *li + ","; - } - ret[ret.size() - 1] = ' '; - ret += "}"; - return ret; -} - -string Module::GetAntimonyGeneralLayout(const string& indent) const -{ - stringstream ret; - ret << indent << "# General layout defaults" << endl; if (m_layout.height || m_layout.width) { ret << indent << "model.layout.size = {" << m_layout.width << ", " << m_layout.height << "}" << endl; } @@ -3754,12 +3744,6 @@ string Module::GetAntimonyGeneralLayout(const string& indent) const std::string Module::GetAntimonyTypeLayouts(const std::string& indent) const { string ret = ""; - if (m_compartmentLayouts.size()) { - ret += indent + "// Compartment layout defaults\n"; - for (size_t c = 0; c < m_compartmentLayouts.size(); c++) { - ret += m_compartmentLayouts[c]->CreateLayoutParamsAntimonySyntax(indent); - } - } if (m_speciesLayouts.size()) { ret += indent + "// Species layout defaults\n"; for (size_t s = 0; s < m_speciesLayouts.size(); s++) { @@ -3767,10 +3751,25 @@ std::string Module::GetAntimonyTypeLayouts(const std::string& indent) const } } if (m_reactionLayouts.size()) { + if (!ret.empty()) { + ret += "\n"; + } ret += indent + "// Reaction layout defaults\n"; for (size_t r = 0; r < m_reactionLayouts.size(); r++) { ret += m_reactionLayouts[r]->CreateLayoutParamsAntimonySyntax(indent); } } - return std::string(); + if (m_compartmentLayouts.size()) { + if (!ret.empty()) { + ret += "\n"; + } + ret += indent + "// Compartment layout defaults\n"; + for (size_t c = 0; c < m_compartmentLayouts.size(); c++) { + ret += m_compartmentLayouts[c]->CreateLayoutParamsAntimonySyntax(indent); + } + } + if (!ret.empty()) { + ret += "\n"; + } + return ret; } diff --git a/src/module.h b/src/module.h index fc332441..2246c2c4 100644 --- a/src/module.h +++ b/src/module.h @@ -340,7 +340,6 @@ class Module : public Annotated void UpdateRateOf(libsbml::Model* model); std::string ValidateAutoLayoutArgument(const std::string* argument); std::string ValidateLayoutArgument(const std::string* argument); - std::string GetAntimonyAutolayout(const std::string& indent) const; std::string GetAntimonyGeneralLayout(const std::string& indent) const; std::string GetAntimonyTypeLayouts(const std::string& indent) const; void LoadLayout(libsbml::Model* sbml); From 0c35796c69e6f38a60553d2f753ef70d53f77ad9 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 23 Aug 2024 18:02:47 -0700 Subject: [PATCH 27/43] Update version number to 3.0 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4454fe80..c5811707 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ project(libantimony) # # Set up version information. # -SET(LIBANTIMONY_VERSION_MAJOR 2) -SET(LIBANTIMONY_VERSION_MINOR 15) +SET(LIBANTIMONY_VERSION_MAJOR 3) +SET(LIBANTIMONY_VERSION_MINOR 0) SET(LIBANTIMONY_VERSION_PATCH ".0") SET(LIBANTIMONY_VERSION_RELEASE "") From c6b2a2241506075121d885c02ad56d1109a14649 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 23 Aug 2024 18:09:24 -0700 Subject: [PATCH 28/43] Get SBMLNetwork update. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aca70c67..8b1a33dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.2" ] + libroadrunner_deps_release_version: [ "v2.2.1" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} From 83518ceea15dca23faaf0cdec766d68304071cf5 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Fri, 23 Aug 2024 18:13:38 -0700 Subject: [PATCH 29/43] Update tests to v3.0.0 --- src/test/test-data/BIOMD0000000118.txt | 2 +- src/test/test-data/BIOMD0000000696.txt | 2 +- src/test/test-data/SBO_compartment_rt.txt | 2 +- src/test/test-data/SBO_event_rt.txt | 2 +- src/test/test-data/SBO_function_rt.txt | 2 +- src/test/test-data/SBO_localvar_rt.txt | 2 +- src/test/test-data/SBO_module_rt.txt | 2 +- src/test/test-data/SBO_param2_rt.txt | 2 +- src/test/test-data/SBO_param_rt.txt | 2 +- src/test/test-data/SBO_reaction_rt.txt | 2 +- src/test/test-data/SBO_species_rt.txt | 2 +- src/test/test-data/SBO_submodel_rt.txt | 2 +- src/test/test-data/SBO_submodel_shadowed_rt.txt | 2 +- src/test/test-data/algrule_id_rt.txt | 2 +- src/test/test-data/algrule_idname_rt.txt | 2 +- src/test/test-data/algrule_rt.txt | 2 +- src/test/test-data/autopromoted_units_rt.txt | 2 +- src/test/test-data/coefficientOfVariation_rt.txt | 2 +- src/test/test-data/confidenceInterval_rt.txt | 2 +- src/test/test-data/created_element_rt.txt | 2 +- src/test/test-data/created_model_parts_rt.txt | 2 +- src/test/test-data/created_model_rt.txt | 2 +- src/test/test-data/creator_blank_model_rt.txt | 2 +- src/test/test-data/creator_one_element_rt.txt | 2 +- src/test/test-data/creator_one_model_rt.txt | 2 +- src/test/test-data/creator_two_model_rt.txt | 2 +- src/test/test-data/credibleInterval_rt.txt | 2 +- src/test/test-data/default_compartment.txt | 2 +- src/test/test-data/distribution_rt.txt | 2 +- src/test/test-data/encodes_rt.txt | 2 +- src/test/test-data/externalParameter1_rt.txt | 2 +- src/test/test-data/externalParameter2_rt.txt | 2 +- src/test/test-data/externalParameter3_rt.txt | 2 +- src/test/test-data/from-libsbml/CompTest.txt | 2 +- src/test/test-data/from-libsbml/QTPop.txt | 2 +- src/test/test-data/from-libsbml/comp.txt | 2 +- src/test/test-data/from-libsbml/exchangetest.txt | 2 +- .../test-data/from-libsbml/replace_rules_and_constraints.txt | 2 +- src/test/test-data/from-libsbml/test22.txt | 2 +- src/test/test-data/from-libsbml/test23.txt | 2 +- src/test/test-data/from-libsbml/test24.txt | 2 +- src/test/test-data/from-libsbml/test25.txt | 2 +- src/test/test-data/from-libsbml/test27.txt | 2 +- src/test/test-data/from-libsbml/test28.txt | 2 +- src/test/test-data/from-libsbml/test39.txt | 2 +- src/test/test-data/from-libsbml/test44.txt | 2 +- src/test/test-data/from-libsbml/test45.txt | 2 +- src/test/test-data/from-libsbml/test46.txt | 2 +- src/test/test-data/from-libsbml/test47.txt | 2 +- src/test/test-data/from-libsbml/test48.txt | 2 +- src/test/test-data/from-libsbml/test54.txt | 2 +- src/test/test-data/from-libsbml/test58.txt | 2 +- src/test/test-data/from-libsbml/test59.txt | 2 +- src/test/test-data/from-libsbml/test61.txt | 2 +- src/test/test-data/function_name_rt.txt | 2 +- src/test/test-data/hasPart_rt.txt | 2 +- src/test/test-data/hasProperty_rt.txt | 2 +- src/test/test-data/hasTaxon_rt.txt | 2 +- src/test/test-data/hasVersion_rt.txt | 2 +- src/test/test-data/identity_rt.txt | 2 +- src/test/test-data/interquartileRange_rt.txt | 2 +- src/test/test-data/isDescribedBy_rt.txt | 2 +- src/test/test-data/isEncodedBy_rt.txt | 2 +- src/test/test-data/isHomologTo_rt.txt | 2 +- src/test/test-data/isPartOf_rt.txt | 2 +- src/test/test-data/isPropertyOf_rt.txt | 2 +- src/test/test-data/isVersionOf_rt.txt | 2 +- src/test/test-data/kurtosis_rt.txt | 2 +- src/test/test-data/mean_rt.txt | 2 +- src/test/test-data/median_rt.txt | 2 +- src/test/test-data/mode_rt.txt | 2 +- src/test/test-data/modified_element_rt.txt | 2 +- src/test/test-data/modified_model_parts_rt.txt | 2 +- src/test/test-data/modified_model_rt.txt | 2 +- src/test/test-data/module_name_rt.txt | 2 +- src/test/test-data/namedstoich_assignment_rt.txt | 2 +- src/test/test-data/namedstoich_basic_rt.txt | 2 +- src/test/test-data/namedstoich_rate_rt.txt | 2 +- src/test/test-data/namedstoich_value_rt.txt | 2 +- src/test/test-data/negparen_rt.txt | 2 +- src/test/test-data/notes_element_noxml_rt.txt | 2 +- src/test/test-data/notes_element_xml_rt.txt | 2 +- src/test/test-data/notes_model_noxml_rt.txt | 2 +- src/test/test-data/notes_model_xml_internal_rt.txt | 2 +- src/test/test-data/notes_model_xml_rt.txt | 2 +- src/test/test-data/occursIn_rt.txt | 2 +- src/test/test-data/range_rt.txt | 2 +- src/test/test-data/same_unit_name.txt | 2 +- src/test/test-data/sampleSize_rt.txt | 2 +- src/test/test-data/skewness_rt.txt | 2 +- src/test/test-data/standardDeviation_rt.txt | 2 +- src/test/test-data/standardError_rt.txt | 2 +- src/test/test-data/variance_rt.txt | 2 +- src/test/test-data/volume.txt | 2 +- 94 files changed, 94 insertions(+), 94 deletions(-) diff --git a/src/test/test-data/BIOMD0000000118.txt b/src/test/test-data/BIOMD0000000118.txt index 8b19950a..1a305efb 100644 --- a/src/test/test-data/BIOMD0000000118.txt +++ b/src/test/test-data/BIOMD0000000118.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 function GAMMA(VV, theta, sigma) 1/(1 + exp(-(VV - theta)/sigma)); end diff --git a/src/test/test-data/BIOMD0000000696.txt b/src/test/test-data/BIOMD0000000696.txt index ba00a07b..cd7901a4 100644 --- a/src/test/test-data/BIOMD0000000696.txt +++ b/src/test/test-data/BIOMD0000000696.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *Boada2016___Incoherent_type_1_feed_forward_loop__I1_FFL() // Compartments and Species: diff --git a/src/test/test-data/SBO_compartment_rt.txt b/src/test/test-data/SBO_compartment_rt.txt index bfcf1567..c3e5c54d 100644 --- a/src/test/test-data/SBO_compartment_rt.txt +++ b/src/test/test-data/SBO_compartment_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Compartments and Species: compartment a; diff --git a/src/test/test-data/SBO_event_rt.txt b/src/test/test-data/SBO_event_rt.txt index 8910d8b7..0711b5c8 100644 --- a/src/test/test-data/SBO_event_rt.txt +++ b/src/test/test-data/SBO_event_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Events: E0: at time > 3: b = 4; diff --git a/src/test/test-data/SBO_function_rt.txt b/src/test/test-data/SBO_function_rt.txt index 9cef8757..c81d8ec7 100644 --- a/src/test/test-data/SBO_function_rt.txt +++ b/src/test/test-data/SBO_function_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 function foo() 3; end diff --git a/src/test/test-data/SBO_localvar_rt.txt b/src/test/test-data/SBO_localvar_rt.txt index 965624b0..e97d47a5 100644 --- a/src/test/test-data/SBO_localvar_rt.txt +++ b/src/test/test-data/SBO_localvar_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/SBO_module_rt.txt b/src/test/test-data/SBO_module_rt.txt index d22b3946..df2beb4c 100644 --- a/src/test/test-data/SBO_module_rt.txt +++ b/src/test/test-data/SBO_module_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() end diff --git a/src/test/test-data/SBO_param2_rt.txt b/src/test/test-data/SBO_param2_rt.txt index 8467aa81..c9d75e51 100644 --- a/src/test/test-data/SBO_param2_rt.txt +++ b/src/test/test-data/SBO_param2_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/SBO_param_rt.txt b/src/test/test-data/SBO_param_rt.txt index 8b642efa..9094ca34 100644 --- a/src/test/test-data/SBO_param_rt.txt +++ b/src/test/test-data/SBO_param_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/SBO_reaction_rt.txt b/src/test/test-data/SBO_reaction_rt.txt index 3ebf09a5..025bc158 100644 --- a/src/test/test-data/SBO_reaction_rt.txt +++ b/src/test/test-data/SBO_reaction_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Compartments and Species: species A; diff --git a/src/test/test-data/SBO_species_rt.txt b/src/test/test-data/SBO_species_rt.txt index b05e266f..cfe6d3dc 100644 --- a/src/test/test-data/SBO_species_rt.txt +++ b/src/test/test-data/SBO_species_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Compartments and Species: species a; diff --git a/src/test/test-data/SBO_submodel_rt.txt b/src/test/test-data/SBO_submodel_rt.txt index 8f089c16..3cf0055d 100644 --- a/src/test/test-data/SBO_submodel_rt.txt +++ b/src/test/test-data/SBO_submodel_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model foo() end diff --git a/src/test/test-data/SBO_submodel_shadowed_rt.txt b/src/test/test-data/SBO_submodel_shadowed_rt.txt index 370ee915..f82cbe0d 100644 --- a/src/test/test-data/SBO_submodel_shadowed_rt.txt +++ b/src/test/test-data/SBO_submodel_shadowed_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model foo() // Variable initializations: diff --git a/src/test/test-data/algrule_id_rt.txt b/src/test/test-data/algrule_id_rt.txt index 8040f1a4..1b2cbb5f 100644 --- a/src/test/test-data/algrule_id_rt.txt +++ b/src/test/test-data/algrule_id_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Algebraic Rules: alg1: 0 = x - 2; diff --git a/src/test/test-data/algrule_idname_rt.txt b/src/test/test-data/algrule_idname_rt.txt index 0b7f48e2..86a55710 100644 --- a/src/test/test-data/algrule_idname_rt.txt +++ b/src/test/test-data/algrule_idname_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Algebraic Rules: alg1: 0 = x - 2; diff --git a/src/test/test-data/algrule_rt.txt b/src/test/test-data/algrule_rt.txt index d888c70b..8451a531 100644 --- a/src/test/test-data/algrule_rt.txt +++ b/src/test/test-data/algrule_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Algebraic Rules: _alg0: 0 = x - 2; diff --git a/src/test/test-data/autopromoted_units_rt.txt b/src/test/test-data/autopromoted_units_rt.txt index fe276d28..c18f5b52 100644 --- a/src/test/test-data/autopromoted_units_rt.txt +++ b/src/test/test-data/autopromoted_units_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model foo(p) // Variable initializations: diff --git a/src/test/test-data/coefficientOfVariation_rt.txt b/src/test/test-data/coefficientOfVariation_rt.txt index ece5305a..6130ca50 100644 --- a/src/test/test-data/coefficientOfVariation_rt.txt +++ b/src/test/test-data/coefficientOfVariation_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/confidenceInterval_rt.txt b/src/test/test-data/confidenceInterval_rt.txt index 4c262e96..870c1898 100644 --- a/src/test/test-data/confidenceInterval_rt.txt +++ b/src/test/test-data/confidenceInterval_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/created_element_rt.txt b/src/test/test-data/created_element_rt.txt index 0a646001..24dd44c1 100644 --- a/src/test/test-data/created_element_rt.txt +++ b/src/test/test-data/created_element_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/created_model_parts_rt.txt b/src/test/test-data/created_model_parts_rt.txt index dc17d771..c8c19bde 100644 --- a/src/test/test-data/created_model_parts_rt.txt +++ b/src/test/test-data/created_model_parts_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/created_model_rt.txt b/src/test/test-data/created_model_rt.txt index dc17d771..c8c19bde 100644 --- a/src/test/test-data/created_model_rt.txt +++ b/src/test/test-data/created_model_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/creator_blank_model_rt.txt b/src/test/test-data/creator_blank_model_rt.txt index 06eab890..8414dc4c 100644 --- a/src/test/test-data/creator_blank_model_rt.txt +++ b/src/test/test-data/creator_blank_model_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/creator_one_element_rt.txt b/src/test/test-data/creator_one_element_rt.txt index c82f8368..86405255 100644 --- a/src/test/test-data/creator_one_element_rt.txt +++ b/src/test/test-data/creator_one_element_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/creator_one_model_rt.txt b/src/test/test-data/creator_one_model_rt.txt index 8015083b..ee9d5bea 100644 --- a/src/test/test-data/creator_one_model_rt.txt +++ b/src/test/test-data/creator_one_model_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/creator_two_model_rt.txt b/src/test/test-data/creator_two_model_rt.txt index ed8b01a2..f9d4b01b 100644 --- a/src/test/test-data/creator_two_model_rt.txt +++ b/src/test/test-data/creator_two_model_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/credibleInterval_rt.txt b/src/test/test-data/credibleInterval_rt.txt index b0e84bc1..2fbb0358 100644 --- a/src/test/test-data/credibleInterval_rt.txt +++ b/src/test/test-data/credibleInterval_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; x = ; diff --git a/src/test/test-data/default_compartment.txt b/src/test/test-data/default_compartment.txt index 3980c57d..96101d57 100644 --- a/src/test/test-data/default_compartment.txt +++ b/src/test/test-data/default_compartment.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *def_comp() // Compartments and Species: diff --git a/src/test/test-data/distribution_rt.txt b/src/test/test-data/distribution_rt.txt index 8a9caaaa..29cd415b 100644 --- a/src/test/test-data/distribution_rt.txt +++ b/src/test/test-data/distribution_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; x = ; diff --git a/src/test/test-data/encodes_rt.txt b/src/test/test-data/encodes_rt.txt index 8c4c3466..0d4b9387 100644 --- a/src/test/test-data/encodes_rt.txt +++ b/src/test/test-data/encodes_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/externalParameter1_rt.txt b/src/test/test-data/externalParameter1_rt.txt index 6014db5f..99726d00 100644 --- a/src/test/test-data/externalParameter1_rt.txt +++ b/src/test/test-data/externalParameter1_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/externalParameter2_rt.txt b/src/test/test-data/externalParameter2_rt.txt index 920c605d..8357f01b 100644 --- a/src/test/test-data/externalParameter2_rt.txt +++ b/src/test/test-data/externalParameter2_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; x = ; diff --git a/src/test/test-data/externalParameter3_rt.txt b/src/test/test-data/externalParameter3_rt.txt index 96a77a41..30073d6a 100644 --- a/src/test/test-data/externalParameter3_rt.txt +++ b/src/test/test-data/externalParameter3_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; x = ; diff --git a/src/test/test-data/from-libsbml/CompTest.txt b/src/test/test-data/from-libsbml/CompTest.txt index 026247dd..7d065bc1 100644 --- a/src/test/test-data/from-libsbml/CompTest.txt +++ b/src/test/test-data/from-libsbml/CompTest.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Warnings from automatic translation: // Unable to create port constraint__constraint0 in model CompModel because Constraint elements do not have IDs in SBML, and therefore cannot be made into ports in Antimony. diff --git a/src/test/test-data/from-libsbml/QTPop.txt b/src/test/test-data/from-libsbml/QTPop.txt index 8a10f0a1..7d5a7692 100644 --- a/src/test/test-data/from-libsbml/QTPop.txt +++ b/src/test/test-data/from-libsbml/QTPop.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 function get2DArrayElement(a, b, c) a; end diff --git a/src/test/test-data/from-libsbml/comp.txt b/src/test/test-data/from-libsbml/comp.txt index 9f42f59e..fdf91e25 100644 --- a/src/test/test-data/from-libsbml/comp.txt +++ b/src/test/test-data/from-libsbml/comp.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/exchangetest.txt b/src/test/test-data/from-libsbml/exchangetest.txt index 6fbd97d0..e9773d2d 100644 --- a/src/test/test-data/from-libsbml/exchangetest.txt +++ b/src/test/test-data/from-libsbml/exchangetest.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *testmod() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/replace_rules_and_constraints.txt b/src/test/test-data/from-libsbml/replace_rules_and_constraints.txt index 89a3f1d7..40792a52 100644 --- a/src/test/test-data/from-libsbml/replace_rules_and_constraints.txt +++ b/src/test/test-data/from-libsbml/replace_rules_and_constraints.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Warnings from automatic translation: // Unable to create port rule__iBioSim7 in model CompModel because RateRule elements only exist as part of other Antimony elements, and do not function as their own separate entities which may be flagged as a port. diff --git a/src/test/test-data/from-libsbml/test22.txt b/src/test/test-data/from-libsbml/test22.txt index f39e8276..2cd08987 100644 --- a/src/test/test-data/from-libsbml/test22.txt +++ b/src/test/test-data/from-libsbml/test22.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test23.txt b/src/test/test-data/from-libsbml/test23.txt index 08752ad4..948a7f50 100644 --- a/src/test/test-data/from-libsbml/test23.txt +++ b/src/test/test-data/from-libsbml/test23.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test24.txt b/src/test/test-data/from-libsbml/test24.txt index 2a318017..e00078e3 100644 --- a/src/test/test-data/from-libsbml/test24.txt +++ b/src/test/test-data/from-libsbml/test24.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test25.txt b/src/test/test-data/from-libsbml/test25.txt index bb1e98a4..06ca02f6 100644 --- a/src/test/test-data/from-libsbml/test25.txt +++ b/src/test/test-data/from-libsbml/test25.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test27.txt b/src/test/test-data/from-libsbml/test27.txt index 43e7b33c..f0e1d393 100644 --- a/src/test/test-data/from-libsbml/test27.txt +++ b/src/test/test-data/from-libsbml/test27.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Assignment Rules: diff --git a/src/test/test-data/from-libsbml/test28.txt b/src/test/test-data/from-libsbml/test28.txt index eb93a659..6ef9362f 100644 --- a/src/test/test-data/from-libsbml/test28.txt +++ b/src/test/test-data/from-libsbml/test28.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test39.txt b/src/test/test-data/from-libsbml/test39.txt index ad938430..e0aa7979 100644 --- a/src/test/test-data/from-libsbml/test39.txt +++ b/src/test/test-data/from-libsbml/test39.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test44.txt b/src/test/test-data/from-libsbml/test44.txt index 205cae2a..bf62ea95 100644 --- a/src/test/test-data/from-libsbml/test44.txt +++ b/src/test/test-data/from-libsbml/test44.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test45.txt b/src/test/test-data/from-libsbml/test45.txt index 359550e8..814b6230 100644 --- a/src/test/test-data/from-libsbml/test45.txt +++ b/src/test/test-data/from-libsbml/test45.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Rate Rules: diff --git a/src/test/test-data/from-libsbml/test46.txt b/src/test/test-data/from-libsbml/test46.txt index abc21468..8c1fdf4b 100644 --- a/src/test/test-data/from-libsbml/test46.txt +++ b/src/test/test-data/from-libsbml/test46.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test47.txt b/src/test/test-data/from-libsbml/test47.txt index 78fbfe00..0b512ce3 100644 --- a/src/test/test-data/from-libsbml/test47.txt +++ b/src/test/test-data/from-libsbml/test47.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test48.txt b/src/test/test-data/from-libsbml/test48.txt index 353ebd06..7e42cf77 100644 --- a/src/test/test-data/from-libsbml/test48.txt +++ b/src/test/test-data/from-libsbml/test48.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model moddef1() // Compartments and Species: diff --git a/src/test/test-data/from-libsbml/test54.txt b/src/test/test-data/from-libsbml/test54.txt index 168df5c8..ad07ac8d 100644 --- a/src/test/test-data/from-libsbml/test54.txt +++ b/src/test/test-data/from-libsbml/test54.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Warnings from automatic translation: // Unable to process deletion from submodel B in model baz. Deletions of Deletion elements have not been added as a concept in Antimony. diff --git a/src/test/test-data/from-libsbml/test58.txt b/src/test/test-data/from-libsbml/test58.txt index 6de80f75..11df0dbe 100644 --- a/src/test/test-data/from-libsbml/test58.txt +++ b/src/test/test-data/from-libsbml/test58.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Warnings from automatic translation: // Cannot replace stoichiometries in Antimony: all replacedElements and replacedBy children of z in reaction J2 will be ignored. diff --git a/src/test/test-data/from-libsbml/test59.txt b/src/test/test-data/from-libsbml/test59.txt index 01cb3d1a..a6cfa91b 100644 --- a/src/test/test-data/from-libsbml/test59.txt +++ b/src/test/test-data/from-libsbml/test59.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Warnings from automatic translation: // Cannot replace stoichiometries in Antimony: all replacedElements and replacedBy children of z in reaction J2 will be ignored. diff --git a/src/test/test-data/from-libsbml/test61.txt b/src/test/test-data/from-libsbml/test61.txt index 80efd40e..516306c4 100644 --- a/src/test/test-data/from-libsbml/test61.txt +++ b/src/test/test-data/from-libsbml/test61.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Warnings from automatic translation: // Cannot replace stoichiometries in Antimony: all replacedElements and replacedBy children of S1 in reaction R1 will be ignored. diff --git a/src/test/test-data/function_name_rt.txt b/src/test/test-data/function_name_rt.txt index 95f109b5..801c3314 100644 --- a/src/test/test-data/function_name_rt.txt +++ b/src/test/test-data/function_name_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 function foo() 3; end diff --git a/src/test/test-data/hasPart_rt.txt b/src/test/test-data/hasPart_rt.txt index 708dbaac..f38bfa71 100644 --- a/src/test/test-data/hasPart_rt.txt +++ b/src/test/test-data/hasPart_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/hasProperty_rt.txt b/src/test/test-data/hasProperty_rt.txt index 89558ca7..ec6416ec 100644 --- a/src/test/test-data/hasProperty_rt.txt +++ b/src/test/test-data/hasProperty_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/hasTaxon_rt.txt b/src/test/test-data/hasTaxon_rt.txt index 69aca9d9..0f503316 100644 --- a/src/test/test-data/hasTaxon_rt.txt +++ b/src/test/test-data/hasTaxon_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/hasVersion_rt.txt b/src/test/test-data/hasVersion_rt.txt index 9abf9423..7c03b277 100644 --- a/src/test/test-data/hasVersion_rt.txt +++ b/src/test/test-data/hasVersion_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/identity_rt.txt b/src/test/test-data/identity_rt.txt index d75a812b..9968c987 100644 --- a/src/test/test-data/identity_rt.txt +++ b/src/test/test-data/identity_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/interquartileRange_rt.txt b/src/test/test-data/interquartileRange_rt.txt index f407cba9..a15169e1 100644 --- a/src/test/test-data/interquartileRange_rt.txt +++ b/src/test/test-data/interquartileRange_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; x = ; diff --git a/src/test/test-data/isDescribedBy_rt.txt b/src/test/test-data/isDescribedBy_rt.txt index bb83ee8c..03964f3f 100644 --- a/src/test/test-data/isDescribedBy_rt.txt +++ b/src/test/test-data/isDescribedBy_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/isEncodedBy_rt.txt b/src/test/test-data/isEncodedBy_rt.txt index 61f646cf..1acdb509 100644 --- a/src/test/test-data/isEncodedBy_rt.txt +++ b/src/test/test-data/isEncodedBy_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/isHomologTo_rt.txt b/src/test/test-data/isHomologTo_rt.txt index 9310eabc..37042f6a 100644 --- a/src/test/test-data/isHomologTo_rt.txt +++ b/src/test/test-data/isHomologTo_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/isPartOf_rt.txt b/src/test/test-data/isPartOf_rt.txt index 7df39f3e..91ff47bf 100644 --- a/src/test/test-data/isPartOf_rt.txt +++ b/src/test/test-data/isPartOf_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/isPropertyOf_rt.txt b/src/test/test-data/isPropertyOf_rt.txt index 5d1cdd68..c59dd66c 100644 --- a/src/test/test-data/isPropertyOf_rt.txt +++ b/src/test/test-data/isPropertyOf_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/isVersionOf_rt.txt b/src/test/test-data/isVersionOf_rt.txt index 72bc9d78..1f650e5c 100644 --- a/src/test/test-data/isVersionOf_rt.txt +++ b/src/test/test-data/isVersionOf_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/kurtosis_rt.txt b/src/test/test-data/kurtosis_rt.txt index f5dd58f1..404c3293 100644 --- a/src/test/test-data/kurtosis_rt.txt +++ b/src/test/test-data/kurtosis_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/mean_rt.txt b/src/test/test-data/mean_rt.txt index 9c7dbafa..28e8ffae 100644 --- a/src/test/test-data/mean_rt.txt +++ b/src/test/test-data/mean_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/median_rt.txt b/src/test/test-data/median_rt.txt index a8298eb1..2e4bc3ff 100644 --- a/src/test/test-data/median_rt.txt +++ b/src/test/test-data/median_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/mode_rt.txt b/src/test/test-data/mode_rt.txt index a5867670..14245fef 100644 --- a/src/test/test-data/mode_rt.txt +++ b/src/test/test-data/mode_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/modified_element_rt.txt b/src/test/test-data/modified_element_rt.txt index 99bade4f..fdd61b42 100644 --- a/src/test/test-data/modified_element_rt.txt +++ b/src/test/test-data/modified_element_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/modified_model_parts_rt.txt b/src/test/test-data/modified_model_parts_rt.txt index 3ff85392..82924532 100644 --- a/src/test/test-data/modified_model_parts_rt.txt +++ b/src/test/test-data/modified_model_parts_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/modified_model_rt.txt b/src/test/test-data/modified_model_rt.txt index 3ff85392..82924532 100644 --- a/src/test/test-data/modified_model_rt.txt +++ b/src/test/test-data/modified_model_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/module_name_rt.txt b/src/test/test-data/module_name_rt.txt index 76b84be3..4aacc3fb 100644 --- a/src/test/test-data/module_name_rt.txt +++ b/src/test/test-data/module_name_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/namedstoich_assignment_rt.txt b/src/test/test-data/namedstoich_assignment_rt.txt index 44d659a6..1886adbf 100644 --- a/src/test/test-data/namedstoich_assignment_rt.txt +++ b/src/test/test-data/namedstoich_assignment_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Compartments and Species: species a; diff --git a/src/test/test-data/namedstoich_basic_rt.txt b/src/test/test-data/namedstoich_basic_rt.txt index 9fa3f7f4..ce389c53 100644 --- a/src/test/test-data/namedstoich_basic_rt.txt +++ b/src/test/test-data/namedstoich_basic_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Compartments and Species: species a; diff --git a/src/test/test-data/namedstoich_rate_rt.txt b/src/test/test-data/namedstoich_rate_rt.txt index d096db1b..cfab041b 100644 --- a/src/test/test-data/namedstoich_rate_rt.txt +++ b/src/test/test-data/namedstoich_rate_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Compartments and Species: species a; diff --git a/src/test/test-data/namedstoich_value_rt.txt b/src/test/test-data/namedstoich_value_rt.txt index e4559210..6176d196 100644 --- a/src/test/test-data/namedstoich_value_rt.txt +++ b/src/test/test-data/namedstoich_value_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Compartments and Species: species a; diff --git a/src/test/test-data/negparen_rt.txt b/src/test/test-data/negparen_rt.txt index 97fdbd24..094bde7a 100644 --- a/src/test/test-data/negparen_rt.txt +++ b/src/test/test-data/negparen_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = -(x + 2); x = ; diff --git a/src/test/test-data/notes_element_noxml_rt.txt b/src/test/test-data/notes_element_noxml_rt.txt index 99f0dec3..77fe0965 100644 --- a/src/test/test-data/notes_element_noxml_rt.txt +++ b/src/test/test-data/notes_element_noxml_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/notes_element_xml_rt.txt b/src/test/test-data/notes_element_xml_rt.txt index 2950affa..cef2d256 100644 --- a/src/test/test-data/notes_element_xml_rt.txt +++ b/src/test/test-data/notes_element_xml_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/notes_model_noxml_rt.txt b/src/test/test-data/notes_model_noxml_rt.txt index ddcb7b45..04e4a3b9 100644 --- a/src/test/test-data/notes_model_noxml_rt.txt +++ b/src/test/test-data/notes_model_noxml_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *foo() // Variable initializations: diff --git a/src/test/test-data/notes_model_xml_internal_rt.txt b/src/test/test-data/notes_model_xml_internal_rt.txt index ff12db49..e6ae1cde 100644 --- a/src/test/test-data/notes_model_xml_internal_rt.txt +++ b/src/test/test-data/notes_model_xml_internal_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *MorrisonAllegra() // Variable initializations: diff --git a/src/test/test-data/notes_model_xml_rt.txt b/src/test/test-data/notes_model_xml_rt.txt index 8b1ac7b9..19b9c42f 100644 --- a/src/test/test-data/notes_model_xml_rt.txt +++ b/src/test/test-data/notes_model_xml_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *MorrisonAllegra() // Variable initializations: diff --git a/src/test/test-data/occursIn_rt.txt b/src/test/test-data/occursIn_rt.txt index b016da03..b1be53af 100644 --- a/src/test/test-data/occursIn_rt.txt +++ b/src/test/test-data/occursIn_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = 3; diff --git a/src/test/test-data/range_rt.txt b/src/test/test-data/range_rt.txt index ba4632f0..a49f74af 100644 --- a/src/test/test-data/range_rt.txt +++ b/src/test/test-data/range_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/same_unit_name.txt b/src/test/test-data/same_unit_name.txt index 0adcabae..420f3649 100644 --- a/src/test/test-data/same_unit_name.txt +++ b/src/test/test-data/same_unit_name.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 model *same_units() // Variable initializations: diff --git a/src/test/test-data/sampleSize_rt.txt b/src/test/test-data/sampleSize_rt.txt index 2fe03860..fd9b9bbf 100644 --- a/src/test/test-data/sampleSize_rt.txt +++ b/src/test/test-data/sampleSize_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/skewness_rt.txt b/src/test/test-data/skewness_rt.txt index 7413d906..d25b2d2d 100644 --- a/src/test/test-data/skewness_rt.txt +++ b/src/test/test-data/skewness_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/standardDeviation_rt.txt b/src/test/test-data/standardDeviation_rt.txt index 5ca7f1c3..068e96f9 100644 --- a/src/test/test-data/standardDeviation_rt.txt +++ b/src/test/test-data/standardDeviation_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/standardError_rt.txt b/src/test/test-data/standardError_rt.txt index 6cbc1d99..e16fbd75 100644 --- a/src/test/test-data/standardError_rt.txt +++ b/src/test/test-data/standardError_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/variance_rt.txt b/src/test/test-data/variance_rt.txt index 6dc3baa3..8629f37f 100644 --- a/src/test/test-data/variance_rt.txt +++ b/src/test/test-data/variance_rt.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: a = ; diff --git a/src/test/test-data/volume.txt b/src/test/test-data/volume.txt index 7e8942d0..32c6b96c 100644 --- a/src/test/test-data/volume.txt +++ b/src/test/test-data/volume.txt @@ -1,4 +1,4 @@ -// Created by libAntimony v2.15.0 +// Created by libAntimony v3.0.0 // Variable initializations: volume_ = 1; A = volume_*5; From e14b5d6d7e396075c8169f527e4afd9ae58163da Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Mon, 26 Aug 2024 16:52:26 -0700 Subject: [PATCH 30/43] Several fixes: * Better handling of NaNs (ignore them more often) * Convert colors back to HTML names if necessary. * Check unset elements better. --- src/layoutWrapper.cpp | 5 +- src/module-sbml.cpp | 109 +++++++++++++++++++++++++----------------- 2 files changed, 69 insertions(+), 45 deletions(-) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index f3d9538e..5937c0ee 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -393,7 +393,10 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string } } else { - double lval = astn->getValue(); + double lval = util_NaN(); + if (astn) { + lval = astn->getValue(); + } int ret = 0; switch (m_layout_type) { case lt_position: diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index aed65e55..47b900f1 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -3164,6 +3164,34 @@ struct layoutInfo { string shape = ""; }; +string convertColorIfNeeded(string sval, SBMLDocument* doc) +{ + if (sval.empty()) { + return sval; + } + if (sval[0] != '#') { + if (LIBSBMLNETWORK_CPP_NAMESPACE::isValidColorValue(sval)) { + return sval; + } + ColorDefinition* cd = LIBSBMLNETWORK_CPP_NAMESPACE::getColorDefinition(doc, sval); + if (cd) { + sval = cd->getValue(); + } + } + if (sval[0] == '#') { + string cname = LIBSBMLNETWORK_CPP_NAMESPACE::getHtmlColorNameFromHexColorCode(sval); + if (!cname.empty()) { + return cname; + } + return sval; + } + if (sval == "none") { + return ""; + } + assert(false); + return sval; +} + layoutInfo getDefaultSpeciesLayoutInfo(map style, std::vector& speciesLayouts, SBMLDocument* doc) { layoutInfo ret; @@ -3172,7 +3200,8 @@ layoutInfo getDefaultSpeciesLayoutInfo(map style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vecto ret.color = style["compartment-fill-color"]; string color = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFillColor(doc); - if (color != ret.color) { + color = convertColorIfNeeded(color, doc); + if (!color.empty() && color != ret.color) { ret.color = color; LayoutWrapper* lw = new LayoutWrapper(lt_color, "compartment"); Formula form; @@ -3280,7 +3312,8 @@ layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vecto ret.linecolor = style["compartment-border-color"]; string linecolor = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeColor(doc); - if (linecolor != ret.linecolor) { + linecolor = convertColorIfNeeded(linecolor, doc); + if (!linecolor.empty() && linecolor != ret.linecolor) { ret.linecolor = linecolor; LayoutWrapper* lw = new LayoutWrapper(lt_linecolor, "compartment"); Formula form; @@ -3291,7 +3324,7 @@ layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vecto ret.linewidth = atof(style["compartment-border-width"].c_str()); double linewidth = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeWidth(doc); - if (linewidth != ret.linewidth) { + if (linewidth && !isnan(linewidth) && linewidth != ret.linewidth) { ret.linewidth = linewidth; LayoutWrapper* lw = new LayoutWrapper(lt_linewidth, "compartment"); Formula form; @@ -3302,7 +3335,7 @@ layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vecto ret.font = "sans-serif"; // style["compartment-font-style"]; string font = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontFamily(doc); - if (font != ret.font) { + if (!font.empty() && font != ret.font) { ret.font = font; LayoutWrapper* lw = new LayoutWrapper(lt_font, "compartment"); Formula form; @@ -3313,7 +3346,8 @@ layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vecto ret.fontcolor = style["compartment-font-color"]; string fontcolor = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontColor(doc); - if (fontcolor != ret.fontcolor) { + fontcolor = convertColorIfNeeded(fontcolor, doc); + if (!fontcolor.empty() && fontcolor != ret.fontcolor) { ret.fontcolor = fontcolor; LayoutWrapper* lw = new LayoutWrapper(lt_fontcolor, "compartment"); Formula form; @@ -3324,7 +3358,7 @@ layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vecto ret.fontsize = atof(style["compartment-font-size"].c_str()); double fontsize = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontSizeAsDouble(doc); - if (fontsize != ret.fontsize) { + if (fontsize && !isnan(fontsize) && fontsize != ret.fontsize) { ret.fontsize = fontsize; LayoutWrapper* lw = new LayoutWrapper(lt_fontsize, "compartment"); Formula form; @@ -3335,7 +3369,7 @@ layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vecto ret.fontstyle = getFontStyleFrom(style["compartment-font-style"], style["compartment-font-weight"]); string fontstyle = getFontStyleFrom(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontStyle(doc), LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontWeight(doc)); - if (fontstyle != ret.fontstyle) { + if (!fontstyle.empty() && fontstyle != ret.fontstyle) { ret.fontstyle = fontstyle; LayoutWrapper* lw = new LayoutWrapper(lt_fontstyle, "compartment"); Formula form; @@ -3346,7 +3380,7 @@ layoutInfo getDefaultCompartmentLayoutInfo(map style, std::vecto ret.shape = style["compartment-geometric-shape"]; string shape = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentGeometricShapeType(doc); - if (shape != ret.shape) { + if (!shape.empty() && shape != ret.shape) { ret.shape = shape; LayoutWrapper* lw = new LayoutWrapper(lt_shape, "compartment"); Formula form; @@ -3369,7 +3403,8 @@ layoutInfo getDefaultReactionLayoutInfo(map style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vector style, std::vectorgetValue(); - } - if (sval == "none") { - return ""; - } - assert(false); - return sval; -} - - void Module::LoadLayout(Model* sbml) { @@ -3496,6 +3516,7 @@ void Module::LoadLayout(Model* sbml) //Background color string background = LIBSBMLNETWORK_CPP_NAMESPACE::getBackgroundColor(doc); + background = convertColorIfNeeded(background, doc); if (background != new_style["background-color"]) { m_layout.background = background; } @@ -3562,7 +3583,7 @@ void Module::LoadLayout(Model* sbml) // Size val = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, varid); double valh = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, varid); - if ((val && val != defaults[type].width) || (valh && valh != defaults[type].height)) { + if ((val && !isnan(val) && !isnan(val) && val != defaults[type].width) || (valh && valh != defaults[type].height)) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_size); string text = "{"; form.AddText(&text, true); @@ -3599,7 +3620,7 @@ void Module::LoadLayout(Model* sbml) // Linewidth val = LIBSBMLNETWORK_CPP_NAMESPACE::getStrokeWidth(doc, varid); - if (val && val != defaults[type].linewidth) { + if (val && !isnan(val) && val != defaults[type].linewidth) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_linewidth); form.AddNum(val); lw->SetFormula(&form); @@ -3627,7 +3648,7 @@ void Module::LoadLayout(Model* sbml) // Font size val = LIBSBMLNETWORK_CPP_NAMESPACE::getFontSizeAsDouble(doc, varid); - if (val && val != defaults[type].fontsize) { + if (val && !isnan(val) && val != defaults[type].fontsize) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_fontsize); form.AddNum(val); lw->SetFormula(&form); From 46f8bee9df480e038cb175b8f539f745867fd775 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 27 Aug 2024 15:03:12 -0700 Subject: [PATCH 31/43] Update to latest SBMLNetwork. Mostly better handling of group defaults. --- .github/workflows/main.yml | 2 +- src/module-sbml.cpp | 14 ++++++++------ src/sbmlx.cpp | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b1a33dd..529ace82 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.2.1" ] + libroadrunner_deps_release_version: [ "v2.2.2" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 47b900f1..4705d7fb 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -3,6 +3,8 @@ #include "libsbmlnetwork_sbmldocument.h" #include "libsbmlnetwork_sbmldocument_layout.h" #include "libsbmlnetwork_sbmldocument_render.h" +#include "colors/libsbmlnetwork_colors.h" +#include "styles/libsbmlnetwork_styles.h" #include "sbml/packages/layout/extension/LayoutModelPlugin.h" using namespace libsbml; @@ -3233,7 +3235,7 @@ layoutInfo getDefaultSpeciesLayoutInfo(map style, std::vector style, std::vecto compartmentLayouts.push_back(lw); } - ret.font = "sans-serif"; // style["compartment-font-style"]; + ret.font = "sans-serif"; // style["compartment-font-family"]; string font = LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontFamily(doc); if (!font.empty() && font != ret.font) { ret.font = font; @@ -3401,7 +3403,7 @@ layoutInfo getDefaultReactionLayoutInfo(map style, std::vector style, std::vector style, std::vector default_style = LIBSBMLNETWORK_CPP_NAMESPACE::getPredefinedStyleFeatures("default"); - string style = "default"; //LS DEBUG: change to getDefaultStyle when Adel implements that. + string style = LIBSBMLNETWORK_CPP_NAMESPACE::getStyle(doc); map new_style = LIBSBMLNETWORK_CPP_NAMESPACE::getPredefinedStyleFeatures(style); if (style != "default") { m_layout.style = style; diff --git a/src/sbmlx.cpp b/src/sbmlx.cpp index 179992cc..43858716 100644 --- a/src/sbmlx.cpp +++ b/src/sbmlx.cpp @@ -7,6 +7,7 @@ #include "registry.h" #include "typex.h" #include +#include "colors/libsbmlnetwork_colors.h" using namespace std; using namespace libsbml; From 5ed2aac50e30f1965ccdf3c6a34f52d4e81000c3 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Thu, 29 Aug 2024 15:52:03 -0700 Subject: [PATCH 32/43] Better NaN protection; latest SBMLNetwork. --- .github/workflows/main.yml | 2 +- src/layoutWrapper.cpp | 16 ++++++++++++---- src/module-sbml.cpp | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 529ace82..54916746 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.2.2" ] + libroadrunner_deps_release_version: [ "v2.2.3" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 5937c0ee..5a865a58 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -265,12 +265,20 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const int ret2 = 0; switch (m_layout_type) { case lt_position: - ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, xval); - ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, yval); + if (!isnan(xval)) { + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, xval); + } + if (!isnan(yval)) { + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, yval); + } break; case lt_size: - ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, xval); - ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, yval); + if (!isnan(xval)) { + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, xval); + } + if (!isnan(yval)) { + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, yval); + } break; default: assert(false); //Only the above two are 'IsPair' true diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 4705d7fb..42d3520d 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -3567,7 +3567,7 @@ void Module::LoadLayout(Model* sbml) // Position val = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, varid); double valy = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, varid); - if (val || valy) { + if ((val || valy) && (!isnan(val) || !isnan(valy)) ) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_position); string text = "{"; form.AddText(&text, true); @@ -3585,7 +3585,7 @@ void Module::LoadLayout(Model* sbml) // Size val = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, varid); double valh = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, varid); - if ((val && !isnan(val) && !isnan(val) && val != defaults[type].width) || (valh && valh != defaults[type].height)) { + if (((val || valh) && (!isnan(val) || !isnan(valh)) && (val != defaults[type].width || valh != defaults[type].height))) { LayoutWrapper* lw = var->AddOrGetLayoutWrapper(lt_size); string text = "{"; form.AddText(&text, true); From f8bfae02bdb021f855b53878185aee73eb9e6783 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Sun, 1 Sep 2024 20:36:07 +0200 Subject: [PATCH 33/43] Update SBMLNetwork. Use new 'autorender' so we don't call autolayout twice. --- .github/workflows/main.yml | 2 +- src/layoutWrapper.cpp | 1 + src/module-sbml.cpp | 13 ++++++------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54916746..e3391454 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.2.3" ] + libroadrunner_deps_release_version: [ "v2.2.4" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 5a865a58..780e0633 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -694,6 +694,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string case lt_unknown: break; } + //assert(ret != -1); } diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 42d3520d..837cec98 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2450,7 +2450,7 @@ void Module::CreateSBMLModel(bool comp) // Layout/Render! if (m_autolayout.use) { - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true); // , m_autolayout.lockedNodeIds); + LIBSBMLNETWORK_CPP_NAMESPACE::autorender(&m_sbml);// , m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true); // , m_autolayout.lockedNodeIds); //For some reason, the following line is REQUIRED; otherwise I get linking errors(!) about how 'autolayout' is missing. WTF?? LS DEBUG LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); if (m_layout.width != 0) { @@ -2521,12 +2521,11 @@ void Module::CreateSBMLModel(bool comp) m_autolayout.lockedNodeIds.insert(m_layout.align_circular.begin(), m_layout.align_circular.end()); //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } - if (m_autolayout.lockedNodeIds.size() > 0) { - double S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); - S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); - S1x = S1x; - } + //double S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); + //S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); + //S1x = S1x; + } } From 51ba9348f7386e09d01957018ab8e63770035da6 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Wed, 11 Sep 2024 16:23:27 -0700 Subject: [PATCH 34/43] Fix memory leaks; handle empty styles. --- src/antimony_api.cpp | 2 +- src/layoutWrapper.cpp | 22 +++++++++++++--------- src/module-sbml.cpp | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/antimony_api.cpp b/src/antimony_api.cpp index 8321f504..1ba6fd2c 100644 --- a/src/antimony_api.cpp +++ b/src/antimony_api.cpp @@ -311,7 +311,7 @@ void LoadSBML(SBMLDocument* doc) SBMLConverter* converter = new SBMLFunctionDefinitionConverter(); converter->setDocument(doc); int cret = converter->convert(); - + delete converter; } #ifdef USE_COMP string mainsbmlname = getNameFromSBMLObject(doc->getModel(), "doc"); diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 780e0633..9e6f3882 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -120,14 +120,16 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) } else { string formstring = m_valFormula.ToSBMLString(); - ASTNode* astn = parseStringToASTNode(formstring); - double lval = util_NaN(); - if (astn) { - lval = astn->getValue(); + ASTNode* astn_ptr = parseStringToASTNode(formstring); + ASTNode astn; + if (astn_ptr) { + astn = *astn_ptr; } + delete astn_ptr; + double lval = astn.getValue(); string strval = ""; - if (astn && astn->getType() == AST_NAME) { - strval = astn->getName(); + if (astn.getType() == AST_NAME) { + strval = astn.getName(); } if (formula->IsOneComponent()) { vector varvec = formula->GetVariables(); @@ -143,7 +145,7 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) case lt_width: case lt_fontsize: case lt_linewidth: - if (astn == NULL || !astn->isNumber()) { + if (!astn.isNumber()) { g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to '" + formula->ToDelimitedStringWithEllipses(".") + "'. It may only be set to a numerical value."); return true; } @@ -364,7 +366,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const } } - + delete astn; return false; } @@ -397,6 +399,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string } if (ret1 == -1 || ret2 == -1) { g_registry.SetError(error); + delete astn; return true; } } @@ -412,6 +415,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string case lt_x: case lt_y: assert(false); + delete astn; return true; case lt_height: if (group == "species") { @@ -697,7 +701,7 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string //assert(ret != -1); } - + delete astn; return false; } diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 837cec98..a5bd83e5 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -3510,7 +3510,7 @@ void Module::LoadLayout(Model* sbml) map default_style = LIBSBMLNETWORK_CPP_NAMESPACE::getPredefinedStyleFeatures("default"); string style = LIBSBMLNETWORK_CPP_NAMESPACE::getStyle(doc); map new_style = LIBSBMLNETWORK_CPP_NAMESPACE::getPredefinedStyleFeatures(style); - if (style != "default") { + if (!style.empty() && style != "default") { m_layout.style = style; } new_style.insert(default_style.begin(), default_style.end()); From da5519cd10d8e9e4b51e2eee335ba87ac02528d2 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Wed, 11 Sep 2024 21:15:12 -0700 Subject: [PATCH 35/43] Fix another memory leak. --- src/module.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/module.cpp b/src/module.cpp index a8678eeb..fe462780 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -267,6 +267,18 @@ Module& Module::operator=(const Module& src) Module::~Module() { + for (size_t l = 0; l < m_defaultLayouts.size(); l++) { + delete m_defaultLayouts[l]; + } + for (size_t l = 0; l < m_compartmentLayouts.size(); l++) { + delete m_compartmentLayouts[l]; + } + for (size_t l = 0; l < m_speciesLayouts.size(); l++) { + delete m_speciesLayouts[l]; + } + for (size_t l = 0; l < m_reactionLayouts.size(); l++) { + delete m_reactionLayouts[l]; + } } Variable* Module::AddOrFindVariable(const string* name) From 8f1a1f191c665c6f4e0742eccd9d23883c7f5ed4 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Mon, 16 Sep 2024 15:55:13 -0700 Subject: [PATCH 36/43] Free the user data that SBMLNetwork creates. --- src/module-sbml.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index a5bd83e5..5d8a4d96 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -1,5 +1,6 @@ #include "module.h" #include "sbml/Model.h" +#include "libsbmlnetwork_layout_helpers.h" #include "libsbmlnetwork_sbmldocument.h" #include "libsbmlnetwork_sbmldocument_layout.h" #include "libsbmlnetwork_sbmldocument_render.h" @@ -2526,6 +2527,8 @@ void Module::CreateSBMLModel(bool comp) //S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); //S1x = S1x; + LIBSBMLNETWORK_CPP_NAMESPACE::freeUserData(&m_sbml); + } } @@ -3499,7 +3502,7 @@ layoutInfo getDefaultReactionLayoutInfo(map style, std::vector(sbml->getPlugin("layout")); - if (lplugin != NULL) { + if (lplugin && lplugin->getNumLayouts() > 0) { m_autolayout.use = true; //Use SBMLNetwork to read stuff instead of reading from the document directly. SBMLDocument* doc = sbml->getSBMLDocument(); From 35bb780b298f60bb9ab40ed39fae0f8392f2f0fc Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 17 Sep 2024 11:50:09 -0700 Subject: [PATCH 37/43] Update libsbml and SBMLNetwork. Both have memory leak updates, and SBMLNetwork has efficiency updates. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3391454..7ef9312a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.2.4" ] + libroadrunner_deps_release_version: [ "v2.2.5" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} From 6076607ea95557f5c9091d4600403cc284292a9f Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 17 Sep 2024 12:25:07 -0700 Subject: [PATCH 38/43] Update to get SBMLNetwork color bug fix. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ef9312a..7beb7bfa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.2.5" ] + libroadrunner_deps_release_version: [ "v2.2.6" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} From f48bf90a71cf0bde80a06cb62acc1e10364659eb Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Wed, 18 Sep 2024 12:16:43 -0700 Subject: [PATCH 39/43] Explicitly call setX, etc. with 'false'. The default is now changed in SBMLNetwork, so we need to set it explicitly here so we don't re-call the autolayout algorithm all the time. Also, clear out some unused comments. --- src/layoutWrapper.cpp | 32 ++++++++++++++++---------------- src/module-sbml.cpp | 12 +----------- 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index 9e6f3882..dd860e41 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -268,18 +268,18 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const switch (m_layout_type) { case lt_position: if (!isnan(xval)) { - ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, xval); + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, xval, false); } if (!isnan(yval)) { - ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, yval); + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, yval, false); } break; case lt_size: if (!isnan(xval)) { - ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, xval); + ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, xval, false); } if (!isnan(yval)) { - ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, yval); + ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, yval, false); } break; default: @@ -304,16 +304,16 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml) const assert(false); //Should be IsPair, above break; case lt_x: - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionX(sbml, sid, lval, false); break; case lt_y: - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setPositionY(sbml, sid, lval, false); break; case lt_height: - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, sid, lval, false); break; case lt_width: - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, sid, lval, false); break; case lt_color: ret = LIBSBMLNETWORK_CPP_NAMESPACE::setFillColor(sbml, sid, formstring); @@ -419,17 +419,17 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string return true; case lt_height: if (group == "species") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, 0, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, 0, lval, false); } else if (group == "compartment") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, 0, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionHeight(sbml, 0, lval, false); } else if (group == "reaction") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, 0, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionHeight(sbml, 0, lval, false); } else if (group == "layout") { int zero = 0; - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, zero, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionHeight(sbml, lval); } else { assert(false); @@ -437,17 +437,17 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string break; case lt_width: if (group == "species") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, 0, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, 0, lval, false); } else if (group == "compartment") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, 0, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setCompartmentDimensionWidth(sbml, 0, lval, false); } else if (group == "reaction") { - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, 0, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setReactionDimensionWidth(sbml, 0, lval, false); } else if (group == "layout") { int zero = 0; - ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, zero, lval); + ret = LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionWidth(sbml, lval); } else { assert(false); diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index 5d8a4d96..b99c89f4 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2451,7 +2451,7 @@ void Module::CreateSBMLModel(bool comp) // Layout/Render! if (m_autolayout.use) { - LIBSBMLNETWORK_CPP_NAMESPACE::autorender(&m_sbml);// , m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true); // , m_autolayout.lockedNodeIds); + LIBSBMLNETWORK_CPP_NAMESPACE::autorender(&m_sbml);// , m_autolayout.maxNumConnectedEdges); //For some reason, the following line is REQUIRED; otherwise I get linking errors(!) about how 'autolayout' is missing. WTF?? LS DEBUG LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); if (m_layout.width != 0) { @@ -2463,9 +2463,6 @@ void Module::CreateSBMLModel(bool comp) if (m_layout.style != "") { LIBSBMLNETWORK_CPP_NAMESPACE::setStyle(&m_sbml, 0, m_layout.style); } - //if (m_layout.depth != 0) { - // LIBSBMLNETWORK_CPP_NAMESPACE::setDimensionDepth(m_layout.sbmllayout, m_layout.depth); - //} if (m_layout.background != "") { //The background name has already been validated when set. LIBSBMLNETWORK_CPP_NAMESPACE::setBackgroundColor(&m_sbml, m_layout.background); @@ -2490,37 +2487,30 @@ void Module::CreateSBMLModel(bool comp) if (m_layout.align_top.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top"); m_autolayout.lockedNodeIds.insert(m_layout.align_top.begin(), m_layout.align_top.end()); - //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_left.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_left, "left"); m_autolayout.lockedNodeIds.insert(m_layout.align_left.begin(), m_layout.align_left.end()); - //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_hCenter.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_hCenter, "hCenter"); m_autolayout.lockedNodeIds.insert(m_layout.align_hCenter.begin(), m_layout.align_hCenter.end()); - //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_vCenter.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_vCenter, "vCenter"); m_autolayout.lockedNodeIds.insert(m_layout.align_vCenter.begin(), m_layout.align_vCenter.end()); - //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_right.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_right, "right"); m_autolayout.lockedNodeIds.insert(m_layout.align_right.begin(), m_layout.align_right.end()); - //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_bottom.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_bottom, "bottom"); m_autolayout.lockedNodeIds.insert(m_layout.align_bottom.begin(), m_layout.align_bottom.end()); - //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } if (m_layout.align_circular.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_circular, "circular"); m_autolayout.lockedNodeIds.insert(m_layout.align_circular.begin(), m_layout.align_circular.end()); - //LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); } //double S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); From 64cd9442e69ac23f1e8e9f3947c3c09c75440804 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 24 Sep 2024 16:09:26 -0700 Subject: [PATCH 40/43] Adapt to new SBMLNetwork layout/align functions. The functions now allow you to deal with alias nodes. This is a first pass at that, that doesn't actually deal with alias nodes in the slightest, but at least continues to compile with the new version of the library. --- .github/workflows/main.yml | 2 +- src/module-sbml.cpp | 30 ++++++++++++------------ src/module.cpp | 47 +++++++++++++++++++++----------------- src/module.h | 18 +++++++-------- 4 files changed, 51 insertions(+), 46 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7beb7bfa..04d8e0f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -82,7 +82,7 @@ jobs: libroadrunner_deps_owner: [ "sys-bio" ] libroadrunner_deps_repo: [ "libroadrunner-deps" ] libroadrunner_deps_name: [ "libroadrunner-deps" ] - libroadrunner_deps_release_version: [ "v2.2.6" ] + libroadrunner_deps_release_version: [ "v2.2.7" ] python_version: [ "3.12" ] runs-on: ${{ matrix.platform.os_name }} diff --git a/src/module-sbml.cpp b/src/module-sbml.cpp index b99c89f4..ac31c466 100644 --- a/src/module-sbml.cpp +++ b/src/module-sbml.cpp @@ -2451,7 +2451,7 @@ void Module::CreateSBMLModel(bool comp) // Layout/Render! if (m_autolayout.use) { - LIBSBMLNETWORK_CPP_NAMESPACE::autorender(&m_sbml);// , m_autolayout.maxNumConnectedEdges); + LIBSBMLNETWORK_CPP_NAMESPACE::autorender(&m_sbml, m_autolayout.maxNumConnectedEdges); //For some reason, the following line is REQUIRED; otherwise I get linking errors(!) about how 'autolayout' is missing. WTF?? LS DEBUG LIBSBMLNETWORK_CPP_NAMESPACE::getSBMLObject(&m_sbml, "S1"); if (m_layout.width != 0) { @@ -2484,39 +2484,41 @@ void Module::CreateSBMLModel(bool comp) assert(false); } } + + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel); + + bool any_align = false; if (m_layout.align_top.size()) { - LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top"); - m_autolayout.lockedNodeIds.insert(m_layout.align_top.begin(), m_layout.align_top.end()); + LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_top, "top", false); + any_align = true; } if (m_layout.align_left.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_left, "left"); - m_autolayout.lockedNodeIds.insert(m_layout.align_left.begin(), m_layout.align_left.end()); + any_align = true; } if (m_layout.align_hCenter.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_hCenter, "hCenter"); - m_autolayout.lockedNodeIds.insert(m_layout.align_hCenter.begin(), m_layout.align_hCenter.end()); + any_align = true; } if (m_layout.align_vCenter.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_vCenter, "vCenter"); - m_autolayout.lockedNodeIds.insert(m_layout.align_vCenter.begin(), m_layout.align_vCenter.end()); + any_align = true; } if (m_layout.align_right.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_right, "right"); - m_autolayout.lockedNodeIds.insert(m_layout.align_right.begin(), m_layout.align_right.end()); + any_align = true; } if (m_layout.align_bottom.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_bottom, "bottom"); - m_autolayout.lockedNodeIds.insert(m_layout.align_bottom.begin(), m_layout.align_bottom.end()); + any_align = true; } if (m_layout.align_circular.size()) { LIBSBMLNETWORK_CPP_NAMESPACE::align(&m_sbml, m_layout.align_circular, "circular"); - m_autolayout.lockedNodeIds.insert(m_layout.align_circular.begin(), m_layout.align_circular.end()); + any_align = true; + } + if (any_align) { + LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel); } - //double S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); - LIBSBMLNETWORK_CPP_NAMESPACE::autolayout(&m_sbml, m_autolayout.maxNumConnectedEdges, m_autolayout.useNameAsTextLabel, true, m_autolayout.lockedNodeIds); - //S1x = LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(&m_sbml, "S1"); - //S1x = S1x; - LIBSBMLNETWORK_CPP_NAMESPACE::freeUserData(&m_sbml); } diff --git a/src/module.cpp b/src/module.cpp index fe462780..1a595639 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -1192,9 +1192,9 @@ string Module::GetVariableNameDelimitedBy(string cc) const return retval; } -vector getIntersection(set set1, set set2) +vector > getIntersection(set > set1, set > set2) { - vector overlap; + vector > overlap; for (auto s1 = set1.begin(); s1 != set1.end(); s1++) { if (set2.find(*s1) != set2.end()) { overlap.push_back(*s1); @@ -1203,9 +1203,9 @@ vector getIntersection(set set1, set set2) return overlap; } -bool checkOverlapAndInsert(set& fixed, set check, string label) +bool checkOverlapAndInsert(set >& fixed, set > check, string label) { - vector intersection = getIntersection(fixed, check); + vector > intersection = getIntersection(fixed, check); if (intersection.size() >= 2) { string err = "Unable to set the alignment " + label + " because only one element is allowed in an alignment whose position is already known. In addition, adding an element to an alignment then establishes that element's position, so two such elements cannot be used in another alignment. In this case, the positions of elements "; for (size_t i = 0; i < intersection.size(); i++) { @@ -1216,7 +1216,7 @@ bool checkOverlapAndInsert(set& fixed, set check, string label) err += "and "; } err += "'"; - err += intersection[i]; + err += intersection[i].first; err += "'"; } err += " are already known."; @@ -1328,7 +1328,7 @@ bool Module::Finalize() } //Now check if the layout align lists are OK, i.e. don't have 2+ already-fixed nodes in them. - set combo = m_autolayout.lockedNodeIds; + std::set > combo; if (checkOverlapAndInsert(combo, m_layout.align_top, "align_top")) { return true; } @@ -2949,11 +2949,6 @@ void Module::setUsedDistrib(bool useddistrib) m_usedDistributions = useddistrib; } -void Module::fixLayoutPositionOf(const std::string& id) -{ - m_autolayout.lockedNodeIds.insert(id); -} - void Module::Convert(Variable* conv, Variable* cf, string modulename) { Module* origmod = g_registry.GetModule(m_modulename); @@ -3267,7 +3262,6 @@ bool Module::SetAutoLayout(const std::string* argument, const std::vectorGetNameDelimitedBy(g_registry.GetCC()); ids.insert(id); } - m_autolayout.lockedNodeIds = ids; ret = false; } delete values; @@ -3456,10 +3450,10 @@ bool Module::SetLayout(const std::string* argument, const std::vector return true; } else if (type == "idlist") { - set ids; + set > ids; for (size_t i = 0; i < values->size(); i++) { string id = (*values)[i]->GetNameDelimitedBy(g_registry.GetCC()); - ids.insert(id); + ids.insert(make_pair(id, 0)); //m_autolayout.lockedNodeIds.insert(id); } if (CaselessStrCmp(true, *argument, "align_top")) { @@ -3668,15 +3662,26 @@ string Module::ValidateLayoutArgument(const string* argument) return "none"; } -string getSetString(set list) +string getSetString(set > list) { - string ret = "{"; - for (auto li = list.begin(); li != list.end(); li++) { - ret += " " + *li + ","; + stringstream ret; + ret << "{"; + auto li = list.begin(); + if (li != list.end()) { + ret << " " << li->first; + if (li->second != 0) { + ret << "." << li->second; + } } - ret[ret.size() - 1] = ' '; - ret += "}"; - return ret; + li++; + for (; li != list.end(); li++) { + ret << ", " << li->first; + if (li->second != 0) { + ret << "." << li->second; + } + } + ret << "}"; + return ret.str(); } string Module::GetAntimonyGeneralLayout(const string& indent) const diff --git a/src/module.h b/src/module.h index 2246c2c4..53a7504c 100644 --- a/src/module.h +++ b/src/module.h @@ -39,17 +39,17 @@ struct autolayout { //bool useBoundary = true; bool useGrid = false; bool useNameAsTextLabel = true; - std::set lockedNodeIds = std::set(); + //std::set lockedNodeIds = std::set(); }; struct layout { - std::set align_top = std::set(); - std::set align_hCenter = std::set(); - std::set align_bottom = std::set(); - std::set align_left = std::set(); - std::set align_vCenter = std::set(); - std::set align_right = std::set(); - std::set align_circular = std::set(); + std::set > align_top = std::set >(); + std::set > align_hCenter = std::set >(); + std::set > align_bottom = std::set >(); + std::set > align_left = std::set >(); + std::set > align_vCenter = std::set >(); + std::set > align_right = std::set >(); + std::set > align_circular = std::set >(); double height = 0.0; double width = 0.0; //double depth = 0.0; @@ -250,8 +250,6 @@ class Module : public Annotated void setUsedDistrib(bool useddistrib); - void fixLayoutPositionOf(const std::string& id); - #ifndef NCELLML //Reading: void LoadCellMLModel(iface::cellml_api::Model* model, From 2492862627035620f0f4fe1249a782cca8689261 Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 24 Sep 2024 16:20:17 -0700 Subject: [PATCH 41/43] Forgot to commit module.cpp... --- src/module.cpp | 86 +++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/src/module.cpp b/src/module.cpp index 1a595639..df677e47 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -1287,67 +1287,67 @@ bool Module::Finalize() } //Or if any variable has layout information // Also, check to make sure the variable is allowed to have layout/render info. - for (size_t var = 0; var < m_variables.size(); var++) { - if (m_variables[var]->GetNumLayoutWrappers() > 0) { - switch (m_variables[var]->GetType()) { - case varReactionUndef: - case varReactionGene: - case varInteraction: - case varSpeciesUndef: - case varDNA: - case varCompartment: - case varStrand: - // These are all allowed to have layout information. - break; - case varFormulaUndef: - case varFormulaOperator: - case varModule: - case varEvent: - case varUndefined: - case varUnitDefinition: - case varDeleted: - case varConstraint: - case varSboTermWrapper: - case varUncertWrapper: - case varLayoutWrapper: - case varStoichiometry: - case varAlgebraicRule: - case varLayoutColorEtc: - g_registry.SetError("Unable to add layout or render information to " + m_variables[var]->GetNameDelimitedBy(".") + ": only species, reactions, and compartments can be visualized, and this element is of type '" + VarTypeToString(m_variables[var]->GetType()) + "'."); - return true; - } - m_autolayout.use = true; - if (m_variables[var]->HasLayoutPositionInfo()) { - m_autolayout.lockedNodeIds.insert(m_variables[var]->GetNameDelimitedBy("_")); - } - } - } + std::set > setloc; + for (size_t var = 0; var < m_variables.size(); var++) { + if (m_variables[var]->GetNumLayoutWrappers() > 0) { + switch (m_variables[var]->GetType()) { + case varReactionUndef: + case varReactionGene: + case varInteraction: + case varSpeciesUndef: + case varDNA: + case varCompartment: + case varStrand: + // These are all allowed to have layout information. + break; + case varFormulaUndef: + case varFormulaOperator: + case varModule: + case varEvent: + case varUndefined: + case varUnitDefinition: + case varDeleted: + case varConstraint: + case varSboTermWrapper: + case varUncertWrapper: + case varLayoutWrapper: + case varStoichiometry: + case varAlgebraicRule: + case varLayoutColorEtc: + g_registry.SetError("Unable to add layout or render information to " + m_variables[var]->GetNameDelimitedBy(".") + ": only species, reactions, and compartments can be visualized, and this element is of type '" + VarTypeToString(m_variables[var]->GetType()) + "'."); + return true; + } + m_autolayout.use = true; + if (m_variables[var]->HasLayoutPositionInfo()) { + setloc.insert(make_pair(m_variables[var]->GetNameDelimitedBy("_"), 0)); + } + } + } if (m_speciesLayouts.size() || m_compartmentLayouts.size() || m_reactionLayouts.size()) { m_autolayout.use = true; } //Now check if the layout align lists are OK, i.e. don't have 2+ already-fixed nodes in them. - std::set > combo; - if (checkOverlapAndInsert(combo, m_layout.align_top, "align_top")) { + if (checkOverlapAndInsert(setloc, m_layout.align_top, "align_top")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_hCenter, "align_hCenter")) { + if (checkOverlapAndInsert(setloc, m_layout.align_hCenter, "align_hCenter")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_bottom, "align_bottom")) { + if (checkOverlapAndInsert(setloc, m_layout.align_bottom, "align_bottom")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_left, "align_left")) { + if (checkOverlapAndInsert(setloc, m_layout.align_left, "align_left")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_vCenter, "align_vCenter")) { + if (checkOverlapAndInsert(setloc, m_layout.align_vCenter, "align_vCenter")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_right, "align_right")) { + if (checkOverlapAndInsert(setloc, m_layout.align_right, "align_right")) { return true; } - if (checkOverlapAndInsert(combo, m_layout.align_circular, "align_circular")) { + if (checkOverlapAndInsert(setloc, m_layout.align_circular, "align_circular")) { return true; } From 1364e378212650b30187d22792e40f155d2bee2c Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 1 Oct 2024 16:27:49 -0700 Subject: [PATCH 42/43] More layout updates: * Parse strings with less copy/paste of bison code. * Fix error typo. * Disallow negative sizes. * Turn on layout with fewer cues. * Add layout/render tests. --- src/antimony.tab.cpp | 2468 +++++++++++++++---------------- src/antimony.ypp | 47 +- src/layoutWrapper.cpp | 14 +- src/module.cpp | 2 + src/test/TestAntimonyErrors.cpp | 159 ++ src/test/TestRunner.cpp | 3 + 6 files changed, 1401 insertions(+), 1292 deletions(-) diff --git a/src/antimony.tab.cpp b/src/antimony.tab.cpp index 1fdb74e6..70055c81 100644 --- a/src/antimony.tab.cpp +++ b/src/antimony.tab.cpp @@ -340,60 +340,61 @@ enum yysymbol_kind_t YYSYMBOL_maybein = 85, /* maybein */ YYSYMBOL_modulebody = 86, /* modulebody */ YYSYMBOL_moduleannotation = 87, /* moduleannotation */ - YYSYMBOL_variablelist = 88, /* variablelist */ - YYSYMBOL_numlist = 89, /* numlist */ - YYSYMBOL_modulepart = 90, /* modulepart */ - YYSYMBOL_reaction = 91, /* reaction */ - YYSYMBOL_reactantList = 92, /* reactantList */ - YYSYMBOL_reactionDivider = 93, /* reactionDivider */ - YYSYMBOL_formula = 94, /* formula */ - YYSYMBOL_commaformula = 95, /* commaformula */ - YYSYMBOL_mathThing = 96, /* mathThing */ - YYSYMBOL_inequality = 97, /* inequality */ - YYSYMBOL_lineend = 98, /* lineend */ - YYSYMBOL_assignment = 99, /* assignment */ - YYSYMBOL_algrule = 100, /* algrule */ - YYSYMBOL_submodule = 101, /* submodule */ - YYSYMBOL_102_6 = 102, /* $@6 */ - YYSYMBOL_103_7 = 103, /* $@7 */ - YYSYMBOL_variableimportlist = 104, /* variableimportlist */ - YYSYMBOL_submodifications = 105, /* submodifications */ - YYSYMBOL_varinitialize = 106, /* varinitialize */ - YYSYMBOL_specinit = 107, /* specinit */ - YYSYMBOL_formulainit = 108, /* formulainit */ - YYSYMBOL_reactioninit = 109, /* reactioninit */ - YYSYMBOL_dnainit = 110, /* dnainit */ - YYSYMBOL_geneinit = 111, /* geneinit */ - YYSYMBOL_operatorinit = 112, /* operatorinit */ - YYSYMBOL_compartmentinit = 113, /* compartmentinit */ - YYSYMBOL_varconstinit = 114, /* varconstinit */ - YYSYMBOL_unitinit = 115, /* unitinit */ - YYSYMBOL_dnadef = 116, /* dnadef */ - YYSYMBOL_dnastrand = 117, /* dnastrand */ - YYSYMBOL_dnamiddle = 118, /* dnamiddle */ - YYSYMBOL_event = 119, /* event */ - YYSYMBOL_120_8 = 120, /* $@8 */ - YYSYMBOL_121_9 = 121, /* $@9 */ - YYSYMBOL_122_10 = 122, /* $@10 */ - YYSYMBOL_123_11 = 123, /* $@11 */ - YYSYMBOL_colonret = 124, /* colonret */ - YYSYMBOL_eventmodifications = 125, /* eventmodifications */ - YYSYMBOL_assignmentlist = 126, /* assignmentlist */ - YYSYMBOL_deletion = 127, /* deletion */ - YYSYMBOL_unitdef = 128, /* unitdef */ - YYSYMBOL_constraint = 129, /* constraint */ - YYSYMBOL_objective = 130, /* objective */ - YYSYMBOL_maxormin = 131, /* maxormin */ - YYSYMBOL_stringlist = 132, /* stringlist */ - YYSYMBOL_annotationBlock = 133, /* annotationBlock */ - YYSYMBOL_134_12 = 134, /* $@12 */ - YYSYMBOL_annotations = 135, /* annotations */ - YYSYMBOL_cvterm = 136, /* cvterm */ - YYSYMBOL_toplevel_sbo = 137, /* toplevel_sbo */ - YYSYMBOL_modulename = 138, /* modulename */ - YYSYMBOL_functionname = 139, /* functionname */ - YYSYMBOL_modulecvterm = 140, /* modulecvterm */ - YYSYMBOL_functioncvterm = 141 /* functioncvterm */ + YYSYMBOL_stringConstant = 88, /* stringConstant */ + YYSYMBOL_variablelist = 89, /* variablelist */ + YYSYMBOL_numlist = 90, /* numlist */ + YYSYMBOL_modulepart = 91, /* modulepart */ + YYSYMBOL_reaction = 92, /* reaction */ + YYSYMBOL_reactantList = 93, /* reactantList */ + YYSYMBOL_reactionDivider = 94, /* reactionDivider */ + YYSYMBOL_formula = 95, /* formula */ + YYSYMBOL_commaformula = 96, /* commaformula */ + YYSYMBOL_mathThing = 97, /* mathThing */ + YYSYMBOL_inequality = 98, /* inequality */ + YYSYMBOL_lineend = 99, /* lineend */ + YYSYMBOL_assignment = 100, /* assignment */ + YYSYMBOL_algrule = 101, /* algrule */ + YYSYMBOL_submodule = 102, /* submodule */ + YYSYMBOL_103_6 = 103, /* $@6 */ + YYSYMBOL_104_7 = 104, /* $@7 */ + YYSYMBOL_variableimportlist = 105, /* variableimportlist */ + YYSYMBOL_submodifications = 106, /* submodifications */ + YYSYMBOL_varinitialize = 107, /* varinitialize */ + YYSYMBOL_specinit = 108, /* specinit */ + YYSYMBOL_formulainit = 109, /* formulainit */ + YYSYMBOL_reactioninit = 110, /* reactioninit */ + YYSYMBOL_dnainit = 111, /* dnainit */ + YYSYMBOL_geneinit = 112, /* geneinit */ + YYSYMBOL_operatorinit = 113, /* operatorinit */ + YYSYMBOL_compartmentinit = 114, /* compartmentinit */ + YYSYMBOL_varconstinit = 115, /* varconstinit */ + YYSYMBOL_unitinit = 116, /* unitinit */ + YYSYMBOL_dnadef = 117, /* dnadef */ + YYSYMBOL_dnastrand = 118, /* dnastrand */ + YYSYMBOL_dnamiddle = 119, /* dnamiddle */ + YYSYMBOL_event = 120, /* event */ + YYSYMBOL_121_8 = 121, /* $@8 */ + YYSYMBOL_122_9 = 122, /* $@9 */ + YYSYMBOL_123_10 = 123, /* $@10 */ + YYSYMBOL_124_11 = 124, /* $@11 */ + YYSYMBOL_colonret = 125, /* colonret */ + YYSYMBOL_eventmodifications = 126, /* eventmodifications */ + YYSYMBOL_assignmentlist = 127, /* assignmentlist */ + YYSYMBOL_deletion = 128, /* deletion */ + YYSYMBOL_unitdef = 129, /* unitdef */ + YYSYMBOL_constraint = 130, /* constraint */ + YYSYMBOL_objective = 131, /* objective */ + YYSYMBOL_maxormin = 132, /* maxormin */ + YYSYMBOL_stringlist = 133, /* stringlist */ + YYSYMBOL_annotationBlock = 134, /* annotationBlock */ + YYSYMBOL_135_12 = 135, /* $@12 */ + YYSYMBOL_annotations = 136, /* annotations */ + YYSYMBOL_cvterm = 137, /* cvterm */ + YYSYMBOL_toplevel_sbo = 138, /* toplevel_sbo */ + YYSYMBOL_modulename = 139, /* modulename */ + YYSYMBOL_functionname = 140, /* functionname */ + YYSYMBOL_modulecvterm = 141, /* modulecvterm */ + YYSYMBOL_functioncvterm = 142 /* functioncvterm */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -721,16 +722,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1427 +#define YYLAST 1373 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 69 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 73 +#define YYNNTS 74 /* YYNRULES -- Number of rules. */ -#define YYNRULES 265 +#define YYNRULES 266 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 515 +#define YYNSTATES 516 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 300 @@ -784,33 +785,33 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 162, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 178, 181, 181, 187, - 187, 193, 193, 199, 199, 204, 205, 208, 208, 209, - 210, 213, 214, 215, 225, 226, 227, 230, 231, 237, - 240, 243, 244, 247, 248, 249, 250, 251, 254, 255, - 258, 259, 260, 261, 264, 269, 274, 279, 289, 299, - 309, 323, 337, 351, 365, 381, 382, 383, 386, 387, - 388, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 407, 415, 423, 431, 439, - 447, 457, 458, 459, 460, 461, 462, 466, 467, 468, - 469, 470, 473, 474, 475, 476, 477, 478, 479, 480, - 481, 482, 483, 484, 485, 486, 489, 490, 493, 494, - 495, 496, 497, 498, 499, 502, 503, 504, 505, 506, - 509, 510, 511, 514, 515, 516, 517, 518, 519, 520, - 521, 522, 525, 526, 529, 529, 530, 530, 534, 535, - 536, 537, 538, 542, 543, 547, 551, 552, 553, 554, - 555, 556, 557, 558, 561, 562, 563, 564, 565, 566, - 567, 568, 569, 572, 573, 574, 575, 578, 579, 580, - 581, 582, 585, 586, 587, 588, 591, 592, 593, 594, - 597, 598, 599, 600, 604, 605, 606, 607, 608, 611, - 612, 613, 616, 619, 622, 623, 626, 627, 628, 629, - 630, 633, 634, 637, 637, 638, 638, 639, 639, 640, - 640, 643, 644, 647, 648, 655, 656, 657, 658, 659, - 662, 663, 666, 681, 682, 683, 684, 685, 686, 689, - 692, 693, 696, 697, 698, 700, 700, 703, 704, 709, - 710, 711, 714, 725, 735, 745, 755, 769, 783, 797, - 813, 815, 819, 820, 821, 822 + 0, 163, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 179, 182, 182, 188, + 188, 194, 194, 200, 200, 205, 206, 209, 209, 210, + 211, 214, 215, 216, 226, 227, 228, 231, 232, 238, + 241, 244, 245, 248, 249, 250, 251, 252, 255, 256, + 259, 260, 261, 262, 265, 270, 275, 280, 290, 300, + 314, 328, 342, 358, 359, 360, 361, 363, 364, 365, + 368, 369, 370, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 389, 397, 405, + 413, 421, 429, 439, 440, 441, 442, 443, 444, 448, + 449, 450, 451, 452, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 471, 472, + 475, 476, 477, 478, 479, 480, 481, 484, 485, 486, + 487, 488, 491, 492, 493, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 507, 508, 511, 511, 512, 512, + 516, 517, 518, 519, 520, 524, 525, 529, 533, 534, + 535, 536, 537, 538, 539, 540, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 554, 555, 556, 557, 560, + 561, 562, 563, 564, 567, 568, 569, 570, 573, 574, + 575, 576, 579, 580, 581, 582, 586, 587, 588, 589, + 590, 593, 594, 595, 598, 601, 604, 605, 608, 609, + 610, 611, 612, 615, 616, 619, 619, 620, 620, 621, + 621, 622, 622, 625, 626, 629, 630, 637, 638, 639, + 640, 641, 644, 645, 648, 663, 664, 665, 666, 667, + 668, 671, 674, 675, 678, 679, 680, 682, 682, 685, + 686, 691, 692, 693, 696, 707, 717, 727, 741, 755, + 769, 785, 787, 791, 792, 793, 794 }; #endif @@ -845,17 +846,18 @@ static const char *const yytname[] = "$@2", "$@3", "$@4", "function", "$@5", "spacedformula", "variableexportlist", "variable", "variablein", "varmaybein", "varmaybeis", "maybein", "modulebody", "moduleannotation", - "variablelist", "numlist", "modulepart", "reaction", "reactantList", - "reactionDivider", "formula", "commaformula", "mathThing", "inequality", - "lineend", "assignment", "algrule", "submodule", "$@6", "$@7", - "variableimportlist", "submodifications", "varinitialize", "specinit", - "formulainit", "reactioninit", "dnainit", "geneinit", "operatorinit", - "compartmentinit", "varconstinit", "unitinit", "dnadef", "dnastrand", - "dnamiddle", "event", "$@8", "$@9", "$@10", "$@11", "colonret", - "eventmodifications", "assignmentlist", "deletion", "unitdef", - "constraint", "objective", "maxormin", "stringlist", "annotationBlock", - "$@12", "annotations", "cvterm", "toplevel_sbo", "modulename", - "functionname", "modulecvterm", "functioncvterm", YY_NULLPTR + "stringConstant", "variablelist", "numlist", "modulepart", "reaction", + "reactantList", "reactionDivider", "formula", "commaformula", + "mathThing", "inequality", "lineend", "assignment", "algrule", + "submodule", "$@6", "$@7", "variableimportlist", "submodifications", + "varinitialize", "specinit", "formulainit", "reactioninit", "dnainit", + "geneinit", "operatorinit", "compartmentinit", "varconstinit", + "unitinit", "dnadef", "dnastrand", "dnamiddle", "event", "$@8", "$@9", + "$@10", "$@11", "colonret", "eventmodifications", "assignmentlist", + "deletion", "unitdef", "constraint", "objective", "maxormin", + "stringlist", "annotationBlock", "$@12", "annotations", "cvterm", + "toplevel_sbo", "modulename", "functionname", "modulecvterm", + "functioncvterm", YY_NULLPTR }; static const char * @@ -865,12 +867,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-394) +#define YYPACT_NINF (-392) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-92) +#define YYTABLE_NINF (-94) #define yytable_value_is_error(Yyn) \ 0 @@ -879,58 +881,58 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - -394, 767, -394, -394, 167, 115, -394, 175, 253, -394, - -394, -394, -394, -394, 388, 239, 149, 329, 115, 115, - 115, -394, 115, 282, 258, 115, -26, -394, -394, 189, - 255, 115, 390, 401, 210, 115, 473, -394, -394, -394, - -394, -394, 499, 14, 74, -394, -394, 12, 353, 307, - -394, 12, 12, 12, 12, -3, 90, 141, 196, 198, - 208, 240, 246, 12, 12, -394, 115, 12, 64, 12, - 12, -394, -394, 12, -394, -394, -394, -394, -394, 239, - -394, -394, 75, -394, -394, -394, -394, -394, -394, 75, - -394, -394, -394, 894, 121, 183, -394, 309, -394, -394, - -394, 93, 115, 115, 115, 115, 115, -394, 115, 257, - -394, 184, 115, 75, -394, -394, 298, 263, 270, -394, - -394, -394, -394, -394, 312, 185, 286, -394, 326, 330, - 195, -394, -394, -394, 338, -394, 345, -394, 115, -394, - 66, 115, 115, 115, 115, 115, 115, 115, 313, -394, - 348, 197, -394, 115, 75, 115, -394, 77, -394, 267, - 317, -394, 335, 336, 27, 115, 409, 18, -394, -394, - -394, -394, 115, 115, 115, 115, 115, 115, 115, 115, - -394, -394, 194, -394, 115, -394, -394, -394, 1089, -394, - -394, 1089, 1089, 370, 1089, 389, 392, -394, -394, -394, - -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, - 357, -394, -394, 75, -394, -394, -394, 382, -394, -394, - 384, 387, 1089, 1089, -394, -394, -394, -394, -394, -394, - -394, 115, 194, 399, -394, 136, 12, 339, 80, 395, - 136, 12, 415, 373, 156, 435, 417, 1362, 136, 418, - 419, -394, -394, -394, -394, -394, -394, -394, -394, -394, - 115, -394, 457, 346, 75, 290, 1089, -394, -394, 40, - 1089, 169, -394, 420, -394, 344, 353, 307, -394, -394, - -394, 115, 409, -394, 30, -394, -394, -394, -394, -394, - -394, -394, -394, -394, -394, 75, 1089, 421, 444, -394, - -394, 1089, 1089, 362, -394, 206, 89, -394, -394, 1089, - -394, -394, 1089, -394, 477, -2, -394, -394, 115, 478, - 188, 209, -394, -394, -394, 75, 391, 438, 1362, 481, - 294, 214, 115, 239, 448, 227, 1146, -394, -394, -394, - -394, -394, 1089, -394, 218, 115, 115, -394, 959, -394, - 1089, 44, 31, 1089, 1089, 75, 75, 1024, -394, 1024, - 263, -394, -394, -394, -394, -394, 483, -394, 35, 1089, - 1089, 1089, -394, -394, 455, 393, 75, 450, -394, -394, - -394, 12, 136, -394, 416, 115, 1200, 454, -394, -394, - -394, 12, 136, 397, 207, -394, -394, -394, 1089, 1089, - -394, 346, 75, 75, 1089, -394, -394, 415, -394, 33, - -394, 115, -394, 1024, -394, 346, 89, 1089, 458, -394, - 172, -394, -394, 12, 115, 173, -394, -394, 8, -394, - 75, 412, -394, 142, -394, -394, 1362, 1089, 89, 414, - 1024, -394, 1024, 75, -394, 35, -394, -394, 153, 1089, - 12, 75, -394, -394, 422, 497, -394, 1362, -394, -394, - -394, 422, 1254, -394, 35, -394, -394, 1024, -394, -394, - 1089, 829, -394, -394, 12, -394, 75, 238, 274, 468, - 1308, 319, 331, -394, 89, -394, 8, -394, 55, 96, - 104, -394, -4, -394, 430, -394, -394, -394, 35, -394, - 115, -394, 115, -394, 115, 75, -394, 513, -394, 75, - -394, -394, -394, 75, -394 + -392, 767, -392, -392, 178, 59, -392, 122, 330, -392, + -392, -392, -392, -392, 294, 363, 136, 329, 59, 59, + 59, -392, 59, 258, 252, 59, 10, -392, -392, 167, + 237, 59, 336, 343, 205, 59, 491, -392, -392, -392, + -392, -392, 645, 66, 139, -392, -392, 23, 428, 309, + -392, 23, 23, 23, 23, 97, 129, 182, 197, 203, + 210, 219, 225, 23, 23, -392, 59, 23, 154, 23, + 23, -392, -392, 23, -392, -392, -392, -392, -392, 363, + -392, -392, 181, -392, -392, -392, -392, -392, -392, 181, + -392, -392, -392, 894, 245, 108, -392, 204, -392, -392, + -392, 37, 59, 59, 59, 59, 59, -392, 59, 257, + -392, 202, 59, 181, -392, -392, 306, 263, 286, -392, + -392, -392, -392, -392, 344, 39, 337, -392, 366, 377, + 172, -392, -392, -392, 379, -392, 388, -392, 59, -392, + 40, 59, 59, 59, 59, 59, 59, 59, 341, -392, + 400, 43, -392, 59, 181, 59, -392, 199, -392, 273, + 364, -392, 373, 394, 65, 59, 409, 5, -392, -392, + -392, -392, 59, 59, 59, 59, 59, 59, 59, 59, + -392, -392, 276, -392, 59, -392, -392, -392, 1089, -392, + -392, 1089, 1089, 436, 1089, 432, 465, -392, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + 386, -392, -392, 181, -392, -392, -392, 413, -392, -392, + 420, 423, 1089, 1089, -392, -392, -392, -392, -392, -392, + -392, 59, 276, 425, -392, 156, 23, 422, 73, 474, + 156, 23, 398, 437, 100, 475, 439, 569, 156, 438, + 442, -392, -392, -392, -392, -392, -392, -392, -392, -392, + 59, -392, 479, 441, 181, 195, 1089, -392, -392, 334, + 1089, 98, -392, 449, -392, 285, 428, 309, -392, -392, + -392, 59, 409, -392, 7, -392, -392, -392, -392, -392, + -392, -392, -392, -392, -392, 181, 1089, 446, 476, -392, + -392, 1089, 1089, 71, -392, 246, 299, -392, -392, 1089, + -392, -392, 1089, -392, 494, 261, -392, -392, 59, 493, + 298, 198, -392, -392, -392, 181, 315, 455, 569, 495, + 347, 220, 59, 363, 457, 118, 1146, -392, -392, -392, + -392, -392, 1089, -392, 233, 59, 59, -392, 959, -392, + 1089, 192, 13, 1089, 1089, 181, 181, 1024, -392, 1024, + 263, -392, -392, -392, -392, -392, 498, -392, 34, 1089, + 1089, 1089, -392, -392, 463, 346, 181, 458, -392, -392, + -392, -392, -392, -392, 23, 156, -392, 427, 59, 1200, + 460, -392, -392, 23, 156, 375, 189, -392, -392, -392, + 1089, 1089, -392, 441, 181, 181, 1089, -392, -392, 398, + -392, 18, -392, 59, -392, 1024, -392, 441, 299, 1089, + 462, -392, 138, -392, -392, 23, 59, 171, -392, -392, + 27, -392, 181, 417, -392, 243, -392, -392, 569, 1089, + 299, 419, 1024, -392, 1024, 181, -392, 34, -392, -392, + 26, 1089, 23, 181, -392, 440, -392, 505, -392, 569, + -392, 440, -392, 1254, -392, 34, -392, -392, 1024, -392, + -392, 1089, 829, -392, -392, 23, -392, 181, 271, 307, + 464, 1308, 361, 393, -392, 299, -392, 27, -392, 50, + 72, 105, -392, 11, -392, 456, -392, -392, -392, 34, + -392, 59, -392, 59, -392, 59, 181, -392, 509, -392, + 181, -392, -392, -392, 181, -392 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -938,84 +940,84 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 2, 0, 1, 14, 0, 0, 132, 0, 37, 102, - 97, 98, 100, 101, 0, 0, 0, 0, 0, 0, - 0, 15, 0, 0, 0, 0, 0, 240, 241, 0, - 0, 0, 0, 0, 0, 0, 0, 131, 130, 3, - 4, 6, 41, 80, 0, 13, 5, 0, 0, 0, - 84, 0, 0, 0, 0, 156, 157, 158, 159, 160, - 161, 162, 163, 0, 0, 204, 210, 0, 0, 0, - 0, 102, 12, 0, 11, 7, 8, 9, 10, 0, - 99, 37, 39, 128, 129, 126, 102, 125, 127, 92, - 102, 245, 102, 213, 0, 41, 42, 43, 194, 102, - 102, 0, 0, 0, 0, 0, 0, 179, 0, 0, - 200, 206, 207, 230, 182, 173, 0, 0, 0, 27, - 30, 29, 186, 16, 0, 0, 0, 146, 0, 0, - 19, 26, 25, 190, 0, 177, 0, 164, 0, 168, - 203, 0, 0, 0, 0, 0, 0, 0, 0, 199, - 0, 37, 211, 0, 93, 0, 102, 0, 102, 0, - 0, 71, 0, 0, 0, 0, 91, 0, 72, 83, - 73, 74, 0, 0, 0, 0, 0, 0, 0, 0, - 77, 75, 208, 76, 0, 78, 81, 82, 239, 79, - 102, 142, 233, 247, 236, 0, 0, 119, 118, 120, - 121, 124, 122, 105, 102, 106, 103, 107, 115, 102, - 0, 102, 123, 104, 110, 111, 223, 0, 102, 102, - 0, 0, 235, 237, 102, 196, 184, 175, 188, 192, - 166, 0, 209, 0, 242, 0, 0, 0, 0, 0, - 0, 0, 148, 23, 0, 0, 0, 0, 0, 0, - 0, 167, 102, 195, 183, 174, 187, 191, 178, 165, - 0, 38, 0, 249, 40, 0, 232, 141, 138, 135, - 134, 0, 102, 0, 102, 91, 0, 0, 205, 102, - 102, 0, 94, 102, 0, 102, 171, 176, 180, 185, - 189, 193, 197, 201, 212, 231, 234, 0, 0, 113, - 114, 215, 116, 0, 112, 0, 0, 102, 47, 44, - 102, 102, 238, 170, 0, 0, 265, 261, 34, 0, - 0, 0, 262, 260, 151, 149, 0, 0, 0, 0, + 2, 0, 1, 14, 0, 0, 134, 0, 37, 104, + 99, 100, 102, 103, 0, 0, 0, 0, 0, 0, + 0, 15, 0, 0, 0, 0, 0, 242, 243, 0, + 0, 0, 0, 0, 0, 0, 0, 133, 132, 3, + 4, 6, 41, 82, 0, 13, 5, 0, 0, 0, + 86, 0, 0, 0, 0, 158, 159, 160, 161, 162, + 163, 164, 165, 0, 0, 206, 212, 0, 0, 0, + 0, 104, 12, 0, 11, 7, 8, 9, 10, 0, + 101, 37, 39, 130, 131, 128, 104, 127, 129, 94, + 104, 247, 104, 215, 0, 41, 42, 43, 196, 104, + 104, 0, 0, 0, 0, 0, 0, 181, 0, 0, + 202, 208, 209, 232, 184, 175, 0, 0, 0, 27, + 30, 29, 188, 16, 0, 0, 0, 148, 0, 0, + 19, 26, 25, 192, 0, 179, 0, 166, 0, 170, + 205, 0, 0, 0, 0, 0, 0, 0, 0, 201, + 0, 37, 213, 0, 95, 0, 104, 0, 104, 0, + 0, 73, 0, 0, 0, 0, 93, 0, 74, 85, + 75, 76, 0, 0, 0, 0, 0, 0, 0, 0, + 79, 77, 210, 78, 0, 80, 83, 84, 241, 81, + 104, 144, 235, 249, 238, 0, 0, 121, 120, 122, + 123, 126, 124, 107, 104, 108, 105, 109, 117, 104, + 0, 104, 125, 106, 112, 113, 225, 0, 104, 104, + 0, 0, 237, 239, 104, 198, 186, 177, 190, 194, + 168, 0, 211, 0, 244, 0, 0, 0, 0, 0, + 0, 0, 150, 23, 0, 0, 0, 0, 0, 0, + 0, 169, 104, 197, 185, 176, 189, 193, 180, 167, + 0, 38, 0, 251, 40, 0, 234, 143, 140, 137, + 136, 0, 104, 0, 104, 93, 0, 0, 207, 104, + 104, 0, 96, 104, 0, 104, 173, 178, 182, 187, + 191, 195, 199, 203, 214, 233, 236, 0, 0, 115, + 116, 217, 118, 0, 114, 0, 0, 104, 47, 44, + 104, 104, 240, 172, 0, 0, 266, 262, 34, 0, + 0, 0, 263, 261, 153, 151, 0, 0, 0, 0, 0, 0, 34, 37, 0, 0, 0, 51, 50, 54, - 102, 102, 202, 169, 0, 0, 0, 102, 217, 144, - 139, 0, 0, 133, 140, 95, 96, 48, 102, 48, - 0, 246, 223, 108, 102, 109, 0, 221, 0, 198, - 45, 46, 253, 243, 0, 0, 35, 0, 252, 254, - 255, 0, 0, 153, 0, 34, 0, 0, 57, 58, - 59, 0, 0, 0, 0, 20, 53, 52, 181, 172, - 251, 250, 137, 136, 143, 102, 223, 148, 102, 0, - 102, 0, 87, 48, 89, 248, 0, 117, 0, 222, - 0, 214, 244, 102, 0, 0, 264, 263, 48, 152, - 150, 0, 24, 0, 56, 55, 0, 219, 0, 0, - 48, 102, 48, 49, 86, 0, 102, 102, 0, 31, - 102, 36, 256, 257, 0, 0, 147, 0, 60, 61, - 62, 0, 0, 223, 0, 153, 88, 48, 90, 216, - 224, 225, 28, 33, 32, 68, 65, 0, 0, 0, - 0, 0, 0, 18, 0, 218, 48, 85, 0, 0, - 0, 258, 0, 259, 0, 22, 63, 64, 0, 145, - 0, 228, 0, 226, 0, 66, 69, 0, 155, 154, - 220, 229, 227, 67, 70 + 104, 104, 204, 171, 0, 0, 0, 104, 219, 146, + 141, 0, 0, 135, 142, 97, 98, 48, 104, 48, + 0, 248, 225, 110, 104, 111, 0, 223, 0, 200, + 45, 46, 255, 245, 0, 0, 35, 0, 254, 65, + 63, 66, 64, 256, 0, 0, 155, 0, 34, 0, + 0, 57, 58, 0, 0, 0, 0, 20, 53, 52, + 183, 174, 253, 252, 139, 138, 145, 104, 225, 150, + 104, 0, 104, 0, 89, 48, 91, 250, 0, 119, + 0, 224, 0, 216, 246, 104, 0, 0, 265, 264, + 48, 154, 152, 0, 24, 0, 56, 55, 0, 221, + 0, 0, 48, 104, 48, 49, 88, 0, 104, 104, + 0, 31, 104, 36, 257, 0, 258, 0, 149, 0, + 59, 0, 60, 0, 225, 0, 155, 90, 48, 92, + 218, 226, 227, 28, 33, 32, 70, 67, 0, 0, + 0, 0, 0, 0, 18, 0, 220, 48, 87, 0, + 0, 0, 259, 0, 260, 0, 22, 61, 62, 0, + 147, 0, 230, 0, 228, 0, 68, 71, 0, 157, + 156, 222, 231, 229, 69, 72 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -394, -394, -394, -394, -394, -394, -394, -394, -394, -394, - 81, -322, -1, 0, 2, 549, -316, -326, 4, 69, - 71, 6, -394, -41, -39, 325, 322, -394, 21, 17, - -394, -394, -394, -394, -394, 128, 72, -394, -394, -394, - -394, -394, -394, -394, -394, -394, -394, -394, 379, 521, - -394, -394, -394, -394, -394, -393, -348, -309, -394, 324, - -394, -394, 381, -105, -394, -394, -394, -394, -394, -394, - -394, -394, -394 + -392, -392, -392, -392, -392, -392, -392, -392, -392, -392, + 74, -309, -1, 0, 2, 538, -349, -326, 4, -319, + 68, 69, 6, -392, -41, -39, 328, 316, -392, 21, + -9, -392, -392, -392, -392, -392, 124, 70, -392, -392, + -392, -392, -392, -392, -392, -392, -392, -392, -392, 372, + 516, -392, -392, -392, -392, -392, -391, -340, -298, -392, + 317, -392, -392, 385, -78, -392, -392, -392, -392, -392, + -392, -392, -392, -392 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { 0, 1, 39, 40, 246, 247, 327, 328, 41, 237, - 448, 375, 213, 96, 97, 98, 412, 336, 337, 477, - 478, 338, 47, 48, 49, 266, 303, 214, 215, 50, - 51, 52, 53, 407, 242, 326, 428, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 216, 362, 406, 463, 368, 306, 421, 68, 267, - 69, 70, 71, 248, 72, 193, 298, 73, 74, 75, - 76, 77, 78 + 450, 375, 213, 96, 97, 98, 414, 336, 337, 383, + 478, 479, 338, 47, 48, 49, 266, 303, 214, 215, + 50, 51, 52, 53, 409, 242, 326, 430, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 216, 362, 408, 464, 368, 306, 423, 68, + 267, 69, 70, 71, 248, 72, 193, 298, 73, 74, + 75, 76, 77, 78 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1023,87 +1025,87 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 42, 43, 386, 44, 82, 45, 89, 46, 167, 164, - 393, 506, 235, 95, 416, 101, 95, 111, 113, 95, - 240, 95, -42, 445, 95, 163, 6, 123, 90, 92, - 95, 95, 95, 95, 140, 95, 99, 163, 163, 5, - 163, 154, 165, 414, 81, 464, 263, 5, 166, 346, - 411, 373, 81, 150, -42, 172, 5, -42, 438, 165, - 507, 81, 374, 431, 161, 182, 455, 5, 168, 169, - 170, 171, 81, -42, -42, -42, 37, 38, 6, 150, - 180, 181, 155, 285, 183, 185, 186, 187, 150, 5, - 189, 498, 283, 319, 81, 358, 410, 444, 441, 419, - 190, 95, 95, 95, 95, 95, 150, 95, 5, 408, - 462, 232, 456, 81, 156, 484, 5, 157, 276, 500, - 277, 81, 184, 284, 466, 252, 468, 5, 37, 38, - 268, 480, 81, 158, 159, 160, 469, 95, 217, 320, - 95, 95, 95, 95, 95, 95, 95, 366, 173, 367, - 6, 487, 264, 224, 265, 485, 269, 458, 275, 459, - 502, 5, 282, 166, 89, 154, 81, 6, 504, 329, - 499, 95, 95, 95, 95, 95, 95, 95, 95, 501, - 503, 5, 79, 295, 472, 150, 81, 5, 452, 510, - 453, 511, 81, 512, 315, 460, 150, 150, 239, 174, - 37, 38, 124, 378, 461, 379, 125, 150, 245, 100, - 262, 152, 380, 83, 84, 330, 382, 37, 38, 85, - 245, 294, 5, 80, 381, 153, 392, 81, 347, 391, - 95, 447, 126, 400, 86, 454, 352, 351, 234, 401, - 129, 325, 87, 88, 394, 127, 42, 43, 234, 44, - 234, -17, 316, 317, 175, 415, 176, 322, 323, 95, - 234, 138, 234, 128, 364, 339, 177, 234, 129, 365, - 89, 234, 130, 162, 154, 119, 166, 83, 84, 5, - 355, 356, 271, 85, 81, 272, 10, 11, 12, 13, - 131, 83, 84, 120, 18, 116, 490, 85, 178, 117, - 91, 491, 132, 150, 179, 121, 87, 88, 231, 388, - 409, 389, 27, 28, 273, 233, 234, 376, 390, 5, - 87, 88, 165, 236, 81, 118, 274, 42, 43, 238, - 44, 376, 492, 345, 93, 42, 43, 493, 44, 241, - 396, 5, 397, 243, 402, 403, 81, 244, 5, 218, - 166, 281, 102, 81, 92, 249, 5, 150, 103, 162, - 163, 81, 250, 104, 260, 261, 105, 420, 219, 220, - 221, 152, 10, 11, 12, 13, 280, 490, 106, 107, - 108, 109, 496, 430, 376, 42, 43, 297, 44, 492, - 396, 80, 397, 299, 497, 318, 188, 300, 426, 427, - 5, 94, 5, 134, 315, 81, 325, 81, 434, 435, - 443, 191, 321, 5, 136, 192, 304, 194, 81, 363, - 364, 5, 150, 451, 222, 223, 81, 5, 5, -21, - 324, 429, 81, 81, 5, 42, 43, 475, 44, 81, - 450, 307, 5, 310, 420, 508, 311, 81, 383, 384, - 423, 424, 331, 476, 436, 424, 42, 43, 314, 44, - 476, 42, 43, 420, 44, 473, 396, 450, 397, 457, - 424, 465, 384, 332, 344, 361, 349, 340, 341, 42, - 43, 360, 44, 270, 396, 5, 397, 420, 420, 505, - 81, 473, 372, 509, 385, 377, 141, 420, 387, 420, - 418, 420, 142, 513, 127, -91, -91, 143, 422, 425, - 144, 5, 150, 433, 479, 296, 151, 446, -91, -91, - -91, -91, 145, 146, 147, 148, 152, 494, 514, 301, - 481, 474, 482, 305, 302, 439, 302, 486, 278, 112, - 279, 153, 308, 0, 309, 0, 0, 0, 0, 312, + 42, 43, 389, 44, 82, 45, 89, 46, 167, 164, + 416, 392, 163, 95, 163, 101, 95, 111, 113, 95, + 163, 95, 418, 395, 95, 163, 507, 447, 90, 92, + 95, 95, 95, 95, 140, 95, 99, 6, 161, 235, + 6, 154, 168, 169, 170, 171, 5, 240, 166, 465, + 150, 81, 239, 150, 180, 181, 262, 473, 183, 185, + 186, 187, 5, 123, 189, 182, 446, 81, 440, 413, + 285, 5, 358, 263, -42, 508, 81, 5, 412, 433, + 165, 458, 81, 443, 5, 457, 319, 37, 38, 81, + 37, 38, 234, 467, 499, 469, 234, 224, 421, 252, + 190, 95, 95, 95, 95, 95, -42, 95, 456, -42, + 5, 232, 463, 329, 501, 81, 462, 5, 276, 488, + 277, 150, 81, 284, 485, -42, -42, -42, 363, 364, + 283, 129, 320, 481, 5, 396, 503, 95, 500, 81, + 95, 95, 95, 95, 95, 95, 95, 155, 5, 470, + 153, 150, 264, 81, 265, 172, 269, 347, 275, 330, + 83, 84, 282, 166, 89, 154, 85, 486, 6, 505, + 6, 95, 95, 95, 95, 95, 95, 95, 95, 156, + 124, 86, 157, 295, 125, 245, 454, 173, 379, 87, + 88, 502, 504, 79, 150, 380, 100, 449, 158, 159, + 160, 511, 245, 512, 5, 513, 381, 165, 150, 81, + 126, 5, 184, 384, 315, 150, 81, 5, 37, 38, + 37, 38, 81, 127, 382, 234, 316, 317, -17, 152, + 95, 322, 323, 455, 80, 393, 352, 351, 345, 339, + 174, 325, 234, 385, 218, 128, 42, 43, 402, 44, + 129, 234, 268, 394, 130, 175, 138, 410, 460, 95, + 379, 176, 217, 219, 220, 221, 403, 380, 177, 119, + 89, 116, 131, 234, 154, 117, 166, 178, 381, 162, + 355, 356, 417, 179, 132, 5, 234, 120, 271, 150, + 81, 272, 10, 11, 12, 13, 382, 5, 150, 121, + 18, 118, 81, 294, 364, 461, 5, 94, 231, 365, + 411, 81, 152, 378, 373, 379, 234, 376, 27, 28, + 273, 5, 380, 233, 165, 374, 81, 42, 43, 491, + 44, 376, 274, 381, 492, 42, 43, 93, 44, 236, + 398, 5, 399, 346, 404, 405, 81, 150, 5, 134, + 166, 382, 102, 81, 92, 5, 136, 366, 103, 367, + 81, 238, 391, 104, 379, 493, 105, 422, 83, 84, + 494, 380, 386, 387, 85, 428, 429, 91, 106, 107, + 108, 109, 381, 243, 436, 437, 432, 376, 42, 43, + 241, 44, 260, 398, 244, 399, 249, 87, 88, 188, + 382, 83, 84, 425, 426, 250, 5, 85, 325, 281, + 5, 81, 445, 324, 191, 81, 452, 261, 192, 491, + 194, 5, 150, 280, 497, 453, 81, 222, 223, 80, + 87, 88, 438, 426, 162, 163, 299, 42, 43, 5, + 44, 474, 431, 452, 81, 304, 422, 10, 11, 12, + 13, 493, 5, 297, 477, 476, 498, 81, 42, 43, + 477, 44, 42, 43, 422, 44, 474, 398, 5, 399, + 300, 509, 307, 81, 459, 426, 466, 387, 318, 310, + 42, 43, 311, 44, 314, 398, 270, 399, 422, 422, + 506, 321, 331, -21, 510, 332, 344, 340, 422, 315, + 422, 341, 422, 5, 514, 349, 360, 361, 81, 372, + 377, 388, 390, 127, 141, 420, 424, 427, 296, 435, + 142, 448, 480, 495, 515, 143, 475, 305, 144, 482, + 483, 278, 301, 441, 112, 308, 487, 302, 0, 302, + 145, 146, 147, 148, 279, 0, 0, 309, 0, 0, + 0, 0, 312, 0, 0, 110, 0, 0, 114, 0, + 115, 0, 0, 122, 0, 0, 0, 0, 0, 133, + 135, 137, 139, 0, 149, 4, 0, 0, 0, 0, + 342, 5, 0, 6, 7, 0, 333, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, + 348, 0, 350, 22, 0, 0, 25, 353, 354, 0, + 0, 357, 0, 359, 27, 28, 334, 335, 31, 32, + 33, 34, 0, 35, 36, 0, 0, 0, 0, 0, + 0, 0, 0, 37, 38, 369, 0, 0, 370, 371, + 225, 226, 227, 228, 229, 0, 230, 0, 0, 0, + 0, -93, -93, 0, 0, 0, 0, 5, 150, 0, + 0, 0, 151, 0, -93, -93, -93, -93, 400, 401, + 0, 0, 152, 0, 0, 406, 251, 0, 0, 253, + 254, 255, 256, 257, 258, 259, 415, 153, 0, 0, + 0, 0, 419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 110, 0, 0, 114, - 0, 115, 0, 0, 122, 0, 0, 342, 0, 0, - 133, 135, 137, 139, 0, 149, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 348, 0, 350, - 0, 0, 0, 0, 353, 354, 0, 0, 357, 0, - 359, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 286, 287, 288, 289, 290, 291, 292, 293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 369, 0, 0, 370, 371, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 225, 226, 227, 228, 229, 0, 230, 0, 0, - 0, 0, 0, 0, 0, 398, 399, 0, 0, 0, - 0, 0, 404, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 413, 0, 0, 0, 251, 0, 417, - 253, 254, 255, 256, 257, 258, 259, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 286, 287, 288, 289, 290, 291, 292, 293, 0, - 437, 0, 0, 440, 0, 442, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 449, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 467, 2, 3, 0, - 0, 470, 471, 4, 0, 449, 0, 0, 0, 5, - 313, 6, 7, 0, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 0, 0, 21, - 0, 22, 23, 24, 25, 0, 0, 0, 26, 343, + 0, 0, 0, 0, 0, 439, 0, 0, 442, 0, + 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 451, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 2, 3, 313, + 0, 468, 0, 4, 0, 0, 471, 472, 0, 5, + 451, 6, 7, 0, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 0, 343, 21, + 0, 22, 23, 24, 25, 0, 0, 0, 26, 0, 0, 0, 27, 28, 29, 30, 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 195, 196, 197, 198, 199, 200, 201, @@ -1111,7 +1113,7 @@ static const yytype_int16 yytable[] = 0, 0, 0, 205, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, - 0, 0, 208, 0, 0, 209, 0, 488, 210, 489, + 0, 0, 208, 0, 0, 209, 0, 489, 210, 490, 0, 211, 0, 0, 0, 212, 87, 88, 195, 196, 197, 198, 199, 200, 201, 202, 5, 0, 0, 203, 204, 81, 0, 0, 0, 0, 0, 0, 205, 0, @@ -1120,7 +1122,7 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 0, 0, 208, 0, 0, 209, 0, 0, 210, 0, 0, 211, 0, 0, 0, 212, 87, 88, 195, 196, 197, 198, 199, 200, 201, - 202, 5, 0, 0, 203, 405, 81, 0, 0, 0, + 202, 5, 0, 0, 203, 407, 81, 0, 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 207, 0, 0, 83, 84, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, @@ -1129,7 +1131,7 @@ static const yytype_int16 yytable[] = 197, 198, 199, 200, 201, 202, 5, 0, 0, 203, 0, 81, 0, 0, 0, 0, 0, 0, 205, 0, 0, 0, 0, 0, 206, 0, 0, 0, 0, 207, - 0, 0, 83, 84, 0, 0, 411, 0, 85, 0, + 0, 0, 83, 84, 0, 0, 413, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 208, 0, 0, 209, 0, 0, 210, 0, 0, 211, 0, 0, 0, 212, 87, 88, 195, 196, 197, 198, 199, 200, 201, @@ -1140,117 +1142,112 @@ static const yytype_int16 yytable[] = 0, 0, 208, 0, 0, 209, 0, 0, 210, 0, 0, 211, 4, 0, 0, 212, 87, 88, 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 0, 395, 0, 0, + 15, 16, 17, 18, 19, 20, 0, 397, 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 0, 432, 0, 0, 22, 0, 0, 25, 0, 0, + 0, 434, 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 0, 483, 0, 0, 22, 0, + 17, 18, 19, 20, 0, 484, 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 0, 495, + 13, 14, 15, 16, 17, 18, 19, 20, 0, 496, 0, 0, 22, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, 335, 31, 32, 33, - 34, 0, 35, 36, 0, 0, 0, 0, 4, 0, - 0, 0, 37, 38, 5, 0, 6, 7, 0, 333, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 0, 0, 0, 0, 22, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 0, 27, 28, 334, - 335, 31, 32, 33, 34, 0, 35, 36, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 38 + 34, 0, 35, 36, 0, 0, 0, 0, 0, 0, + 0, 0, 37, 38 }; static const yytype_int16 yycheck[] = { 1, 1, 328, 1, 5, 1, 7, 1, 49, 48, - 332, 15, 117, 14, 362, 16, 17, 18, 19, 20, - 125, 22, 8, 416, 25, 7, 14, 53, 7, 8, - 31, 32, 33, 34, 35, 36, 15, 7, 7, 12, - 7, 42, 15, 359, 17, 438, 151, 12, 49, 9, - 42, 53, 17, 13, 40, 58, 12, 43, 406, 15, - 64, 17, 64, 385, 47, 66, 58, 12, 51, 52, - 53, 54, 17, 59, 60, 61, 64, 65, 14, 13, - 63, 64, 8, 65, 67, 68, 69, 70, 13, 12, - 73, 484, 65, 13, 17, 65, 65, 413, 65, 64, - 79, 102, 103, 104, 105, 106, 13, 108, 12, 65, - 436, 112, 428, 17, 40, 463, 12, 43, 159, 64, - 159, 17, 58, 164, 440, 59, 442, 12, 64, 65, - 53, 457, 17, 59, 60, 61, 445, 138, 17, 59, - 141, 142, 143, 144, 145, 146, 147, 58, 58, 60, - 14, 467, 153, 60, 155, 464, 157, 15, 159, 17, - 64, 12, 163, 164, 165, 166, 17, 14, 64, 13, - 486, 172, 173, 174, 175, 176, 177, 178, 179, 488, - 489, 12, 15, 184, 31, 13, 17, 12, 15, 498, - 17, 500, 17, 502, 58, 53, 13, 13, 13, 58, - 64, 65, 13, 15, 62, 17, 17, 13, 13, 60, - 13, 27, 24, 38, 39, 59, 321, 64, 65, 44, - 13, 27, 12, 56, 15, 42, 331, 17, 59, 15, - 231, 59, 43, 15, 59, 62, 277, 276, 53, 344, - 13, 242, 67, 68, 17, 56, 247, 247, 53, 247, - 53, 56, 235, 236, 58, 360, 58, 240, 241, 260, - 53, 51, 53, 8, 58, 248, 58, 53, 13, 63, - 271, 53, 17, 6, 275, 17, 277, 38, 39, 12, - 281, 282, 15, 44, 17, 18, 19, 20, 21, 22, - 35, 38, 39, 35, 27, 13, 58, 44, 58, 17, - 47, 63, 47, 13, 58, 47, 67, 68, 51, 15, - 351, 17, 45, 46, 47, 17, 53, 318, 24, 12, - 67, 68, 15, 53, 17, 43, 59, 328, 328, 17, - 328, 332, 58, 43, 9, 336, 336, 63, 336, 53, - 336, 12, 336, 17, 345, 346, 17, 17, 12, 40, - 351, 15, 23, 17, 333, 17, 12, 13, 29, 6, - 7, 17, 17, 34, 51, 17, 37, 368, 59, 60, - 61, 27, 19, 20, 21, 22, 59, 58, 49, 50, - 51, 52, 63, 384, 385, 386, 386, 17, 386, 58, - 386, 56, 386, 4, 63, 56, 71, 5, 381, 382, - 12, 13, 12, 13, 58, 17, 407, 17, 391, 392, - 411, 86, 17, 12, 13, 90, 59, 92, 17, 57, - 58, 12, 13, 424, 99, 100, 17, 12, 12, 56, - 15, 15, 17, 17, 12, 436, 436, 15, 436, 17, - 423, 59, 12, 59, 445, 15, 59, 17, 57, 58, - 57, 58, 17, 454, 57, 58, 457, 457, 59, 457, - 461, 462, 462, 464, 462, 448, 462, 450, 462, 57, - 58, 57, 58, 56, 17, 31, 56, 59, 59, 480, - 480, 60, 480, 158, 480, 12, 480, 488, 489, 490, - 17, 474, 15, 494, 56, 17, 23, 498, 17, 500, - 17, 502, 29, 504, 56, 6, 7, 34, 53, 59, - 37, 12, 13, 59, 17, 190, 17, 59, 19, 20, - 21, 22, 49, 50, 51, 52, 27, 59, 15, 204, - 461, 450, 461, 211, 209, 407, 211, 465, 159, 18, - 159, 42, 218, -1, 219, -1, -1, -1, -1, 224, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 17, -1, -1, 20, - -1, 22, -1, -1, 25, -1, -1, 252, -1, -1, - 31, 32, 33, 34, -1, 36, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 272, -1, 274, - -1, -1, -1, -1, 279, 280, -1, -1, 283, -1, - 285, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 307, -1, -1, 310, 311, -1, -1, -1, + 359, 330, 7, 14, 7, 16, 17, 18, 19, 20, + 7, 22, 362, 332, 25, 7, 15, 418, 7, 8, + 31, 32, 33, 34, 35, 36, 15, 14, 47, 117, + 14, 42, 51, 52, 53, 54, 12, 125, 49, 440, + 13, 17, 13, 13, 63, 64, 13, 31, 67, 68, + 69, 70, 12, 53, 73, 66, 415, 17, 408, 42, + 65, 12, 65, 151, 8, 64, 17, 12, 65, 388, + 15, 430, 17, 65, 12, 58, 13, 64, 65, 17, + 64, 65, 53, 442, 485, 444, 53, 60, 64, 59, + 79, 102, 103, 104, 105, 106, 40, 108, 427, 43, + 12, 112, 438, 13, 64, 17, 435, 12, 159, 468, + 159, 13, 17, 164, 464, 59, 60, 61, 57, 58, + 65, 13, 59, 459, 12, 17, 64, 138, 487, 17, + 141, 142, 143, 144, 145, 146, 147, 8, 12, 447, + 42, 13, 153, 17, 155, 58, 157, 59, 159, 59, + 38, 39, 163, 164, 165, 166, 44, 465, 14, 64, + 14, 172, 173, 174, 175, 176, 177, 178, 179, 40, + 13, 59, 43, 184, 17, 13, 15, 58, 17, 67, + 68, 489, 490, 15, 13, 24, 60, 59, 59, 60, + 61, 499, 13, 501, 12, 503, 35, 15, 13, 17, + 43, 12, 58, 15, 58, 13, 17, 12, 64, 65, + 64, 65, 17, 56, 53, 53, 235, 236, 56, 27, + 231, 240, 241, 62, 56, 15, 277, 276, 43, 248, + 58, 242, 53, 321, 40, 8, 247, 247, 15, 247, + 13, 53, 53, 331, 17, 58, 51, 65, 15, 260, + 17, 58, 17, 59, 60, 61, 344, 24, 58, 17, + 271, 13, 35, 53, 275, 17, 277, 58, 35, 6, + 281, 282, 360, 58, 47, 12, 53, 35, 15, 13, + 17, 18, 19, 20, 21, 22, 53, 12, 13, 47, + 27, 43, 17, 27, 58, 62, 12, 13, 51, 63, + 351, 17, 27, 15, 53, 17, 53, 318, 45, 46, + 47, 12, 24, 17, 15, 64, 17, 328, 328, 58, + 328, 332, 59, 35, 63, 336, 336, 9, 336, 53, + 336, 12, 336, 9, 345, 346, 17, 13, 12, 13, + 351, 53, 23, 17, 333, 12, 13, 58, 29, 60, + 17, 17, 15, 34, 17, 58, 37, 368, 38, 39, + 63, 24, 57, 58, 44, 384, 385, 47, 49, 50, + 51, 52, 35, 17, 393, 394, 387, 388, 389, 389, + 53, 389, 51, 389, 17, 389, 17, 67, 68, 71, + 53, 38, 39, 57, 58, 17, 12, 44, 409, 15, + 12, 17, 413, 15, 86, 17, 425, 17, 90, 58, + 92, 12, 13, 59, 63, 426, 17, 99, 100, 56, + 67, 68, 57, 58, 6, 7, 4, 438, 438, 12, + 438, 450, 15, 452, 17, 59, 447, 19, 20, 21, + 22, 58, 12, 17, 455, 15, 63, 17, 459, 459, + 461, 459, 463, 463, 465, 463, 475, 463, 12, 463, + 5, 15, 59, 17, 57, 58, 57, 58, 56, 59, + 481, 481, 59, 481, 59, 481, 158, 481, 489, 490, + 491, 17, 17, 56, 495, 56, 17, 59, 499, 58, + 501, 59, 503, 12, 505, 56, 60, 31, 17, 15, + 17, 56, 17, 56, 23, 17, 53, 59, 190, 59, + 29, 59, 17, 59, 15, 34, 452, 211, 37, 461, + 461, 159, 204, 409, 18, 218, 466, 209, -1, 211, + 49, 50, 51, 52, 159, -1, -1, 219, -1, -1, + -1, -1, 224, -1, -1, 17, -1, -1, 20, -1, + 22, -1, -1, 25, -1, -1, -1, -1, -1, 31, + 32, 33, 34, -1, 36, 6, -1, -1, -1, -1, + 252, 12, -1, 14, 15, -1, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, -1, + 272, -1, 274, 34, -1, -1, 37, 279, 280, -1, + -1, 283, -1, 285, 45, 46, 47, 48, 49, 50, + 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, + -1, -1, -1, 64, 65, 307, -1, -1, 310, 311, + 102, 103, 104, 105, 106, -1, 108, -1, -1, -1, + -1, 6, 7, -1, -1, -1, -1, 12, 13, -1, + -1, -1, 17, -1, 19, 20, 21, 22, 340, 341, + -1, -1, 27, -1, -1, 347, 138, -1, -1, 141, + 142, 143, 144, 145, 146, 147, 358, 42, -1, -1, + -1, -1, 364, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 102, 103, 104, 105, 106, -1, 108, -1, -1, - -1, -1, -1, -1, -1, 340, 341, -1, -1, -1, - -1, -1, 347, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 358, -1, -1, -1, 138, -1, 364, - 141, 142, 143, 144, 145, 146, 147, -1, -1, -1, + 172, 173, 174, 175, 176, 177, 178, 179, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 172, 173, 174, 175, 176, 177, 178, 179, -1, - 405, -1, -1, 408, -1, 410, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 423, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 441, 0, 1, -1, - -1, 446, 447, 6, -1, 450, -1, -1, -1, 12, - 231, 14, 15, -1, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, - -1, 34, 35, 36, 37, -1, -1, -1, 41, 260, + -1, -1, -1, -1, -1, 407, -1, -1, 410, -1, + 412, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 425, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 0, 1, 231, + -1, 443, -1, 6, -1, -1, 448, 449, -1, 12, + 452, 14, 15, -1, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, -1, 260, 32, + -1, 34, 35, 36, 37, -1, -1, -1, 41, -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, -1, -1, -1, -1, -1, -1, 64, 65, 4, 5, 6, 7, 8, 9, 10, @@ -1306,13 +1303,8 @@ static const yytype_int16 yycheck[] = 22, 23, 24, 25, 26, 27, 28, 29, -1, 31, -1, -1, 34, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, 50, 51, - 52, -1, 54, 55, -1, -1, -1, -1, 6, -1, - -1, -1, 64, 65, 12, -1, 14, 15, -1, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, -1, -1, -1, -1, 34, -1, -1, 37, - -1, -1, -1, -1, -1, -1, -1, 45, 46, 47, - 48, 49, 50, 51, 52, -1, 54, 55, -1, -1, - -1, -1, -1, -1, -1, -1, 64, 65 + 52, -1, 54, 55, -1, -1, -1, -1, -1, -1, + -1, -1, 64, 65 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -1323,54 +1315,54 @@ static const yytype_uint8 yystos[] = 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 34, 35, 36, 37, 41, 45, 46, 47, 48, 49, 50, 51, 52, 54, 55, 64, 65, 71, - 72, 77, 81, 82, 83, 87, 90, 91, 92, 93, - 98, 99, 100, 101, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 127, 129, - 130, 131, 133, 136, 137, 138, 139, 140, 141, 15, + 72, 77, 81, 82, 83, 87, 91, 92, 93, 94, + 99, 100, 101, 102, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 128, 130, + 131, 132, 134, 137, 138, 139, 140, 141, 142, 15, 56, 17, 81, 38, 39, 44, 59, 67, 68, 81, - 97, 47, 97, 94, 13, 81, 82, 83, 84, 97, + 98, 47, 98, 95, 13, 81, 82, 83, 84, 98, 60, 81, 23, 29, 34, 37, 49, 50, 51, 52, - 84, 81, 118, 81, 84, 84, 13, 17, 43, 17, + 84, 81, 119, 81, 84, 84, 13, 17, 43, 17, 35, 47, 84, 53, 13, 17, 43, 56, 8, 13, 17, 35, 47, 84, 13, 84, 13, 84, 51, 84, 81, 23, 29, 34, 37, 49, 50, 51, 52, 84, 13, 17, 27, 42, 81, 8, 40, 43, 59, 60, - 61, 98, 6, 7, 93, 15, 81, 92, 98, 98, - 98, 98, 58, 58, 58, 58, 58, 58, 58, 58, - 98, 98, 81, 98, 58, 98, 98, 98, 94, 98, - 97, 94, 94, 134, 94, 4, 5, 6, 7, 8, + 61, 99, 6, 7, 94, 15, 81, 93, 99, 99, + 99, 99, 58, 58, 58, 58, 58, 58, 58, 58, + 99, 99, 81, 99, 58, 99, 99, 99, 95, 99, + 98, 95, 95, 135, 95, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 24, 30, 35, 53, 56, - 59, 62, 66, 81, 96, 97, 120, 17, 40, 59, - 60, 61, 94, 94, 60, 84, 84, 84, 84, 84, - 84, 51, 81, 17, 53, 132, 53, 78, 17, 13, - 132, 53, 103, 17, 17, 13, 73, 74, 132, 17, + 59, 62, 66, 81, 97, 98, 121, 17, 40, 59, + 60, 61, 95, 95, 60, 84, 84, 84, 84, 84, + 84, 51, 81, 17, 53, 133, 53, 78, 17, 13, + 133, 53, 104, 17, 17, 13, 73, 74, 133, 17, 17, 84, 59, 84, 84, 84, 84, 84, 84, 84, - 51, 17, 13, 132, 81, 81, 94, 128, 53, 81, - 94, 15, 18, 47, 59, 81, 92, 93, 117, 131, - 59, 15, 81, 65, 92, 65, 84, 84, 84, 84, - 84, 84, 84, 84, 27, 81, 94, 17, 135, 4, - 5, 94, 94, 95, 59, 95, 125, 59, 128, 94, - 59, 59, 94, 84, 59, 58, 98, 98, 56, 13, - 59, 17, 98, 98, 15, 81, 104, 75, 76, 13, - 59, 17, 56, 17, 47, 48, 86, 87, 90, 98, - 59, 59, 94, 84, 17, 43, 9, 59, 94, 56, - 94, 93, 92, 94, 94, 81, 81, 94, 65, 94, - 60, 31, 121, 57, 58, 63, 58, 60, 124, 94, - 94, 94, 15, 53, 64, 80, 81, 17, 15, 17, - 24, 15, 132, 57, 58, 56, 86, 17, 15, 17, - 24, 15, 132, 80, 17, 31, 87, 90, 94, 94, - 15, 132, 81, 81, 94, 16, 122, 102, 65, 92, - 65, 42, 85, 94, 85, 132, 125, 94, 17, 64, - 81, 126, 53, 57, 58, 59, 98, 98, 105, 15, - 81, 80, 31, 59, 98, 98, 57, 94, 125, 104, - 94, 65, 94, 81, 85, 124, 59, 59, 79, 94, - 98, 81, 15, 17, 62, 58, 85, 57, 15, 17, - 53, 62, 86, 123, 124, 57, 85, 94, 85, 126, - 94, 94, 31, 98, 79, 15, 81, 88, 89, 17, - 86, 88, 89, 31, 125, 126, 105, 85, 58, 60, - 58, 63, 58, 63, 59, 31, 63, 63, 124, 85, - 64, 126, 64, 126, 64, 81, 15, 64, 15, 81, - 126, 126, 126, 81, 15 + 51, 17, 13, 133, 81, 81, 95, 129, 53, 81, + 95, 15, 18, 47, 59, 81, 93, 94, 118, 132, + 59, 15, 81, 65, 93, 65, 84, 84, 84, 84, + 84, 84, 84, 84, 27, 81, 95, 17, 136, 4, + 5, 95, 95, 96, 59, 96, 126, 59, 129, 95, + 59, 59, 95, 84, 59, 58, 99, 99, 56, 13, + 59, 17, 99, 99, 15, 81, 105, 75, 76, 13, + 59, 17, 56, 17, 47, 48, 86, 87, 91, 99, + 59, 59, 95, 84, 17, 43, 9, 59, 95, 56, + 95, 94, 93, 95, 95, 81, 81, 95, 65, 95, + 60, 31, 122, 57, 58, 63, 58, 60, 125, 95, + 95, 95, 15, 53, 64, 80, 81, 17, 15, 17, + 24, 35, 53, 88, 15, 133, 57, 58, 56, 86, + 17, 15, 88, 15, 133, 80, 17, 31, 87, 91, + 95, 95, 15, 133, 81, 81, 95, 16, 123, 103, + 65, 93, 65, 42, 85, 95, 85, 133, 126, 95, + 17, 64, 81, 127, 53, 57, 58, 59, 99, 99, + 106, 15, 81, 80, 31, 59, 99, 99, 57, 95, + 126, 105, 95, 65, 95, 81, 85, 125, 59, 59, + 79, 95, 99, 81, 15, 62, 88, 58, 85, 57, + 15, 62, 88, 86, 124, 125, 57, 85, 95, 85, + 127, 95, 95, 31, 99, 79, 15, 81, 89, 90, + 17, 86, 89, 90, 31, 126, 127, 106, 85, 58, + 60, 58, 63, 58, 63, 59, 31, 63, 63, 125, + 85, 64, 127, 64, 127, 64, 81, 15, 64, 15, + 81, 127, 127, 127, 81, 15 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ @@ -1382,27 +1374,27 @@ static const yytype_uint8 yyr1[] = 77, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 83, 83, 84, 84, 84, 84, 84, 85, 85, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 88, 88, 88, 89, 89, - 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, - 91, 92, 92, 92, 92, 92, 92, 93, 93, 93, - 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 95, 95, 96, 96, - 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, - 98, 98, 98, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 100, 100, 102, 101, 103, 101, 104, 104, - 104, 104, 104, 105, 105, 105, 106, 106, 106, 106, - 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 108, 108, 108, 108, 109, 109, 109, - 109, 109, 110, 110, 110, 110, 111, 111, 111, 111, - 112, 112, 112, 112, 113, 113, 113, 113, 113, 114, - 114, 114, 115, 115, 116, 116, 117, 117, 117, 117, - 117, 118, 118, 120, 119, 121, 119, 122, 119, 123, - 119, 124, 124, 125, 125, 126, 126, 126, 126, 126, - 127, 127, 128, 129, 129, 129, 129, 129, 129, 130, - 131, 131, 132, 132, 132, 134, 133, 135, 135, 136, - 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, - 138, 139, 140, 140, 140, 141 + 87, 87, 87, 88, 88, 88, 88, 89, 89, 89, + 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, + 92, 92, 92, 93, 93, 93, 93, 93, 93, 94, + 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, + 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, + 98, 98, 99, 99, 99, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 101, 101, 103, 102, 104, 102, + 105, 105, 105, 105, 105, 106, 106, 106, 107, 107, + 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, + 108, 108, 108, 108, 108, 109, 109, 109, 109, 110, + 110, 110, 110, 110, 111, 111, 111, 111, 112, 112, + 112, 112, 113, 113, 113, 113, 114, 114, 114, 114, + 114, 115, 115, 115, 116, 116, 117, 117, 118, 118, + 118, 118, 118, 119, 119, 121, 120, 122, 120, 123, + 120, 124, 120, 125, 125, 126, 126, 127, 127, 127, + 127, 127, 128, 128, 129, 130, 130, 130, 130, 130, + 130, 131, 132, 132, 133, 133, 133, 135, 134, 136, + 136, 137, 137, 137, 138, 138, 138, 138, 138, 138, + 138, 139, 140, 141, 141, 141, 142 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -1413,28 +1405,28 @@ static const yytype_int8 yyr2[] = 5, 0, 9, 0, 6, 2, 2, 0, 8, 2, 2, 1, 2, 2, 0, 1, 3, 1, 3, 2, 3, 1, 1, 1, 3, 4, 4, 3, 0, 2, - 1, 1, 2, 2, 4, 6, 6, 5, 5, 5, - 7, 7, 7, 9, 9, 1, 3, 4, 1, 3, - 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 2, 2, 2, 1, 8, 6, 5, 7, 5, - 7, 1, 2, 2, 3, 4, 4, 1, 1, 2, - 1, 1, 0, 2, 2, 2, 2, 2, 4, 4, - 2, 2, 3, 3, 3, 2, 1, 3, 1, 1, + 1, 1, 2, 2, 4, 6, 6, 5, 5, 7, + 7, 9, 9, 1, 1, 1, 1, 1, 3, 4, + 1, 3, 4, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 1, 2, 2, 2, 1, 8, 6, 5, + 7, 5, 7, 1, 2, 2, 3, 4, 4, 1, + 1, 2, 1, 1, 0, 2, 2, 2, 2, 2, + 4, 4, 2, 2, 3, 3, 3, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 3, 3, 5, 5, 3, 4, - 4, 3, 3, 5, 0, 9, 0, 7, 0, 1, - 3, 1, 3, 0, 5, 5, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 3, 3, 3, 2, 4, - 4, 3, 5, 2, 3, 3, 3, 2, 3, 2, - 3, 5, 2, 3, 3, 3, 2, 3, 3, 3, - 2, 3, 3, 3, 2, 3, 3, 3, 5, 2, - 2, 3, 4, 2, 1, 3, 2, 2, 2, 3, - 1, 2, 3, 0, 6, 0, 8, 0, 8, 0, - 10, 1, 2, 0, 5, 3, 5, 6, 5, 6, - 2, 3, 1, 3, 4, 3, 3, 3, 4, 2, - 1, 1, 1, 3, 4, 0, 5, 0, 3, 3, - 5, 5, 5, 5, 5, 5, 7, 7, 9, 9, - 4, 4, 4, 6, 6, 4 + 1, 1, 1, 1, 1, 4, 3, 3, 5, 5, + 3, 4, 4, 3, 3, 5, 0, 9, 0, 7, + 0, 1, 3, 1, 3, 0, 5, 5, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, + 2, 4, 4, 3, 5, 2, 3, 3, 3, 2, + 3, 2, 3, 5, 2, 3, 3, 3, 2, 3, + 3, 3, 2, 3, 3, 3, 2, 3, 3, 3, + 5, 2, 2, 3, 4, 2, 1, 3, 2, 2, + 2, 3, 1, 2, 3, 0, 6, 0, 8, 0, + 8, 0, 10, 1, 2, 0, 5, 3, 5, 6, + 5, 6, 2, 3, 1, 3, 4, 3, 3, 3, + 4, 2, 1, 1, 1, 3, 4, 0, 5, 0, + 3, 3, 5, 5, 5, 5, 5, 7, 7, 9, + 9, 4, 4, 4, 6, 6, 4 }; @@ -2168,361 +2160,361 @@ yyparse (void) switch (yyn) { case 3: /* input: input import */ -#line 163 "antimony.ypp" +#line 164 "antimony.ypp" {} -#line 2174 "antimony.tab.cpp" +#line 2166 "antimony.tab.cpp" break; case 4: /* input: input module */ -#line 164 "antimony.ypp" +#line 165 "antimony.ypp" { /*cout << endl << $2->ToString() << endl << endl;*/ } -#line 2180 "antimony.tab.cpp" +#line 2172 "antimony.tab.cpp" break; case 5: /* input: input modulepart */ -#line 165 "antimony.ypp" +#line 166 "antimony.ypp" {} -#line 2186 "antimony.tab.cpp" +#line 2178 "antimony.tab.cpp" break; case 6: /* input: input function */ -#line 166 "antimony.ypp" +#line 167 "antimony.ypp" {} -#line 2192 "antimony.tab.cpp" +#line 2184 "antimony.tab.cpp" break; case 7: /* input: input modulename */ -#line 167 "antimony.ypp" +#line 168 "antimony.ypp" {} -#line 2198 "antimony.tab.cpp" +#line 2190 "antimony.tab.cpp" break; case 8: /* input: input functionname */ -#line 168 "antimony.ypp" +#line 169 "antimony.ypp" {} -#line 2204 "antimony.tab.cpp" +#line 2196 "antimony.tab.cpp" break; case 9: /* input: input modulecvterm */ -#line 169 "antimony.ypp" +#line 170 "antimony.ypp" {} -#line 2210 "antimony.tab.cpp" +#line 2202 "antimony.tab.cpp" break; case 10: /* input: input functioncvterm */ -#line 170 "antimony.ypp" +#line 171 "antimony.ypp" {} -#line 2216 "antimony.tab.cpp" +#line 2208 "antimony.tab.cpp" break; case 11: /* input: input toplevel_sbo */ -#line 171 "antimony.ypp" +#line 172 "antimony.ypp" {} -#line 2222 "antimony.tab.cpp" +#line 2214 "antimony.tab.cpp" break; case 12: /* input: input annotationBlock */ -#line 172 "antimony.ypp" +#line 173 "antimony.ypp" {} -#line 2228 "antimony.tab.cpp" +#line 2220 "antimony.tab.cpp" break; case 13: /* input: input moduleannotation */ -#line 173 "antimony.ypp" +#line 174 "antimony.ypp" {} -#line 2234 "antimony.tab.cpp" +#line 2226 "antimony.tab.cpp" break; case 14: /* input: input error */ -#line 174 "antimony.ypp" +#line 175 "antimony.ypp" {YYABORT;} -#line 2240 "antimony.tab.cpp" +#line 2232 "antimony.tab.cpp" break; case 15: /* input: input "an error" */ -#line 175 "antimony.ypp" +#line 176 "antimony.ypp" {YYABORT;} -#line 2246 "antimony.tab.cpp" +#line 2238 "antimony.tab.cpp" break; case 16: /* import: "'import'" "text string" */ -#line 178 "antimony.ypp" +#line 179 "antimony.ypp" { if (g_registry.OpenFile(*((yyvsp[0].word)))==0) YYABORT;} -#line 2252 "antimony.tab.cpp" +#line 2244 "antimony.tab.cpp" break; case 17: /* $@1: %empty */ -#line 181 "antimony.ypp" +#line 182 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2258 "antimony.tab.cpp" +#line 2250 "antimony.tab.cpp" break; case 18: /* module: "'model' or 'module'" "element name" $@1 '(' variableexportlist ')' modulebody "'end'" */ -#line 182 "antimony.ypp" +#line 183 "antimony.ypp" { (yyval.module) = g_registry.CurrentModule(); if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2268 "antimony.tab.cpp" +#line 2260 "antimony.tab.cpp" break; case 19: /* $@2: %empty */ -#line 187 "antimony.ypp" +#line 188 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, false);} -#line 2274 "antimony.tab.cpp" +#line 2266 "antimony.tab.cpp" break; case 20: /* module: "'model' or 'module'" "element name" $@2 modulebody "'end'" */ -#line 188 "antimony.ypp" +#line 189 "antimony.ypp" { (yyval.module) = g_registry.CurrentModule(); if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2284 "antimony.tab.cpp" +#line 2276 "antimony.tab.cpp" break; case 21: /* $@3: %empty */ -#line 193 "antimony.ypp" +#line 194 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2290 "antimony.tab.cpp" +#line 2282 "antimony.tab.cpp" break; case 22: /* module: "'model' or 'module'" '*' "element name" $@3 '(' variableexportlist ')' modulebody "'end'" */ -#line 194 "antimony.ypp" +#line 195 "antimony.ypp" { (yyval.module) = g_registry.CurrentModule(); if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2300 "antimony.tab.cpp" +#line 2292 "antimony.tab.cpp" break; case 23: /* $@4: %empty */ -#line 199 "antimony.ypp" +#line 200 "antimony.ypp" {g_registry.NewCurrentModule((yyvsp[0].word), NULL, true);} -#line 2306 "antimony.tab.cpp" +#line 2298 "antimony.tab.cpp" break; case 24: /* module: "'model' or 'module'" '*' "element name" $@4 modulebody "'end'" */ -#line 200 "antimony.ypp" +#line 201 "antimony.ypp" { (yyval.module) = g_registry.CurrentModule(); if ((yyval.module)->Finalize()) YYABORT; g_registry.RevertToPreviousModule(); } -#line 2316 "antimony.tab.cpp" +#line 2308 "antimony.tab.cpp" break; case 25: /* module: "'model' or 'module'" "name of an existing module" */ -#line 204 "antimony.ypp" +#line 205 "antimony.ypp" {g_registry.SetError("module '" + *((yyvsp[0].word)) + "' already defined."); YYABORT;} -#line 2322 "antimony.tab.cpp" +#line 2314 "antimony.tab.cpp" break; case 26: /* module: "'model' or 'module'" "name of an existing function" */ -#line 205 "antimony.ypp" +#line 206 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a module because it is already a defined function."); YYABORT;} -#line 2328 "antimony.tab.cpp" +#line 2320 "antimony.tab.cpp" break; case 27: /* $@5: %empty */ -#line 208 "antimony.ypp" +#line 209 "antimony.ypp" {g_registry.NewUserFunction((yyvsp[0].word));} -#line 2334 "antimony.tab.cpp" +#line 2326 "antimony.tab.cpp" break; case 28: /* function: "'function'" "element name" $@5 '(' variableexportlist ')' spacedformula "'end'" */ -#line 208 "antimony.ypp" +#line 209 "antimony.ypp" {if (g_registry.SetUserFunction((yyvsp[-1].formula))) YYABORT;} -#line 2340 "antimony.tab.cpp" +#line 2332 "antimony.tab.cpp" break; case 29: /* function: "'function'" "name of an existing module" */ -#line 209 "antimony.ypp" +#line 210 "antimony.ypp" {g_registry.SetError("Cannot use '" + *((yyvsp[0].word)) +"' as a function name because it is already the name of a module."); YYABORT;} -#line 2346 "antimony.tab.cpp" +#line 2338 "antimony.tab.cpp" break; case 30: /* function: "'function'" "name of an existing function" */ -#line 210 "antimony.ypp" +#line 211 "antimony.ypp" {g_registry.SetError("Cannot define '" + *((yyvsp[0].word)) + "' as a new function because it is already a defined function."); YYABORT;} -#line 2352 "antimony.tab.cpp" +#line 2344 "antimony.tab.cpp" break; case 31: /* spacedformula: formula */ -#line 213 "antimony.ypp" +#line 214 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2358 "antimony.tab.cpp" +#line 2350 "antimony.tab.cpp" break; case 32: /* spacedformula: lineend spacedformula */ -#line 214 "antimony.ypp" +#line 215 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 2364 "antimony.tab.cpp" +#line 2356 "antimony.tab.cpp" break; case 33: /* spacedformula: spacedformula lineend */ -#line 215 "antimony.ypp" +#line 216 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula);} -#line 2370 "antimony.tab.cpp" +#line 2362 "antimony.tab.cpp" break; case 34: /* variableexportlist: %empty */ -#line 225 "antimony.ypp" +#line 226 "antimony.ypp" {} -#line 2376 "antimony.tab.cpp" +#line 2368 "antimony.tab.cpp" break; case 35: /* variableexportlist: variable */ -#line 226 "antimony.ypp" +#line 227 "antimony.ypp" {if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2382 "antimony.tab.cpp" +#line 2374 "antimony.tab.cpp" break; case 36: /* variableexportlist: variableexportlist ',' variable */ -#line 227 "antimony.ypp" +#line 228 "antimony.ypp" { if (g_registry.AddVariableToCurrentExportList((yyvsp[0].variable))) YYABORT; } -#line 2388 "antimony.tab.cpp" +#line 2380 "antimony.tab.cpp" break; case 37: /* variable: "element name" */ -#line 230 "antimony.ypp" +#line 231 "antimony.ypp" {(yyval.variable) = g_registry.AddVariableToCurrent((yyvsp[0].word)); } -#line 2394 "antimony.tab.cpp" +#line 2386 "antimony.tab.cpp" break; case 38: /* variable: variable '.' "element name" */ -#line 231 "antimony.ypp" +#line 232 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable)->GetSubVariable((yyvsp[0].word)); if ((yyval.variable) == NULL) { g_registry.SetError("'" + *((yyvsp[0].word)) + "' is not a subvariable of '" + (yyvsp[-2].variable)->GetNameDelimitedBy(".") + "'."); YYABORT; } } -#line 2405 "antimony.tab.cpp" +#line 2397 "antimony.tab.cpp" break; case 39: /* variable: '$' variable */ -#line 237 "antimony.ypp" +#line 238 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable); if ((yyval.variable)->SetIsConst(true)) YYABORT;} -#line 2411 "antimony.tab.cpp" +#line 2403 "antimony.tab.cpp" break; case 40: /* variablein: variable "'in'" variable */ -#line 240 "antimony.ypp" +#line 241 "antimony.ypp" {if ((yyvsp[-2].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; (yyval.variable) = (yyvsp[-2].variable);} -#line 2417 "antimony.tab.cpp" +#line 2409 "antimony.tab.cpp" break; case 41: /* varmaybein: variable */ -#line 243 "antimony.ypp" +#line 244 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2423 "antimony.tab.cpp" +#line 2415 "antimony.tab.cpp" break; case 42: /* varmaybein: variablein */ -#line 244 "antimony.ypp" +#line 245 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2429 "antimony.tab.cpp" +#line 2421 "antimony.tab.cpp" break; case 43: /* varmaybeis: varmaybein */ -#line 247 "antimony.ypp" +#line 248 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2435 "antimony.tab.cpp" +#line 2427 "antimony.tab.cpp" break; case 44: /* varmaybeis: varmaybein '=' formula */ -#line 248 "antimony.ypp" +#line 249 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 2441 "antimony.tab.cpp" +#line 2433 "antimony.tab.cpp" break; case 45: /* varmaybeis: varmaybein ':' '=' formula */ -#line 249 "antimony.ypp" +#line 250 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT; } -#line 2447 "antimony.tab.cpp" +#line 2439 "antimony.tab.cpp" break; case 46: /* varmaybeis: varmaybein '\'' '=' formula */ -#line 250 "antimony.ypp" +#line 251 "antimony.ypp" {(yyval.variable) = (yyvsp[-3].variable); if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT; } -#line 2453 "antimony.tab.cpp" +#line 2445 "antimony.tab.cpp" break; case 47: /* varmaybeis: varmaybein "'has'" unitdef */ -#line 251 "antimony.ypp" +#line 252 "antimony.ypp" {(yyval.variable) = (yyvsp[-2].variable); if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 2459 "antimony.tab.cpp" +#line 2451 "antimony.tab.cpp" break; case 48: /* maybein: %empty */ -#line 254 "antimony.ypp" +#line 255 "antimony.ypp" {(yyval.variable) = NULL;} -#line 2465 "antimony.tab.cpp" +#line 2457 "antimony.tab.cpp" break; case 49: /* maybein: "'in'" variable */ -#line 255 "antimony.ypp" +#line 256 "antimony.ypp" {(yyval.variable) = (yyvsp[0].variable);} -#line 2471 "antimony.tab.cpp" +#line 2463 "antimony.tab.cpp" break; case 50: /* modulebody: modulepart */ -#line 258 "antimony.ypp" +#line 259 "antimony.ypp" {} -#line 2477 "antimony.tab.cpp" +#line 2469 "antimony.tab.cpp" break; case 51: /* modulebody: moduleannotation */ -#line 259 "antimony.ypp" +#line 260 "antimony.ypp" {} -#line 2483 "antimony.tab.cpp" +#line 2475 "antimony.tab.cpp" break; case 52: /* modulebody: modulebody modulepart */ -#line 260 "antimony.ypp" +#line 261 "antimony.ypp" {} -#line 2489 "antimony.tab.cpp" +#line 2481 "antimony.tab.cpp" break; case 53: /* modulebody: modulebody moduleannotation */ -#line 261 "antimony.ypp" +#line 262 "antimony.ypp" {} -#line 2495 "antimony.tab.cpp" +#line 2487 "antimony.tab.cpp" break; case 54: /* moduleannotation: "'model' or 'module'" "element name" stringlist lineend */ -#line 265 "antimony.ypp" +#line 266 "antimony.ypp" { string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCVTerm(&modname,(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT; } -#line 2504 "antimony.tab.cpp" +#line 2496 "antimony.tab.cpp" break; case 55: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" stringlist lineend */ -#line 270 "antimony.ypp" +#line 271 "antimony.ypp" { string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT; } -#line 2513 "antimony.tab.cpp" +#line 2505 "antimony.tab.cpp" break; case 56: /* moduleannotation: "'model' or 'module'" "element name" '.' "element name" "number" lineend */ -#line 275 "antimony.ypp" +#line 276 "antimony.ypp" { string modname = g_registry.CurrentModuleName(); if (g_registry.ProcessGlobalCreatorTerm(&modname, (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT; } -#line 2522 "antimony.tab.cpp" +#line 2514 "antimony.tab.cpp" break; case 57: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "number" */ -#line 280 "antimony.ypp" +#line 281 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); @@ -2532,25 +2524,11 @@ yyparse (void) YYABORT; } } -#line 2536 "antimony.tab.cpp" - break; - - case 58: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "element name" */ -#line 290 "antimony.ypp" - { Module* module = g_registry.CurrentModule(); - if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "layout")) { - if (module->SetLayout((yyvsp[0].word))) YYABORT; - } - else { - g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-2].word)) + "'. The only thing that can be set on the model to a string is 'layout'."); - YYABORT; - } - } -#line 2550 "antimony.tab.cpp" +#line 2528 "antimony.tab.cpp" break; - case 59: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' "name of a pre-defined constant" */ -#line 300 "antimony.ypp" + case 58: /* moduleannotation: "'model' or 'module'" '.' "element name" '=' stringConstant */ +#line 291 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "layout")) { if (module->SetLayout((yyvsp[0].word))) YYABORT; @@ -2560,11 +2538,11 @@ yyparse (void) YYABORT; } } -#line 2564 "antimony.tab.cpp" +#line 2542 "antimony.tab.cpp" break; - case 60: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "number" */ -#line 310 "antimony.ypp" + case 59: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "number" */ +#line 301 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; @@ -2578,11 +2556,11 @@ yyparse (void) } module->SetLayout("on"); } -#line 2582 "antimony.tab.cpp" +#line 2560 "antimony.tab.cpp" break; - case 61: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "element name" */ -#line 324 "antimony.ypp" + case 60: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' stringConstant */ +#line 315 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; @@ -2596,29 +2574,11 @@ yyparse (void) } module->SetLayout("on"); } -#line 2600 "antimony.tab.cpp" +#line 2578 "antimony.tab.cpp" break; - case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' "text string" */ -#line 338 "antimony.ypp" - { Module* module = g_registry.CurrentModule(); - if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { - if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; - } - else if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "layout")) { - if (module->SetLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; - } - else { - g_registry.SetError("Invalid syntax 'model." + *((yyvsp[-4].word)) + "'.*: The core word here must be 'layout' or 'autolayout'."); - YYABORT; - } - module->SetLayout("on"); - } -#line 2618 "antimony.tab.cpp" - break; - - case 63: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ -#line 352 "antimony.ypp" + case 61: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ +#line 329 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -2632,11 +2592,11 @@ yyparse (void) } module->SetLayout("on"); } -#line 2636 "antimony.tab.cpp" +#line 2596 "antimony.tab.cpp" break; - case 64: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' numlist '}' */ -#line 366 "antimony.ypp" + case 62: /* moduleannotation: "'model' or 'module'" '.' "element name" '.' "element name" '=' '{' numlist '}' */ +#line 343 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -2650,131 +2610,155 @@ yyparse (void) } module->SetLayout("on"); } -#line 2654 "antimony.tab.cpp" +#line 2614 "antimony.tab.cpp" break; - case 65: /* variablelist: variable */ -#line 381 "antimony.ypp" + case 63: /* stringConstant: "name of a pre-defined constant" */ +#line 358 "antimony.ypp" + {(yyval.word) = (yyvsp[0].word);} +#line 2620 "antimony.tab.cpp" + break; + + case 64: /* stringConstant: "text string" */ +#line 359 "antimony.ypp" + {(yyval.word) = (yyvsp[0].word);} +#line 2626 "antimony.tab.cpp" + break; + + case 65: /* stringConstant: "element name" */ +#line 360 "antimony.ypp" + {(yyval.word) = (yyvsp[0].word);} +#line 2632 "antimony.tab.cpp" + break; + + case 66: /* stringConstant: "name of an existing function" */ +#line 361 "antimony.ypp" + {(yyval.word) = (yyvsp[0].word);} +#line 2638 "antimony.tab.cpp" + break; + + case 67: /* variablelist: variable */ +#line 363 "antimony.ypp" { (yyval.variablelist) = new std::vector(); (yyval.variablelist)->push_back((yyvsp[0].variable));} -#line 2660 "antimony.tab.cpp" +#line 2644 "antimony.tab.cpp" break; - case 66: /* variablelist: variablelist ',' variable */ -#line 382 "antimony.ypp" + case 68: /* variablelist: variablelist ',' variable */ +#line 364 "antimony.ypp" { (yyval.variablelist) = (yyvsp[-2].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } -#line 2666 "antimony.tab.cpp" +#line 2650 "antimony.tab.cpp" break; - case 67: /* variablelist: variablelist ',' '\n' variable */ -#line 383 "antimony.ypp" + case 69: /* variablelist: variablelist ',' '\n' variable */ +#line 365 "antimony.ypp" { (yyval.variablelist) = (yyvsp[-3].variablelist); (yyval.variablelist)->push_back((yyvsp[0].variable)); } -#line 2672 "antimony.tab.cpp" +#line 2656 "antimony.tab.cpp" break; - case 68: /* numlist: "number" */ -#line 386 "antimony.ypp" + case 70: /* numlist: "number" */ +#line 368 "antimony.ypp" { (yyval.numlist) = new std::vector(); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2678 "antimony.tab.cpp" +#line 2662 "antimony.tab.cpp" break; - case 69: /* numlist: numlist ',' "number" */ -#line 387 "antimony.ypp" + case 71: /* numlist: numlist ',' "number" */ +#line 369 "antimony.ypp" { (yyval.numlist) = (yyvsp[-2].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2684 "antimony.tab.cpp" +#line 2668 "antimony.tab.cpp" break; - case 70: /* numlist: numlist ',' '\n' "number" */ -#line 388 "antimony.ypp" + case 72: /* numlist: numlist ',' '\n' "number" */ +#line 370 "antimony.ypp" { (yyval.numlist) = (yyvsp[-3].numlist); (yyval.numlist)->push_back((yyvsp[0].num)); } -#line 2690 "antimony.tab.cpp" +#line 2674 "antimony.tab.cpp" break; - case 71: /* modulepart: reaction lineend */ -#line 391 "antimony.ypp" + case 73: /* modulepart: reaction lineend */ +#line 373 "antimony.ypp" {} -#line 2696 "antimony.tab.cpp" +#line 2680 "antimony.tab.cpp" break; - case 72: /* modulepart: assignment lineend */ -#line 392 "antimony.ypp" + case 74: /* modulepart: assignment lineend */ +#line 374 "antimony.ypp" {} -#line 2702 "antimony.tab.cpp" +#line 2686 "antimony.tab.cpp" break; - case 73: /* modulepart: submodule lineend */ -#line 393 "antimony.ypp" + case 75: /* modulepart: submodule lineend */ +#line 375 "antimony.ypp" {} -#line 2708 "antimony.tab.cpp" +#line 2692 "antimony.tab.cpp" break; - case 74: /* modulepart: varinitialize lineend */ -#line 394 "antimony.ypp" + case 76: /* modulepart: varinitialize lineend */ +#line 376 "antimony.ypp" {} -#line 2714 "antimony.tab.cpp" +#line 2698 "antimony.tab.cpp" break; - case 75: /* modulepart: dnadef lineend */ -#line 395 "antimony.ypp" + case 77: /* modulepart: dnadef lineend */ +#line 377 "antimony.ypp" {} -#line 2720 "antimony.tab.cpp" +#line 2704 "antimony.tab.cpp" break; - case 76: /* modulepart: event lineend */ -#line 396 "antimony.ypp" + case 78: /* modulepart: event lineend */ +#line 378 "antimony.ypp" {} -#line 2726 "antimony.tab.cpp" +#line 2710 "antimony.tab.cpp" break; - case 77: /* modulepart: unitinit lineend */ -#line 397 "antimony.ypp" + case 79: /* modulepart: unitinit lineend */ +#line 379 "antimony.ypp" {} -#line 2732 "antimony.tab.cpp" +#line 2716 "antimony.tab.cpp" break; - case 78: /* modulepart: deletion lineend */ -#line 398 "antimony.ypp" + case 80: /* modulepart: deletion lineend */ +#line 380 "antimony.ypp" {} -#line 2738 "antimony.tab.cpp" +#line 2722 "antimony.tab.cpp" break; - case 79: /* modulepart: cvterm lineend */ -#line 399 "antimony.ypp" + case 81: /* modulepart: cvterm lineend */ +#line 381 "antimony.ypp" {} -#line 2744 "antimony.tab.cpp" +#line 2728 "antimony.tab.cpp" break; - case 80: /* modulepart: variablein */ -#line 400 "antimony.ypp" + case 82: /* modulepart: variablein */ +#line 382 "antimony.ypp" {} -#line 2750 "antimony.tab.cpp" +#line 2734 "antimony.tab.cpp" break; - case 81: /* modulepart: constraint lineend */ -#line 401 "antimony.ypp" + case 83: /* modulepart: constraint lineend */ +#line 383 "antimony.ypp" {} -#line 2756 "antimony.tab.cpp" +#line 2740 "antimony.tab.cpp" break; - case 82: /* modulepart: objective lineend */ -#line 402 "antimony.ypp" + case 84: /* modulepart: objective lineend */ +#line 384 "antimony.ypp" {} -#line 2762 "antimony.tab.cpp" +#line 2746 "antimony.tab.cpp" break; - case 83: /* modulepart: algrule lineend */ -#line 403 "antimony.ypp" + case 85: /* modulepart: algrule lineend */ +#line 385 "antimony.ypp" {} -#line 2768 "antimony.tab.cpp" +#line 2752 "antimony.tab.cpp" break; - case 84: /* modulepart: lineend */ -#line 404 "antimony.ypp" + case 86: /* modulepart: lineend */ +#line 386 "antimony.ypp" {} -#line 2774 "antimony.tab.cpp" +#line 2758 "antimony.tab.cpp" break; - case 85: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ -#line 408 "antimony.ypp" + case 87: /* reaction: varmaybein ':' reactantList reactionDivider reactantList ';' formula maybein */ +#line 390 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-7].variable), 0); if (var == NULL) YYABORT; @@ -2782,11 +2766,11 @@ yyparse (void) if ((yyvsp[-7].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2786 "antimony.tab.cpp" +#line 2770 "antimony.tab.cpp" break; - case 86: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ -#line 416 "antimony.ypp" + case 88: /* reaction: reactantList reactionDivider reactantList ';' formula maybein */ +#line 398 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 0); if (var == NULL) YYABORT; @@ -2794,11 +2778,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2798 "antimony.tab.cpp" +#line 2782 "antimony.tab.cpp" break; - case 87: /* reaction: reactantList reactionDivider ';' formula maybein */ -#line 424 "antimony.ypp" + case 89: /* reaction: reactantList reactionDivider ';' formula maybein */ +#line 406 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), 1); if (var == NULL) YYABORT; @@ -2806,11 +2790,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2810 "antimony.tab.cpp" +#line 2794 "antimony.tab.cpp" break; - case 88: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ -#line 432 "antimony.ypp" + case 90: /* reaction: varmaybein ':' reactantList reactionDivider ';' formula maybein */ +#line 414 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-3].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 1); if (var == NULL) YYABORT; @@ -2818,11 +2802,11 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2822 "antimony.tab.cpp" +#line 2806 "antimony.tab.cpp" break; - case 89: /* reaction: reactionDivider reactantList ';' formula maybein */ -#line 440 "antimony.ypp" + case 91: /* reaction: reactionDivider reactantList ';' formula maybein */ +#line 422 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), 2); if (var == NULL) YYABORT; @@ -2830,11 +2814,11 @@ yyparse (void) if (var->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2834 "antimony.tab.cpp" +#line 2818 "antimony.tab.cpp" break; - case 90: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ -#line 448 "antimony.ypp" + case 92: /* reaction: varmaybein ':' reactionDivider reactantList ';' formula maybein */ +#line 430 "antimony.ypp" { Variable* var = g_registry.AddNewReactionToCurrent((yyvsp[-4].reactionDivider), (yyvsp[-1].formula), (yyvsp[-6].variable), 2); if (var == NULL) YYABORT; @@ -2842,867 +2826,867 @@ yyparse (void) if ((yyvsp[-6].variable)->SetCompartment((yyvsp[0].variable))) YYABORT; } } -#line 2846 "antimony.tab.cpp" +#line 2830 "antimony.tab.cpp" break; - case 91: /* reactantList: variable */ -#line 457 "antimony.ypp" + case 93: /* reactantList: variable */ +#line 439 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2852 "antimony.tab.cpp" +#line 2836 "antimony.tab.cpp" break; - case 92: /* reactantList: "number" variable */ -#line 458 "antimony.ypp" + case 94: /* reactantList: "number" variable */ +#line 440 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2858 "antimony.tab.cpp" +#line 2842 "antimony.tab.cpp" break; - case 93: /* reactantList: variable variable */ -#line 459 "antimony.ypp" + case 95: /* reactantList: variable variable */ +#line 441 "antimony.ypp" {(yyval.reactantList) = g_registry.NewBlankReactantList(); if((yyval.reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2864 "antimony.tab.cpp" +#line 2848 "antimony.tab.cpp" break; - case 94: /* reactantList: reactantList '+' variable */ -#line 460 "antimony.ypp" + case 96: /* reactantList: reactantList '+' variable */ +#line 442 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-2].reactantList); if((yyvsp[-2].reactantList)->AddReactant((yyvsp[0].variable))) YYABORT; } -#line 2870 "antimony.tab.cpp" +#line 2854 "antimony.tab.cpp" break; - case 95: /* reactantList: reactantList '+' "number" variable */ -#line 461 "antimony.ypp" + case 97: /* reactantList: reactantList '+' "number" variable */ +#line 443 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].num))) YYABORT; } -#line 2876 "antimony.tab.cpp" +#line 2860 "antimony.tab.cpp" break; - case 96: /* reactantList: reactantList '+' variable variable */ -#line 462 "antimony.ypp" + case 98: /* reactantList: reactantList '+' variable variable */ +#line 444 "antimony.ypp" {(yyval.reactantList) = (yyvsp[-3].reactantList); if((yyvsp[-3].reactantList)->AddReactant((yyvsp[0].variable), (yyvsp[-1].variable))) YYABORT; } -#line 2882 "antimony.tab.cpp" +#line 2866 "antimony.tab.cpp" break; - case 97: /* reactionDivider: "->" */ -#line 466 "antimony.ypp" + case 99: /* reactionDivider: "->" */ +#line 448 "antimony.ypp" {(yyval.reactionDivider) = rdBecomes;} -#line 2888 "antimony.tab.cpp" +#line 2872 "antimony.tab.cpp" break; - case 98: /* reactionDivider: "-|" */ -#line 467 "antimony.ypp" + case 100: /* reactionDivider: "-|" */ +#line 449 "antimony.ypp" {(yyval.reactionDivider) = rdInhibits;} -#line 2894 "antimony.tab.cpp" +#line 2878 "antimony.tab.cpp" break; - case 99: /* reactionDivider: '-' '(' */ -#line 468 "antimony.ypp" + case 101: /* reactionDivider: '-' '(' */ +#line 450 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2900 "antimony.tab.cpp" +#line 2884 "antimony.tab.cpp" break; - case 100: /* reactionDivider: "-o" */ -#line 469 "antimony.ypp" + case 102: /* reactionDivider: "-o" */ +#line 451 "antimony.ypp" {(yyval.reactionDivider) = rdInfluences;} -#line 2906 "antimony.tab.cpp" +#line 2890 "antimony.tab.cpp" break; - case 101: /* reactionDivider: "=>" */ -#line 470 "antimony.ypp" + case 103: /* reactionDivider: "=>" */ +#line 452 "antimony.ypp" {(yyval.reactionDivider) = rdBecomesIrreversibly;} -#line 2912 "antimony.tab.cpp" +#line 2896 "antimony.tab.cpp" break; - case 102: /* formula: %empty */ -#line 473 "antimony.ypp" + case 104: /* formula: %empty */ +#line 455 "antimony.ypp" {(yyval.formula) = g_registry.NewBlankFormula(); } -#line 2918 "antimony.tab.cpp" +#line 2902 "antimony.tab.cpp" break; - case 103: /* formula: formula "..." */ -#line 474 "antimony.ypp" + case 105: /* formula: formula "..." */ +#line 456 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddEllipses();} -#line 2924 "antimony.tab.cpp" +#line 2908 "antimony.tab.cpp" break; - case 104: /* formula: formula variable */ -#line 475 "antimony.ypp" + case 106: /* formula: formula variable */ +#line 457 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); if((yyvsp[-1].formula)->AddVariable((yyvsp[0].variable))) YYABORT; } -#line 2930 "antimony.tab.cpp" +#line 2914 "antimony.tab.cpp" break; - case 105: /* formula: formula "number" */ -#line 476 "antimony.ypp" + case 107: /* formula: formula "number" */ +#line 458 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddNum((yyvsp[0].num)); } -#line 2936 "antimony.tab.cpp" +#line 2920 "antimony.tab.cpp" break; - case 106: /* formula: formula "name of a pre-defined constant" */ -#line 477 "antimony.ypp" + case 108: /* formula: formula "name of a pre-defined constant" */ +#line 459 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2942 "antimony.tab.cpp" +#line 2926 "antimony.tab.cpp" break; - case 107: /* formula: formula "name of an existing function" */ -#line 478 "antimony.ypp" + case 109: /* formula: formula "name of an existing function" */ +#line 460 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word)); } -#line 2948 "antimony.tab.cpp" +#line 2932 "antimony.tab.cpp" break; - case 108: /* formula: formula '(' commaformula ')' */ -#line 479 "antimony.ypp" + case 110: /* formula: formula '(' commaformula ')' */ +#line 461 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddParentheses(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2954 "antimony.tab.cpp" +#line 2938 "antimony.tab.cpp" break; - case 109: /* formula: formula '{' commaformula '}' */ -#line 480 "antimony.ypp" + case 111: /* formula: formula '{' commaformula '}' */ +#line 462 "antimony.ypp" {(yyval.formula) = (yyvsp[-3].formula); (yyvsp[-1].formula)->AddCurlyBrackets(); (yyval.formula)->AddFormula((yyvsp[-1].formula)); } -#line 2960 "antimony.tab.cpp" +#line 2944 "antimony.tab.cpp" break; - case 110: /* formula: formula mathThing */ -#line 481 "antimony.ypp" + case 112: /* formula: formula mathThing */ +#line 463 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddMathThing((yyvsp[0].character)); } -#line 2966 "antimony.tab.cpp" +#line 2950 "antimony.tab.cpp" break; - case 111: /* formula: formula inequality */ -#line 482 "antimony.ypp" + case 113: /* formula: formula inequality */ +#line 464 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddInequality((yyvsp[0].inequality)); } -#line 2972 "antimony.tab.cpp" +#line 2956 "antimony.tab.cpp" break; - case 112: /* formula: formula '=' '=' */ -#line 483 "antimony.ypp" + case 114: /* formula: formula '=' '=' */ +#line 465 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('='); (yyvsp[-2].formula)->AddMathThing('='); } -#line 2978 "antimony.tab.cpp" +#line 2962 "antimony.tab.cpp" break; - case 113: /* formula: formula '&' '&' */ -#line 484 "antimony.ypp" + case 115: /* formula: formula '&' '&' */ +#line 466 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('&'); (yyvsp[-2].formula)->AddMathThing('&'); } -#line 2984 "antimony.tab.cpp" +#line 2968 "antimony.tab.cpp" break; - case 114: /* formula: formula '|' '|' */ -#line 485 "antimony.ypp" + case 116: /* formula: formula '|' '|' */ +#line 467 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyvsp[-2].formula)->AddMathThing('|'); (yyvsp[-2].formula)->AddMathThing('|'); } -#line 2990 "antimony.tab.cpp" +#line 2974 "antimony.tab.cpp" break; - case 115: /* formula: formula "text string" */ -#line 486 "antimony.ypp" + case 117: /* formula: formula "text string" */ +#line 468 "antimony.ypp" {(yyval.formula) = (yyvsp[-1].formula); (yyvsp[-1].formula)->AddText((yyvsp[0].word), true); } -#line 2996 "antimony.tab.cpp" +#line 2980 "antimony.tab.cpp" break; - case 116: /* commaformula: formula */ -#line 489 "antimony.ypp" + case 118: /* commaformula: formula */ +#line 471 "antimony.ypp" {(yyval.formula) = (yyvsp[0].formula);} -#line 3002 "antimony.tab.cpp" +#line 2986 "antimony.tab.cpp" break; - case 117: /* commaformula: commaformula ',' formula */ -#line 490 "antimony.ypp" + case 119: /* commaformula: commaformula ',' formula */ +#line 472 "antimony.ypp" {(yyval.formula) = (yyvsp[-2].formula); (yyval.formula)->AddMathThing(','); (yyval.formula)->AddFormula((yyvsp[0].formula)); } -#line 3008 "antimony.tab.cpp" +#line 2992 "antimony.tab.cpp" break; - case 118: /* mathThing: '+' */ -#line 493 "antimony.ypp" + case 120: /* mathThing: '+' */ +#line 475 "antimony.ypp" {(yyval.character) = '+';} -#line 3014 "antimony.tab.cpp" +#line 2998 "antimony.tab.cpp" break; - case 119: /* mathThing: '-' */ -#line 494 "antimony.ypp" + case 121: /* mathThing: '-' */ +#line 476 "antimony.ypp" {(yyval.character) = '-';} -#line 3020 "antimony.tab.cpp" +#line 3004 "antimony.tab.cpp" break; - case 120: /* mathThing: '*' */ -#line 495 "antimony.ypp" + case 122: /* mathThing: '*' */ +#line 477 "antimony.ypp" {(yyval.character) = '*';} -#line 3026 "antimony.tab.cpp" +#line 3010 "antimony.tab.cpp" break; - case 121: /* mathThing: '/' */ -#line 496 "antimony.ypp" + case 123: /* mathThing: '/' */ +#line 478 "antimony.ypp" {(yyval.character) = '/';} -#line 3032 "antimony.tab.cpp" +#line 3016 "antimony.tab.cpp" break; - case 122: /* mathThing: '^' */ -#line 497 "antimony.ypp" + case 124: /* mathThing: '^' */ +#line 479 "antimony.ypp" {(yyval.character) = '^';} -#line 3038 "antimony.tab.cpp" +#line 3022 "antimony.tab.cpp" break; - case 123: /* mathThing: '!' */ -#line 498 "antimony.ypp" + case 125: /* mathThing: '!' */ +#line 480 "antimony.ypp" {(yyval.character) = '!';} -#line 3044 "antimony.tab.cpp" +#line 3028 "antimony.tab.cpp" break; - case 124: /* mathThing: '%' */ -#line 499 "antimony.ypp" + case 126: /* mathThing: '%' */ +#line 481 "antimony.ypp" {(yyval.character) = '%';} -#line 3050 "antimony.tab.cpp" +#line 3034 "antimony.tab.cpp" break; - case 125: /* inequality: '<' */ -#line 502 "antimony.ypp" + case 127: /* inequality: '<' */ +#line 484 "antimony.ypp" {(yyval.inequality) = constLT;} -#line 3056 "antimony.tab.cpp" +#line 3040 "antimony.tab.cpp" break; - case 126: /* inequality: "<=" */ -#line 503 "antimony.ypp" + case 128: /* inequality: "<=" */ +#line 485 "antimony.ypp" {(yyval.inequality) = constLEQ;} -#line 3062 "antimony.tab.cpp" +#line 3046 "antimony.tab.cpp" break; - case 127: /* inequality: '>' */ -#line 504 "antimony.ypp" + case 129: /* inequality: '>' */ +#line 486 "antimony.ypp" {(yyval.inequality) = constGT;} -#line 3068 "antimony.tab.cpp" +#line 3052 "antimony.tab.cpp" break; - case 128: /* inequality: ">=" */ -#line 505 "antimony.ypp" + case 130: /* inequality: ">=" */ +#line 487 "antimony.ypp" {(yyval.inequality) = constGEQ;} -#line 3074 "antimony.tab.cpp" +#line 3058 "antimony.tab.cpp" break; - case 129: /* inequality: "!=" */ -#line 506 "antimony.ypp" + case 131: /* inequality: "!=" */ +#line 488 "antimony.ypp" {(yyval.inequality) = constNEQ;} -#line 3080 "antimony.tab.cpp" +#line 3064 "antimony.tab.cpp" break; - case 130: /* lineend: ';' */ -#line 509 "antimony.ypp" + case 132: /* lineend: ';' */ +#line 491 "antimony.ypp" {} -#line 3086 "antimony.tab.cpp" +#line 3070 "antimony.tab.cpp" break; - case 131: /* lineend: '\n' */ -#line 510 "antimony.ypp" + case 133: /* lineend: '\n' */ +#line 492 "antimony.ypp" {} -#line 3092 "antimony.tab.cpp" +#line 3076 "antimony.tab.cpp" break; - case 132: /* lineend: "end of line" */ -#line 511 "antimony.ypp" + case 134: /* lineend: "end of line" */ +#line 493 "antimony.ypp" {} -#line 3098 "antimony.tab.cpp" +#line 3082 "antimony.tab.cpp" break; - case 133: /* assignment: varmaybein ':' maxormin formula */ -#line 514 "antimony.ypp" + case 135: /* assignment: varmaybein ':' maxormin formula */ +#line 496 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[-3].variable), (yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3104 "antimony.tab.cpp" +#line 3088 "antimony.tab.cpp" break; - case 134: /* assignment: varmaybein '=' formula */ -#line 515 "antimony.ypp" + case 136: /* assignment: varmaybein '=' formula */ +#line 497 "antimony.ypp" {if ((yyvsp[-2].variable)->SetFormula((yyvsp[0].formula))) YYABORT; } -#line 3110 "antimony.tab.cpp" +#line 3094 "antimony.tab.cpp" break; - case 135: /* assignment: varmaybein "'is'" variable */ -#line 516 "antimony.ypp" + case 137: /* assignment: varmaybein "'is'" variable */ +#line 498 "antimony.ypp" {if ((yyvsp[-2].variable)->Synchronize((yyvsp[0].variable), NULL)) YYABORT;} -#line 3116 "antimony.tab.cpp" +#line 3100 "antimony.tab.cpp" break; - case 136: /* assignment: varmaybein "'is'" variable '/' variable */ -#line 517 "antimony.ypp" + case 138: /* assignment: varmaybein "'is'" variable '/' variable */ +#line 499 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[-2].variable), (yyvsp[0].variable))) YYABORT;} -#line 3122 "antimony.tab.cpp" +#line 3106 "antimony.tab.cpp" break; - case 137: /* assignment: varmaybein '*' variable "'is'" variable */ -#line 518 "antimony.ypp" + case 139: /* assignment: varmaybein '*' variable "'is'" variable */ +#line 500 "antimony.ypp" {if ((yyvsp[-4].variable)->Synchronize((yyvsp[0].variable), (yyvsp[-2].variable))) YYABORT;} -#line 3128 "antimony.tab.cpp" +#line 3112 "antimony.tab.cpp" break; - case 138: /* assignment: varmaybein "'is'" "text string" */ -#line 519 "antimony.ypp" + case 140: /* assignment: varmaybein "'is'" "text string" */ +#line 501 "antimony.ypp" {if ((yyvsp[-2].variable)->SetDisplayName(*((yyvsp[0].word)))) YYABORT;} -#line 3134 "antimony.tab.cpp" +#line 3118 "antimony.tab.cpp" break; - case 139: /* assignment: varmaybein ':' '=' formula */ -#line 520 "antimony.ypp" + case 141: /* assignment: varmaybein ':' '=' formula */ +#line 502 "antimony.ypp" {if ((yyvsp[-3].variable)->SetAssignmentRule((yyvsp[0].formula))) YYABORT;} -#line 3140 "antimony.tab.cpp" +#line 3124 "antimony.tab.cpp" break; - case 140: /* assignment: varmaybein '\'' '=' formula */ -#line 521 "antimony.ypp" + case 142: /* assignment: varmaybein '\'' '=' formula */ +#line 503 "antimony.ypp" {if ((yyvsp[-3].variable)->SetRateRule((yyvsp[0].formula))) YYABORT;} -#line 3146 "antimony.tab.cpp" +#line 3130 "antimony.tab.cpp" break; - case 141: /* assignment: varmaybein "'has'" unitdef */ -#line 522 "antimony.ypp" + case 143: /* assignment: varmaybein "'has'" unitdef */ +#line 504 "antimony.ypp" {if ((yyvsp[-2].variable)->SetUnit((yyvsp[0].variable))) YYABORT; } -#line 3152 "antimony.tab.cpp" +#line 3136 "antimony.tab.cpp" break; - case 142: /* algrule: "number" '=' formula */ -#line 525 "antimony.ypp" + case 144: /* algrule: "number" '=' formula */ +#line 507 "antimony.ypp" {if (g_registry.AddNewAlgebraicRuleToCurrent((yyvsp[-2].num), (yyvsp[0].formula))) YYABORT; } -#line 3158 "antimony.tab.cpp" +#line 3142 "antimony.tab.cpp" break; - case 143: /* algrule: varmaybein ':' "number" '=' formula */ -#line 526 "antimony.ypp" + case 145: /* algrule: varmaybein ':' "number" '=' formula */ +#line 508 "antimony.ypp" {if ((yyvsp[-4].variable)->SetAlgebraicRule((yyvsp[-2].num), (yyvsp[0].formula)) ) YYABORT;} -#line 3164 "antimony.tab.cpp" +#line 3148 "antimony.tab.cpp" break; - case 144: /* $@6: %empty */ -#line 529 "antimony.ypp" + case 146: /* $@6: %empty */ +#line 511 "antimony.ypp" {if ((yyvsp[-3].variable)->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3170 "antimony.tab.cpp" +#line 3154 "antimony.tab.cpp" break; - case 145: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ -#line 529 "antimony.ypp" + case 147: /* submodule: varmaybein ':' "name of an existing module" '(' $@6 variableimportlist ')' submodifications maybein */ +#line 511 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if ((yyvsp[-8].variable)->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3176 "antimony.tab.cpp" +#line 3160 "antimony.tab.cpp" break; - case 146: /* $@7: %empty */ -#line 530 "antimony.ypp" + case 148: /* $@7: %empty */ +#line 512 "antimony.ypp" {if(g_registry.CurrentModule()->SetModule((yyvsp[-1].word))) YYABORT;} -#line 3182 "antimony.tab.cpp" +#line 3166 "antimony.tab.cpp" break; - case 147: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ -#line 530 "antimony.ypp" + case 149: /* submodule: "name of an existing module" '(' $@7 variableimportlist ')' submodifications maybein */ +#line 512 "antimony.ypp" {if ((yyvsp[0].variable) != NULL) {if (g_registry.GetCurrentSubmodel()->SetCompartment((yyvsp[0].variable))) YYABORT;}} -#line 3188 "antimony.tab.cpp" +#line 3172 "antimony.tab.cpp" break; - case 148: /* variableimportlist: %empty */ -#line 534 "antimony.ypp" + case 150: /* variableimportlist: %empty */ +#line 516 "antimony.ypp" {} -#line 3194 "antimony.tab.cpp" +#line 3178 "antimony.tab.cpp" break; - case 149: /* variableimportlist: variable */ -#line 535 "antimony.ypp" + case 151: /* variableimportlist: variable */ +#line 517 "antimony.ypp" {if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3200 "antimony.tab.cpp" +#line 3184 "antimony.tab.cpp" break; - case 150: /* variableimportlist: variableimportlist ',' variable */ -#line 536 "antimony.ypp" + case 152: /* variableimportlist: variableimportlist ',' variable */ +#line 518 "antimony.ypp" { if (g_registry.AddVariableToCurrentImportList((yyvsp[0].variable))) YYABORT; } -#line 3206 "antimony.tab.cpp" +#line 3190 "antimony.tab.cpp" break; - case 151: /* variableimportlist: "number" */ -#line 537 "antimony.ypp" + case 153: /* variableimportlist: "number" */ +#line 519 "antimony.ypp" {if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3212 "antimony.tab.cpp" +#line 3196 "antimony.tab.cpp" break; - case 152: /* variableimportlist: variableimportlist ',' "number" */ -#line 538 "antimony.ypp" + case 154: /* variableimportlist: variableimportlist ',' "number" */ +#line 520 "antimony.ypp" { if (g_registry.AddNumberToCurrentImportList((yyvsp[0].num))) YYABORT; } -#line 3218 "antimony.tab.cpp" +#line 3202 "antimony.tab.cpp" break; - case 153: /* submodifications: %empty */ -#line 542 "antimony.ypp" + case 155: /* submodifications: %empty */ +#line 524 "antimony.ypp" {} -#line 3224 "antimony.tab.cpp" +#line 3208 "antimony.tab.cpp" break; - case 154: /* submodifications: submodifications ',' "element name" '=' variable */ -#line 543 "antimony.ypp" + case 156: /* submodifications: submodifications ',' "element name" '=' variable */ +#line 525 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].variable));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].variable))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3232 "antimony.tab.cpp" +#line 3216 "antimony.tab.cpp" break; - case 155: /* submodifications: submodifications ',' "element name" '=' "number" */ -#line 547 "antimony.ypp" + case 157: /* submodifications: submodifications ',' "element name" '=' "number" */ +#line 529 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "extentconv")) {g_registry.GetCurrentSubmodel()->SetExtentConversionFactor((yyvsp[0].num));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "timeconv")) {if (g_registry.GetCurrentSubmodel()->SetTimeConversionFactor((yyvsp[0].num))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in submodel declaration. You may use the terms 'extentconv' and 'timeconv' to set the extent and time conversion factors for this submodel, respectively."); YYABORT;}} -#line 3240 "antimony.tab.cpp" +#line 3224 "antimony.tab.cpp" break; - case 156: /* varinitialize: specinit */ -#line 551 "antimony.ypp" + case 158: /* varinitialize: specinit */ +#line 533 "antimony.ypp" { } -#line 3246 "antimony.tab.cpp" +#line 3230 "antimony.tab.cpp" break; - case 157: /* varinitialize: formulainit */ -#line 552 "antimony.ypp" + case 159: /* varinitialize: formulainit */ +#line 534 "antimony.ypp" { } -#line 3252 "antimony.tab.cpp" +#line 3236 "antimony.tab.cpp" break; - case 158: /* varinitialize: reactioninit */ -#line 553 "antimony.ypp" + case 160: /* varinitialize: reactioninit */ +#line 535 "antimony.ypp" { } -#line 3258 "antimony.tab.cpp" +#line 3242 "antimony.tab.cpp" break; - case 159: /* varinitialize: dnainit */ -#line 554 "antimony.ypp" + case 161: /* varinitialize: dnainit */ +#line 536 "antimony.ypp" { } -#line 3264 "antimony.tab.cpp" +#line 3248 "antimony.tab.cpp" break; - case 160: /* varinitialize: geneinit */ -#line 555 "antimony.ypp" + case 162: /* varinitialize: geneinit */ +#line 537 "antimony.ypp" { } -#line 3270 "antimony.tab.cpp" +#line 3254 "antimony.tab.cpp" break; - case 161: /* varinitialize: operatorinit */ -#line 556 "antimony.ypp" + case 163: /* varinitialize: operatorinit */ +#line 538 "antimony.ypp" { } -#line 3276 "antimony.tab.cpp" +#line 3260 "antimony.tab.cpp" break; - case 162: /* varinitialize: compartmentinit */ -#line 557 "antimony.ypp" + case 164: /* varinitialize: compartmentinit */ +#line 539 "antimony.ypp" { } -#line 3282 "antimony.tab.cpp" +#line 3266 "antimony.tab.cpp" break; - case 163: /* varinitialize: varconstinit */ -#line 558 "antimony.ypp" + case 165: /* varinitialize: varconstinit */ +#line 540 "antimony.ypp" { } -#line 3288 "antimony.tab.cpp" +#line 3272 "antimony.tab.cpp" break; - case 164: /* specinit: "'species'" varmaybeis */ -#line 561 "antimony.ypp" + case 166: /* specinit: "'species'" varmaybeis */ +#line 543 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3294 "antimony.tab.cpp" +#line 3278 "antimony.tab.cpp" break; - case 165: /* specinit: "'var'" "'species'" varmaybeis */ -#line 562 "antimony.ypp" + case 167: /* specinit: "'var'" "'species'" varmaybeis */ +#line 544 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3300 "antimony.tab.cpp" +#line 3284 "antimony.tab.cpp" break; - case 166: /* specinit: "'const'" "'species'" varmaybeis */ -#line 563 "antimony.ypp" + case 168: /* specinit: "'const'" "'species'" varmaybeis */ +#line 545 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(false); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3306 "antimony.tab.cpp" +#line 3290 "antimony.tab.cpp" break; - case 167: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ -#line 564 "antimony.ypp" + case 169: /* specinit: "'substanceOnly'" "'species'" varmaybeis */ +#line 546 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3312 "antimony.tab.cpp" +#line 3296 "antimony.tab.cpp" break; - case 168: /* specinit: "'substanceOnly'" varmaybeis */ -#line 565 "antimony.ypp" + case 170: /* specinit: "'substanceOnly'" varmaybeis */ +#line 547 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3318 "antimony.tab.cpp" +#line 3302 "antimony.tab.cpp" break; - case 169: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ -#line 566 "antimony.ypp" + case 171: /* specinit: "'var'" "'substanceOnly'" "'species'" varmaybeis */ +#line 548 "antimony.ypp" {g_registry.SetConstness(constVAR); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3324 "antimony.tab.cpp" +#line 3308 "antimony.tab.cpp" break; - case 170: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ -#line 567 "antimony.ypp" + case 172: /* specinit: "'const'" "'substanceOnly'" "'species'" varmaybeis */ +#line 549 "antimony.ypp" {g_registry.SetConstness(constCONST); g_registry.SetSubstOnly(true); (yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3330 "antimony.tab.cpp" +#line 3314 "antimony.tab.cpp" break; - case 171: /* specinit: specinit ',' varmaybeis */ -#line 568 "antimony.ypp" + case 173: /* specinit: specinit ',' varmaybeis */ +#line 550 "antimony.ypp" {(yyvsp[0].variable)->SetRegSpecVals(); if ((yyvsp[0].variable)->SetType(varSpeciesUndef)) YYABORT; } -#line 3336 "antimony.tab.cpp" +#line 3320 "antimony.tab.cpp" break; - case 172: /* specinit: "'species'" '.' "element name" '=' formula */ -#line 569 "antimony.ypp" + case 174: /* specinit: "'species'" '.' "element name" '=' formula */ +#line 551 "antimony.ypp" {if (g_registry.CurrentModule()->AddSpeciesLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} -#line 3342 "antimony.tab.cpp" +#line 3326 "antimony.tab.cpp" break; - case 173: /* formulainit: "'formula'" varmaybeis */ -#line 572 "antimony.ypp" + case 175: /* formulainit: "'formula'" varmaybeis */ +#line 554 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3348 "antimony.tab.cpp" +#line 3332 "antimony.tab.cpp" break; - case 174: /* formulainit: "'var'" "'formula'" varmaybeis */ -#line 573 "antimony.ypp" + case 176: /* formulainit: "'var'" "'formula'" varmaybeis */ +#line 555 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3354 "antimony.tab.cpp" +#line 3338 "antimony.tab.cpp" break; - case 175: /* formulainit: "'const'" "'formula'" varmaybeis */ -#line 574 "antimony.ypp" + case 177: /* formulainit: "'const'" "'formula'" varmaybeis */ +#line 556 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3360 "antimony.tab.cpp" +#line 3344 "antimony.tab.cpp" break; - case 176: /* formulainit: formulainit ',' varmaybeis */ -#line 575 "antimony.ypp" + case 178: /* formulainit: formulainit ',' varmaybeis */ +#line 557 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaUndef)) YYABORT; } -#line 3366 "antimony.tab.cpp" +#line 3350 "antimony.tab.cpp" break; - case 177: /* reactioninit: "'reaction'" varmaybeis */ -#line 578 "antimony.ypp" + case 179: /* reactioninit: "'reaction'" varmaybeis */ +#line 560 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3372 "antimony.tab.cpp" +#line 3356 "antimony.tab.cpp" break; - case 178: /* reactioninit: "'var'" "'reaction'" varmaybeis */ -#line 579 "antimony.ypp" + case 180: /* reactioninit: "'var'" "'reaction'" varmaybeis */ +#line 561 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3378 "antimony.tab.cpp" +#line 3362 "antimony.tab.cpp" break; - case 179: /* reactioninit: "'const'" "'reaction'" */ -#line 580 "antimony.ypp" + case 181: /* reactioninit: "'const'" "'reaction'" */ +#line 562 "antimony.ypp" {g_registry.SetError("Reactions may not be set 'const'."); YYABORT; } -#line 3384 "antimony.tab.cpp" +#line 3368 "antimony.tab.cpp" break; - case 180: /* reactioninit: reactioninit ',' varmaybeis */ -#line 581 "antimony.ypp" + case 182: /* reactioninit: reactioninit ',' varmaybeis */ +#line 563 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionUndef)) YYABORT; } -#line 3390 "antimony.tab.cpp" +#line 3374 "antimony.tab.cpp" break; - case 181: /* reactioninit: "'reaction'" '.' "element name" '=' formula */ -#line 582 "antimony.ypp" + case 183: /* reactioninit: "'reaction'" '.' "element name" '=' formula */ +#line 564 "antimony.ypp" {if (g_registry.CurrentModule()->AddReactionLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} -#line 3396 "antimony.tab.cpp" +#line 3380 "antimony.tab.cpp" break; - case 182: /* dnainit: "'DNA'" varmaybeis */ -#line 585 "antimony.ypp" + case 184: /* dnainit: "'DNA'" varmaybeis */ +#line 567 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3402 "antimony.tab.cpp" +#line 3386 "antimony.tab.cpp" break; - case 183: /* dnainit: "'var'" "'DNA'" varmaybeis */ -#line 586 "antimony.ypp" + case 185: /* dnainit: "'var'" "'DNA'" varmaybeis */ +#line 568 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3408 "antimony.tab.cpp" +#line 3392 "antimony.tab.cpp" break; - case 184: /* dnainit: "'const'" "'DNA'" varmaybeis */ -#line 587 "antimony.ypp" + case 186: /* dnainit: "'const'" "'DNA'" varmaybeis */ +#line 569 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3414 "antimony.tab.cpp" +#line 3398 "antimony.tab.cpp" break; - case 185: /* dnainit: dnainit ',' varmaybeis */ -#line 588 "antimony.ypp" + case 187: /* dnainit: dnainit ',' varmaybeis */ +#line 570 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varDNA)) YYABORT; } -#line 3420 "antimony.tab.cpp" +#line 3404 "antimony.tab.cpp" break; - case 186: /* geneinit: "'gene'" varmaybeis */ -#line 591 "antimony.ypp" + case 188: /* geneinit: "'gene'" varmaybeis */ +#line 573 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3426 "antimony.tab.cpp" +#line 3410 "antimony.tab.cpp" break; - case 187: /* geneinit: "'var'" "'gene'" varmaybeis */ -#line 592 "antimony.ypp" + case 189: /* geneinit: "'var'" "'gene'" varmaybeis */ +#line 574 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3432 "antimony.tab.cpp" +#line 3416 "antimony.tab.cpp" break; - case 188: /* geneinit: "'const'" "'gene'" varmaybeis */ -#line 593 "antimony.ypp" + case 190: /* geneinit: "'const'" "'gene'" varmaybeis */ +#line 575 "antimony.ypp" {g_registry.SetError("Genes may not be set 'const'."); YYABORT; } -#line 3438 "antimony.tab.cpp" +#line 3422 "antimony.tab.cpp" break; - case 189: /* geneinit: geneinit ',' varmaybeis */ -#line 594 "antimony.ypp" + case 191: /* geneinit: geneinit ',' varmaybeis */ +#line 576 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varReactionGene)) YYABORT; } -#line 3444 "antimony.tab.cpp" +#line 3428 "antimony.tab.cpp" break; - case 190: /* operatorinit: "'operator'" varmaybeis */ -#line 597 "antimony.ypp" + case 192: /* operatorinit: "'operator'" varmaybeis */ +#line 579 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3450 "antimony.tab.cpp" +#line 3434 "antimony.tab.cpp" break; - case 191: /* operatorinit: "'var'" "'operator'" varmaybeis */ -#line 598 "antimony.ypp" + case 193: /* operatorinit: "'var'" "'operator'" varmaybeis */ +#line 580 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3456 "antimony.tab.cpp" +#line 3440 "antimony.tab.cpp" break; - case 192: /* operatorinit: "'const'" "'operator'" varmaybeis */ -#line 599 "antimony.ypp" + case 194: /* operatorinit: "'const'" "'operator'" varmaybeis */ +#line 581 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3462 "antimony.tab.cpp" +#line 3446 "antimony.tab.cpp" break; - case 193: /* operatorinit: operatorinit ',' varmaybeis */ -#line 600 "antimony.ypp" + case 195: /* operatorinit: operatorinit ',' varmaybeis */ +#line 582 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varFormulaOperator)) YYABORT; } -#line 3468 "antimony.tab.cpp" +#line 3452 "antimony.tab.cpp" break; - case 194: /* compartmentinit: "'compartment'" varmaybeis */ -#line 604 "antimony.ypp" + case 196: /* compartmentinit: "'compartment'" varmaybeis */ +#line 586 "antimony.ypp" {g_registry.SetConstness(constDEFAULT); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3474 "antimony.tab.cpp" +#line 3458 "antimony.tab.cpp" break; - case 195: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ -#line 605 "antimony.ypp" + case 197: /* compartmentinit: "'var'" "'compartment'" varmaybeis */ +#line 587 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3480 "antimony.tab.cpp" +#line 3464 "antimony.tab.cpp" break; - case 196: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ -#line 606 "antimony.ypp" + case 198: /* compartmentinit: "'const'" "'compartment'" varmaybeis */ +#line 588 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3486 "antimony.tab.cpp" +#line 3470 "antimony.tab.cpp" break; - case 197: /* compartmentinit: compartmentinit ',' varmaybeis */ -#line 607 "antimony.ypp" + case 199: /* compartmentinit: compartmentinit ',' varmaybeis */ +#line 589 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst(); if ((yyvsp[0].variable)->SetType(varCompartment)) YYABORT; } -#line 3492 "antimony.tab.cpp" +#line 3476 "antimony.tab.cpp" break; - case 198: /* compartmentinit: "'compartment'" '.' "element name" '=' formula */ -#line 608 "antimony.ypp" + case 200: /* compartmentinit: "'compartment'" '.' "element name" '=' formula */ +#line 590 "antimony.ypp" {if (g_registry.CurrentModule()->AddCompartmentLayoutInfo((yyvsp[-2].word), (yyvsp[0].formula))) YYABORT;} -#line 3498 "antimony.tab.cpp" +#line 3482 "antimony.tab.cpp" break; - case 199: /* varconstinit: "'var'" varmaybeis */ -#line 611 "antimony.ypp" + case 201: /* varconstinit: "'var'" varmaybeis */ +#line 593 "antimony.ypp" {g_registry.SetConstness(constVAR); (yyvsp[0].variable)->SetRegConst();} -#line 3504 "antimony.tab.cpp" +#line 3488 "antimony.tab.cpp" break; - case 200: /* varconstinit: "'const'" varmaybeis */ -#line 612 "antimony.ypp" + case 202: /* varconstinit: "'const'" varmaybeis */ +#line 594 "antimony.ypp" {g_registry.SetConstness(constCONST); (yyvsp[0].variable)->SetRegConst();} -#line 3510 "antimony.tab.cpp" +#line 3494 "antimony.tab.cpp" break; - case 201: /* varconstinit: varconstinit ',' varmaybeis */ -#line 613 "antimony.ypp" + case 203: /* varconstinit: varconstinit ',' varmaybeis */ +#line 595 "antimony.ypp" {(yyvsp[0].variable)->SetRegConst();} -#line 3516 "antimony.tab.cpp" +#line 3500 "antimony.tab.cpp" break; - case 202: /* unitinit: "'unit'" variable '=' formula */ -#line 616 "antimony.ypp" + case 204: /* unitinit: "'unit'" variable '=' formula */ +#line 598 "antimony.ypp" {if ((yyvsp[-2].variable)->SetType(varUnitDefinition)) YYABORT; if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[-2].variable)->GetUnitDef()->SetFromFormula((yyvsp[0].formula))) YYABORT;} -#line 3524 "antimony.tab.cpp" +#line 3508 "antimony.tab.cpp" break; - case 203: /* unitinit: "'unit'" variable */ -#line 619 "antimony.ypp" + case 205: /* unitinit: "'unit'" variable */ +#line 601 "antimony.ypp" {if ((yyvsp[0].variable)->SetType(varUnitDefinition)) YYABORT;} -#line 3530 "antimony.tab.cpp" +#line 3514 "antimony.tab.cpp" break; - case 204: /* dnadef: dnastrand */ -#line 622 "antimony.ypp" + case 206: /* dnadef: dnastrand */ +#line 604 "antimony.ypp" {if (g_registry.SaveWorkingStrand()) YYABORT;} -#line 3536 "antimony.tab.cpp" +#line 3520 "antimony.tab.cpp" break; - case 205: /* dnadef: varmaybein ':' dnastrand */ -#line 623 "antimony.ypp" + case 207: /* dnadef: varmaybein ':' dnastrand */ +#line 605 "antimony.ypp" {if (g_registry.SetStrandAs((yyvsp[-2].variable))) YYABORT;} -#line 3542 "antimony.tab.cpp" +#line 3526 "antimony.tab.cpp" break; - case 206: /* dnastrand: "--" variable */ -#line 626 "antimony.ypp" + case 208: /* dnastrand: "--" variable */ +#line 608 "antimony.ypp" {if (g_registry.SetNewUpstreamOpen((yyvsp[0].variable))) YYABORT;} -#line 3548 "antimony.tab.cpp" +#line 3532 "antimony.tab.cpp" break; - case 207: /* dnastrand: "--" dnamiddle */ -#line 627 "antimony.ypp" + case 209: /* dnastrand: "--" dnamiddle */ +#line 609 "antimony.ypp" {g_registry.SetOpenUpstream(); } -#line 3554 "antimony.tab.cpp" +#line 3538 "antimony.tab.cpp" break; - case 208: /* dnastrand: dnamiddle variable */ -#line 628 "antimony.ypp" + case 210: /* dnastrand: dnamiddle variable */ +#line 610 "antimony.ypp" {if (g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3560 "antimony.tab.cpp" +#line 3544 "antimony.tab.cpp" break; - case 209: /* dnastrand: "--" dnamiddle variable */ -#line 629 "antimony.ypp" + case 211: /* dnastrand: "--" dnamiddle variable */ +#line 611 "antimony.ypp" {g_registry.SetOpenUpstream(); if(g_registry.SetDownstreamEnd((yyvsp[0].variable))) YYABORT;} -#line 3566 "antimony.tab.cpp" +#line 3550 "antimony.tab.cpp" break; - case 210: /* dnastrand: dnamiddle */ -#line 630 "antimony.ypp" + case 212: /* dnastrand: dnamiddle */ +#line 612 "antimony.ypp" { } -#line 3572 "antimony.tab.cpp" +#line 3556 "antimony.tab.cpp" break; - case 211: /* dnamiddle: variable "--" */ -#line 633 "antimony.ypp" + case 213: /* dnamiddle: variable "--" */ +#line 615 "antimony.ypp" {if (g_registry.SetNewDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3578 "antimony.tab.cpp" +#line 3562 "antimony.tab.cpp" break; - case 212: /* dnamiddle: dnamiddle variable "--" */ -#line 634 "antimony.ypp" + case 214: /* dnamiddle: dnamiddle variable "--" */ +#line 616 "antimony.ypp" {if (g_registry.SetDownstreamOpen((yyvsp[-1].variable))) YYABORT;} -#line 3584 "antimony.tab.cpp" +#line 3568 "antimony.tab.cpp" break; - case 213: /* $@8: %empty */ -#line 637 "antimony.ypp" + case 215: /* $@8: %empty */ +#line 619 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula))) YYABORT;} -#line 3590 "antimony.tab.cpp" +#line 3574 "antimony.tab.cpp" break; - case 214: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ -#line 637 "antimony.ypp" + case 216: /* event: "'at'" formula $@8 eventmodifications colonret assignmentlist */ +#line 619 "antimony.ypp" {} -#line 3596 "antimony.tab.cpp" +#line 3580 "antimony.tab.cpp" break; - case 215: /* $@9: %empty */ -#line 638 "antimony.ypp" + case 217: /* $@9: %empty */ +#line 620 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula))) YYABORT;} -#line 3602 "antimony.tab.cpp" +#line 3586 "antimony.tab.cpp" break; - case 216: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ -#line 638 "antimony.ypp" + case 218: /* event: "'at'" formula "'after'" formula $@9 eventmodifications colonret assignmentlist */ +#line 620 "antimony.ypp" {} -#line 3608 "antimony.tab.cpp" +#line 3592 "antimony.tab.cpp" break; - case 217: /* $@10: %empty */ -#line 639 "antimony.ypp" + case 219: /* $@10: %empty */ +#line 621 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[0].formula), (yyvsp[-3].variable))) YYABORT;} -#line 3614 "antimony.tab.cpp" +#line 3598 "antimony.tab.cpp" break; - case 218: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ -#line 639 "antimony.ypp" + case 220: /* event: varmaybein ':' "'at'" formula $@10 eventmodifications colonret assignmentlist */ +#line 621 "antimony.ypp" {} -#line 3620 "antimony.tab.cpp" +#line 3604 "antimony.tab.cpp" break; - case 219: /* $@11: %empty */ -#line 640 "antimony.ypp" + case 221: /* $@11: %empty */ +#line 622 "antimony.ypp" {if (g_registry.SetNewCurrentEvent((yyvsp[-2].formula), (yyvsp[0].formula), (yyvsp[-5].variable))) YYABORT;} -#line 3626 "antimony.tab.cpp" +#line 3610 "antimony.tab.cpp" break; - case 220: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ -#line 640 "antimony.ypp" + case 222: /* event: varmaybein ':' "'at'" formula "'after'" formula $@11 eventmodifications colonret assignmentlist */ +#line 622 "antimony.ypp" {} -#line 3632 "antimony.tab.cpp" +#line 3616 "antimony.tab.cpp" break; - case 221: /* colonret: ':' */ -#line 643 "antimony.ypp" + case 223: /* colonret: ':' */ +#line 625 "antimony.ypp" {} -#line 3638 "antimony.tab.cpp" +#line 3622 "antimony.tab.cpp" break; - case 222: /* colonret: colonret '\n' */ -#line 644 "antimony.ypp" + case 224: /* colonret: colonret '\n' */ +#line 626 "antimony.ypp" {} -#line 3644 "antimony.tab.cpp" +#line 3628 "antimony.tab.cpp" break; - case 223: /* eventmodifications: %empty */ -#line 647 "antimony.ypp" + case 225: /* eventmodifications: %empty */ +#line 629 "antimony.ypp" {} -#line 3650 "antimony.tab.cpp" +#line 3634 "antimony.tab.cpp" break; - case 224: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ -#line 648 "antimony.ypp" + case 226: /* eventmodifications: eventmodifications ',' "element name" '=' formula */ +#line 630 "antimony.ypp" {if (CaselessStrCmp(false, *(yyvsp[-2].word), "priority")) {g_registry.GetCurrentEvent()->SetPriority(*(yyvsp[0].formula));} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "t0")) {if (g_registry.GetCurrentEvent()->SetInitialValue(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "fromTrigger")) {if (g_registry.GetCurrentEvent()->SetUseValuesFromTriggerTime(*(yyvsp[0].formula))) YYABORT;} else if (CaselessStrCmp(false, *(yyvsp[-2].word), "persistent")) {if (g_registry.GetCurrentEvent()->SetPersistent(*(yyvsp[0].formula))) YYABORT;} else { g_registry.SetError("Illegal term '" + *(yyvsp[-2].word) + "' in event defintion. You may use the terms 'priority', 't0', 'fromTrigger', and 'persistent' here to set those properties of an event."); YYABORT;}} -#line 3660 "antimony.tab.cpp" +#line 3644 "antimony.tab.cpp" break; - case 225: /* assignmentlist: variable '=' formula */ -#line 655 "antimony.ypp" + case 227: /* assignmentlist: variable '=' formula */ +#line 637 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3666 "antimony.tab.cpp" +#line 3650 "antimony.tab.cpp" break; - case 226: /* assignmentlist: variable '=' formula ':' assignmentlist */ -#line 656 "antimony.ypp" + case 228: /* assignmentlist: variable '=' formula ':' assignmentlist */ +#line 638 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3672 "antimony.tab.cpp" +#line 3656 "antimony.tab.cpp" break; - case 227: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ -#line 657 "antimony.ypp" + case 229: /* assignmentlist: variable '=' formula ':' '\n' assignmentlist */ +#line 639 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3678 "antimony.tab.cpp" +#line 3662 "antimony.tab.cpp" break; - case 228: /* assignmentlist: variable '=' formula ',' assignmentlist */ -#line 658 "antimony.ypp" + case 230: /* assignmentlist: variable '=' formula ',' assignmentlist */ +#line 640 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-4].variable), (yyvsp[-2].formula))) YYABORT;} -#line 3684 "antimony.tab.cpp" +#line 3668 "antimony.tab.cpp" break; - case 229: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ -#line 659 "antimony.ypp" + case 231: /* assignmentlist: variable '=' formula ',' '\n' assignmentlist */ +#line 641 "antimony.ypp" {if (g_registry.GetCurrentEvent()->AddResult((yyvsp[-5].variable), (yyvsp[-3].formula))) YYABORT;} -#line 3690 "antimony.tab.cpp" +#line 3674 "antimony.tab.cpp" break; - case 230: /* deletion: "'delete'" variable */ -#line 662 "antimony.ypp" + case 232: /* deletion: "'delete'" variable */ +#line 644 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3696 "antimony.tab.cpp" +#line 3680 "antimony.tab.cpp" break; - case 231: /* deletion: deletion ',' variable */ -#line 663 "antimony.ypp" + case 233: /* deletion: deletion ',' variable */ +#line 645 "antimony.ypp" {if (g_registry.CurrentModule()->AddDeletion((yyvsp[0].variable))) YYABORT;} -#line 3702 "antimony.tab.cpp" +#line 3686 "antimony.tab.cpp" break; - case 232: /* unitdef: formula */ -#line 666 "antimony.ypp" + case 234: /* unitdef: formula */ +#line 648 "antimony.ypp" { if ((yyvsp[0].formula)->MakeAllVariablesUnits()) YYABORT; if ((yyvsp[0].formula)->IsSingleVariable()) { @@ -3716,125 +3700,125 @@ yyparse (void) (yyval.variable) = g_registry.CurrentModule()->AddOrFindUnitDef(ud); } } -#line 3720 "antimony.tab.cpp" +#line 3704 "antimony.tab.cpp" break; - case 233: /* constraint: "number" inequality formula */ -#line 681 "antimony.ypp" + case 235: /* constraint: "number" inequality formula */ +#line 663 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3726 "antimony.tab.cpp" +#line 3710 "antimony.tab.cpp" break; - case 234: /* constraint: '-' "number" inequality formula */ -#line 682 "antimony.ypp" + case 236: /* constraint: '-' "number" inequality formula */ +#line 664 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint(-(yyvsp[-2].num), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3732 "antimony.tab.cpp" +#line 3716 "antimony.tab.cpp" break; - case 235: /* constraint: "name of a pre-defined constant" inequality formula */ -#line 683 "antimony.ypp" + case 237: /* constraint: "name of a pre-defined constant" inequality formula */ +#line 665 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3738 "antimony.tab.cpp" +#line 3722 "antimony.tab.cpp" break; - case 236: /* constraint: "element name" inequality formula */ -#line 684 "antimony.ypp" + case 238: /* constraint: "element name" inequality formula */ +#line 666 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].word), (yyvsp[0].formula), (yyvsp[-1].inequality))) YYABORT;} -#line 3744 "antimony.tab.cpp" +#line 3728 "antimony.tab.cpp" break; - case 237: /* constraint: "'constraint'" ':' formula */ -#line 685 "antimony.ypp" + case 239: /* constraint: "'constraint'" ':' formula */ +#line 667 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[0].formula))) YYABORT;} -#line 3750 "antimony.tab.cpp" +#line 3734 "antimony.tab.cpp" break; - case 238: /* constraint: "'constraint'" variable ':' formula */ -#line 686 "antimony.ypp" + case 240: /* constraint: "'constraint'" variable ':' formula */ +#line 668 "antimony.ypp" {if (g_registry.CurrentModule()->AddConstraint((yyvsp[-2].variable), (yyvsp[0].formula))) YYABORT;} -#line 3756 "antimony.tab.cpp" +#line 3740 "antimony.tab.cpp" break; - case 239: /* objective: maxormin formula */ -#line 689 "antimony.ypp" + case 241: /* objective: maxormin formula */ +#line 671 "antimony.ypp" {if (g_registry.CurrentModule()->AddObjective((yyvsp[0].formula), (yyvsp[-1].maxormin))) YYABORT;} -#line 3762 "antimony.tab.cpp" +#line 3746 "antimony.tab.cpp" break; - case 240: /* maxormin: "'maximize'" */ -#line 692 "antimony.ypp" + case 242: /* maxormin: "'maximize'" */ +#line 674 "antimony.ypp" {(yyval.maxormin) = true;} -#line 3768 "antimony.tab.cpp" +#line 3752 "antimony.tab.cpp" break; - case 241: /* maxormin: "'minimize'" */ -#line 693 "antimony.ypp" + case 243: /* maxormin: "'minimize'" */ +#line 675 "antimony.ypp" {(yyval.maxormin) = false;} -#line 3774 "antimony.tab.cpp" +#line 3758 "antimony.tab.cpp" break; - case 242: /* stringlist: "text string" */ -#line 696 "antimony.ypp" + case 244: /* stringlist: "text string" */ +#line 678 "antimony.ypp" { (yyval.stringlist) = new std::vector(); (yyval.stringlist)->push_back(*((yyvsp[0].word))); } -#line 3780 "antimony.tab.cpp" +#line 3764 "antimony.tab.cpp" break; - case 243: /* stringlist: stringlist ',' "text string" */ -#line 697 "antimony.ypp" + case 245: /* stringlist: stringlist ',' "text string" */ +#line 679 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-2].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3786 "antimony.tab.cpp" +#line 3770 "antimony.tab.cpp" break; - case 244: /* stringlist: stringlist ',' '\n' "text string" */ -#line 698 "antimony.ypp" + case 246: /* stringlist: stringlist ',' '\n' "text string" */ +#line 680 "antimony.ypp" { (yyval.stringlist) = (yyvsp[-3].stringlist); (yyval.stringlist)->push_back(*(yyvsp[0].word)); } -#line 3792 "antimony.tab.cpp" +#line 3776 "antimony.tab.cpp" break; - case 245: /* $@12: %empty */ -#line 700 "antimony.ypp" + case 247: /* $@12: %empty */ +#line 682 "antimony.ypp" {if (g_registry.SetCurrentModuleIf((yyvsp[0].word), (yyvsp[-1].word))) YYABORT;} -#line 3798 "antimony.tab.cpp" +#line 3782 "antimony.tab.cpp" break; - case 246: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ -#line 700 "antimony.ypp" + case 248: /* annotationBlock: "element name" "name of an existing module" $@12 annotations "'end'" */ +#line 682 "antimony.ypp" {g_registry.RevertToPreviousModule();} -#line 3804 "antimony.tab.cpp" +#line 3788 "antimony.tab.cpp" break; - case 247: /* annotations: %empty */ -#line 703 "antimony.ypp" + case 249: /* annotations: %empty */ +#line 685 "antimony.ypp" {} -#line 3810 "antimony.tab.cpp" +#line 3794 "antimony.tab.cpp" break; - case 248: /* annotations: "element name" ':' stringlist */ -#line 704 "antimony.ypp" + case 250: /* annotations: "element name" ':' stringlist */ +#line 686 "antimony.ypp" {string modname = g_registry.CurrentModuleName(); g_registry.ProcessGlobalCVTerm(&modname, (yyvsp[-2].word), (yyvsp[0].stringlist));} -#line 3816 "antimony.tab.cpp" +#line 3800 "antimony.tab.cpp" break; - case 249: /* cvterm: variable "element name" stringlist */ -#line 709 "antimony.ypp" + case 251: /* cvterm: variable "element name" stringlist */ +#line 691 "antimony.ypp" {if (g_registry.CurrentModule()->ProcessCVTerm((yyvsp[-2].variable),(yyvsp[-1].word),(yyvsp[0].stringlist))) YYABORT;} -#line 3822 "antimony.tab.cpp" +#line 3806 "antimony.tab.cpp" break; - case 250: /* cvterm: variable "element name" '.' "element name" stringlist */ -#line 710 "antimony.ypp" + case 252: /* cvterm: variable "element name" '.' "element name" stringlist */ +#line 692 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].stringlist))) YYABORT;} -#line 3828 "antimony.tab.cpp" +#line 3812 "antimony.tab.cpp" break; - case 251: /* cvterm: variable "element name" '.' "element name" "number" */ -#line 711 "antimony.ypp" + case 253: /* cvterm: variable "element name" '.' "element name" "number" */ +#line 693 "antimony.ypp" {if (g_registry.ProcessCreatorTerm((yyvsp[-4].variable), (yyvsp[-3].word), (yyvsp[-1].word), (yyvsp[0].num))) YYABORT;} -#line 3834 "antimony.tab.cpp" +#line 3818 "antimony.tab.cpp" break; - case 252: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ -#line 715 "antimony.ypp" + case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "number" */ +#line 697 "antimony.ypp" { Module* module = g_registry.GetModule(*(yyvsp[-4].word)); if (module && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { module->SetSBOTerm(lround((yyvsp[0].num))); @@ -3844,11 +3828,11 @@ yyparse (void) YYABORT; } } -#line 3848 "antimony.tab.cpp" +#line 3832 "antimony.tab.cpp" break; - case 253: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ -#line 726 "antimony.ypp" + case 255: /* toplevel_sbo: "name of an existing function" '.' "element name" '=' "number" */ +#line 708 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "sboTerm")) { function->SetSBOTerm(lround((yyvsp[0].num))); @@ -3858,11 +3842,11 @@ yyparse (void) YYABORT; } } -#line 3862 "antimony.tab.cpp" +#line 3846 "antimony.tab.cpp" break; - case 254: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "element name" */ -#line 736 "antimony.ypp" + case 256: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' stringConstant */ +#line 718 "antimony.ypp" { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { if (function->SetLayout((yyvsp[0].word))) YYABORT; @@ -3872,25 +3856,11 @@ yyparse (void) YYABORT; } } -#line 3876 "antimony.tab.cpp" +#line 3860 "antimony.tab.cpp" break; - case 255: /* toplevel_sbo: "name of an existing module" '.' "element name" '=' "name of a pre-defined constant" */ -#line 746 "antimony.ypp" - { Module* function = g_registry.GetModule(*(yyvsp[-4].word)); - if (function && (yyvsp[-2].word) && CaselessStrCmp(true, *((yyvsp[-2].word)), "autolayout")) { - if (function->SetLayout((yyvsp[0].word))) YYABORT; - } - else { - g_registry.SetError("Invalid syntax '" + *((yyvsp[-4].word)) + "." + *((yyvsp[-2].word)) + "'. The only thing that can set on '" + *((yyvsp[-4].word)) + "' to a string is 'layout'."); - YYABORT; - } - } -#line 3890 "antimony.tab.cpp" - break; - - case 256: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ -#line 756 "antimony.ypp" + case 257: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "number" */ +#line 728 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].num))) YYABORT; @@ -3904,11 +3874,11 @@ yyparse (void) } module->SetLayout("on"); } -#line 3908 "antimony.tab.cpp" +#line 3878 "antimony.tab.cpp" break; - case 257: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' "element name" */ -#line 770 "antimony.ypp" + case 258: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' stringConstant */ +#line 742 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-4].word) && CaselessStrCmp(true, *((yyvsp[-4].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-2].word), (yyvsp[0].word))) YYABORT; @@ -3922,11 +3892,11 @@ yyparse (void) } module->SetLayout("on"); } -#line 3926 "antimony.tab.cpp" +#line 3896 "antimony.tab.cpp" break; - case 258: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ -#line 784 "antimony.ypp" + case 259: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' variablelist '}' */ +#line 756 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].variablelist))) YYABORT; @@ -3940,11 +3910,11 @@ yyparse (void) } module->SetLayout("on"); } -#line 3944 "antimony.tab.cpp" +#line 3914 "antimony.tab.cpp" break; - case 259: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ -#line 798 "antimony.ypp" + case 260: /* toplevel_sbo: "name of an existing module" '.' "element name" '.' "element name" '=' '{' numlist '}' */ +#line 770 "antimony.ypp" { Module* module = g_registry.CurrentModule(); if (module && (yyvsp[-6].word) && CaselessStrCmp(true, *((yyvsp[-6].word)), "autolayout")) { if (module->SetAutoLayout((yyvsp[-4].word), (yyvsp[-1].numlist))) YYABORT; @@ -3958,47 +3928,47 @@ yyparse (void) } module->SetLayout("on"); } -#line 3962 "antimony.tab.cpp" +#line 3932 "antimony.tab.cpp" break; - case 260: /* modulename: "name of an existing module" "'is'" "text string" lineend */ -#line 814 "antimony.ypp" + case 261: /* modulename: "name of an existing module" "'is'" "text string" lineend */ +#line 786 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3968 "antimony.tab.cpp" +#line 3938 "antimony.tab.cpp" break; - case 261: /* functionname: "name of an existing function" "'is'" "text string" lineend */ -#line 816 "antimony.ypp" + case 262: /* functionname: "name of an existing function" "'is'" "text string" lineend */ +#line 788 "antimony.ypp" { g_registry.GetModule(*(yyvsp[-3].word))->SetDisplayName(*(yyvsp[-1].word)); } -#line 3974 "antimony.tab.cpp" +#line 3944 "antimony.tab.cpp" break; - case 262: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ -#line 819 "antimony.ypp" + case 263: /* modulecvterm: "name of an existing module" "element name" stringlist lineend */ +#line 791 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3980 "antimony.tab.cpp" +#line 3950 "antimony.tab.cpp" break; - case 263: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ -#line 820 "antimony.ypp" + case 264: /* modulecvterm: "name of an existing module" "element name" '.' "element name" stringlist lineend */ +#line 792 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].stringlist))) YYABORT;} -#line 3986 "antimony.tab.cpp" +#line 3956 "antimony.tab.cpp" break; - case 264: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ -#line 821 "antimony.ypp" + case 265: /* modulecvterm: "name of an existing module" "element name" '.' "element name" "number" lineend */ +#line 793 "antimony.ypp" {if (g_registry.ProcessGlobalCreatorTerm((yyvsp[-5].word), (yyvsp[-4].word), (yyvsp[-2].word), (yyvsp[-1].num))) YYABORT;} -#line 3992 "antimony.tab.cpp" +#line 3962 "antimony.tab.cpp" break; - case 265: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ -#line 822 "antimony.ypp" + case 266: /* functioncvterm: "name of an existing function" "element name" stringlist lineend */ +#line 794 "antimony.ypp" {if (g_registry.ProcessGlobalCVTerm((yyvsp[-3].word),(yyvsp[-2].word),(yyvsp[-1].stringlist))) YYABORT;} -#line 3998 "antimony.tab.cpp" +#line 3968 "antimony.tab.cpp" break; -#line 4002 "antimony.tab.cpp" +#line 3972 "antimony.tab.cpp" default: break; } @@ -4222,7 +4192,7 @@ yyparse (void) return yyresult; } -#line 824 "antimony.ypp" +#line 796 "antimony.ypp" diff --git a/src/antimony.ypp b/src/antimony.ypp index 072ab7c8..90c68521 100644 --- a/src/antimony.ypp +++ b/src/antimony.ypp @@ -99,6 +99,7 @@ using namespace libsbml; %type stringlist %type variablelist %type numlist +%type stringConstant %left '&' '|' /* Boolean functions and, or */ %left '-' '+' @@ -286,17 +287,7 @@ moduleannotation: MODULE ANTWORD stringlist lineend YYABORT; } } - | MODULE '.' ANTWORD '=' ANTWORD - { Module* module = g_registry.CurrentModule(); - if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { - if (module->SetLayout($5)) YYABORT; - } - else { - g_registry.SetError("Invalid syntax 'model." + *($3) + "'. The only thing that can be set on the model to a string is 'layout'."); - YYABORT; - } - } - | MODULE '.' ANTWORD '=' CONSTANT + | MODULE '.' ANTWORD '=' stringConstant { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { if (module->SetLayout($5)) YYABORT; @@ -320,21 +311,7 @@ moduleannotation: MODULE ANTWORD stringlist lineend } module->SetLayout("on"); } - | MODULE '.' ANTWORD '.' ANTWORD '=' ANTWORD - { Module* module = g_registry.CurrentModule(); - if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { - if (module->SetAutoLayout($5, $7)) YYABORT; - } - else if (module && $3 && CaselessStrCmp(true, *($3), "layout")) { - if (module->SetLayout($5, $7)) YYABORT; - } - else { - g_registry.SetError("Invalid syntax 'model." + *($3) + "'.*: The core word here must be 'layout' or 'autolayout'."); - YYABORT; - } - module->SetLayout("on"); - } - | MODULE '.' ANTWORD '.' ANTWORD '=' TEXTSTRING + | MODULE '.' ANTWORD '.' ANTWORD '=' stringConstant { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { if (module->SetAutoLayout($5, $7)) YYABORT; @@ -378,6 +355,10 @@ moduleannotation: MODULE ANTWORD stringlist lineend } ; +stringConstant: CONSTANT {$$ = $1;} + | TEXTSTRING {$$ = $1;} + | ANTWORD {$$ = $1;} + variablelist: variable { $$ = new std::vector(); $$->push_back($1);} // need to free $1? | variablelist ',' variable { $$ = $1; $$->push_back($3); } // need to free $3? | variablelist ',' '\n' variable { $$ = $1; $$->push_back($4); } // eat newlines @@ -732,17 +713,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM YYABORT; } } - | MODNAME '.' ANTWORD '=' ANTWORD - { Module* function = g_registry.GetModule(*$1); - if (function && $3 && CaselessStrCmp(true, *($3), "autolayout")) { - if (function->SetLayout($5)) YYABORT; - } - else { - g_registry.SetError("Invalid syntax '" + *($1) + "." + *($3) + "'. The only thing that can set on '" + *($1) + "' to a string is 'layout'."); - YYABORT; - } - } - | MODNAME '.' ANTWORD '=' CONSTANT + | MODNAME '.' ANTWORD '=' stringConstant { Module* function = g_registry.GetModule(*$1); if (function && $3 && CaselessStrCmp(true, *($3), "autolayout")) { if (function->SetLayout($5)) YYABORT; @@ -766,7 +737,7 @@ toplevel_sbo: MODNAME '.' ANTWORD '=' NUM } module->SetLayout("on"); } - | MODNAME '.' ANTWORD '.' ANTWORD '=' ANTWORD + | MODNAME '.' ANTWORD '.' ANTWORD '=' stringConstant { Module* module = g_registry.CurrentModule(); if (module && $3 && CaselessStrCmp(true, *($3), "autolayout")) { if (module->SetAutoLayout($5, $7)) YYABORT; diff --git a/src/layoutWrapper.cpp b/src/layoutWrapper.cpp index dd860e41..6dfc17eb 100644 --- a/src/layoutWrapper.cpp +++ b/src/layoutWrapper.cpp @@ -97,14 +97,14 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) #ifndef NSBML ASTNode* astn = parseStringToASTNode(formula->ToSBMLString()); if (!astn || astn->getType() != AST_LINEAR_ALGEBRA_VECTOR || astn->getNumChildren() != 2) { - g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': an layout parameter of type " + LayoutTypeToString(m_layout_type) + " must be a vector of length two, marked with curly brackets (i.e. '{150, 200}')."); + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': a layout parameter of type " + LayoutTypeToString(m_layout_type) + " must be a vector of length two, marked with curly brackets (i.e. '{150, 200}')."); delete astn; return true; } for (unsigned int c = 0; c < 2; c++) { ASTNodeType_t ctype = astn->getChild(c)->getType(); if (!astn->getChild(c)->isNumber()) { - g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': an layout parameter of type " + LayoutTypeToString(m_layout_type) + " must be a vector of length two, and each element of the vector may only be a value (i.e. '{150, 200}')."); + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': a layout parameter of type " + LayoutTypeToString(m_layout_type) + " must be a vector of length two, and each element of the vector may only be a value (i.e. '{150, 200}')."); delete astn; return true; } @@ -114,8 +114,12 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) delete astn; return true; } + if (m_layout_type == lt_size && (astn->getChild(0)->getValue() < 0 || astn->getChild(1)->getValue() < 0)) { + g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': size may not be negative."); + delete astn; + return true; + } delete astn; -#endif return false; } else { @@ -189,6 +193,7 @@ bool LayoutWrapper::SetFormula(Formula* formula, bool isObjective) g_registry.SetError("Unable to set the value of '" + GetNameDelimitedBy(".") + "' to be '" + formula->ToDelimitedStringWithEllipses(".") + "': this layout parameter must only be a single value or a single variable."); return true; } +#endif return false; } @@ -228,7 +233,7 @@ string LayoutWrapper::GetNameDelimitedBy(string cc) const bool LayoutWrapper::Synchronize(Variable* clone, const Variable* conversionFactor) { - g_registry.SetError("Unable to synchronize two symbols when one of them ('" + GetNameDelimitedBy(".") + "') is an layout term."); + g_registry.SetError("Unable to synchronize two symbols when one of them ('" + GetNameDelimitedBy(".") + "') is a layout term."); return true; } @@ -386,7 +391,6 @@ bool LayoutWrapper::TransferLayoutInformationTo(SBMLDocument* sbml, const string assert(m_layout_type == lt_size); if (group == "species") { ret1 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionWidth(sbml, 0, xval); - //double S1width = LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(sbml, "S1"); ret2 = LIBSBMLNETWORK_CPP_NAMESPACE::setSpeciesDimensionHeight(sbml, 0, yval); } else if (group == "compartment") { diff --git a/src/module.cpp b/src/module.cpp index df677e47..813605a0 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -3202,6 +3202,7 @@ bool Module::SetAutoLayout(const std::string* argument, const std::string* value } else if (CaselessStrCmp(true, *argument, "useNameAsTextLabel")) { m_autolayout.useNameAsTextLabel = arg; + m_autolayout.use = true; } return false; } @@ -3238,6 +3239,7 @@ bool Module::SetAutoLayout(const string* argument, const double& value) //} else if (CaselessStrCmp(true, *argument, "maxNumConnectedEdges")) { m_autolayout.maxNumConnectedEdges = int(round(value)); + m_autolayout.use = true; } return false; } diff --git a/src/test/TestAntimonyErrors.cpp b/src/test/TestAntimonyErrors.cpp index b04d0366..943b0075 100644 --- a/src/test/TestAntimonyErrors.cpp +++ b/src/test/TestAntimonyErrors.cpp @@ -359,6 +359,138 @@ START_TEST (uncertval_must_be_single2) } END_TEST +START_TEST(no_aligning_set_species) +{ + testError("species S1, S2, S3; S1.x = 3; S2.x = 5; model.layout.align_top = {S1, S2}", "Error in model string, line 1: Unable to set the alignment align_top because only one element is allowed in an alignment whose position is already known. In addition, adding an element to an alignment then establishes that element's position, so two such elements cannot be used in another alignment. In this case, the positions of elements 'S1', and 'S2' are already known."); +} +END_TEST + +START_TEST(no_aligning_already_aligned) +{ + testError("species S1, S2, S3; model.layout.align_bottom = {S1, S2}; model.layout.align_top = {S1, S2}", "Error in model string, line 1: Unable to set the alignment align_bottom because only one element is allowed in an alignment whose position is already known. In addition, adding an element to an alignment then establishes that element's position, so two such elements cannot be used in another alignment. In this case, the positions of elements 'S1', and 'S2' are already known."); +} +END_TEST + +START_TEST(no_aligning_alignment_set_mix) +{ + testError("species S1, S2, S3; S3.x = 5; model.layout.align_bottom = {S3, S2}; model.layout.align_top = {S1, S2}", "Error in model string, line 1: Unable to set the alignment align_bottom because only one element is allowed in an alignment whose position is already known. In addition, adding an element to an alignment then establishes that element's position, so two such elements cannot be used in another alignment. In this case, the positions of elements 'S2', and 'S3' are already known."); +} +END_TEST + +START_TEST(no_aligning_alignment_set_mix_more_species) +{ + testError("species S1, S2, S3, S4, S5, S6; S3.x = 5; model.layout.align_top = {S1, S2}; model.layout.align_bottom = {S1, S4, S6, S3}; ", "Error in model string, line 1: Unable to set the alignment align_bottom because only one element is allowed in an alignment whose position is already known. In addition, adding an element to an alignment then establishes that element's position, so two such elements cannot be used in another alignment. In this case, the positions of elements 'S1', and 'S3' are already known."); +} +END_TEST + +START_TEST(no_layout_for_events) +{ + testError("E0: at time>3:x=4; E0.color = red", "Error in model string, line 1: Unable to add layout or render information to E0: only species, reactions, and compartments can be visualized, and this element is of type 'Event'."); +} +END_TEST + +START_TEST(pos_must_be_vector) +{ + testError("species S1;S1.pos = 5", "Error in model string, line 1: Unable to set the value of 'S1.position' to be '5': a layout parameter of type position must be a vector of length two, marked with curly brackets (i.e. '{150, 200}')."); +} +END_TEST + +START_TEST(size_must_be_vector) +{ + testError("species S1;S1.size = 5", "Error in model string, line 1: Unable to set the value of 'S1.size' to be '5': a layout parameter of type size must be a vector of length two, marked with curly brackets (i.e. '{150, 200}')."); +} +END_TEST + +START_TEST(pos_must_be_len2_vectorA) +{ + testError("species S1;S1.pos = {5}", "Error in model string, line 1: Unable to set the value of 'S1.position' to be '{5}': a layout parameter of type position must be a vector of length two, marked with curly brackets (i.e. '{150, 200}')."); +} +END_TEST + +START_TEST(pos_must_be_len2_vectorB) +{ + testError("species S1;S1.pos = {5, 4, 4}", "Error in model string, line 1: Unable to set the value of 'S1.position' to be '{5, 4, 4}': a layout parameter of type position must be a vector of length two, marked with curly brackets (i.e. '{150, 200}')."); +} +END_TEST + +START_TEST(no_unit_in_position) +{ + testError("species S1;S1.pos = {5 cm, 4 mm}", "Error in model string, line 1: Unable to set the value of 'S1.position' to be '{5 cm, 4 mm}': units may not be used for layout positions."); +} +END_TEST + +START_TEST(only_nums_in_position) +{ + testError("species S1;S1.pos = {5, red}", "Error in model string, line 1: Unable to set the value of 'S1.position' to be '{5, red}': a layout parameter of type position must be a vector of length two, and each element of the vector may only be a value (i.e. '{150, 200}')."); +} +END_TEST + +START_TEST(x_only_number) +{ + testError("species S1;S1.x = red", "Error in model string, line 1: Unable to set the value of 'S1.x' to 'red'. It may only be set to a numerical value."); +} +END_TEST + +START_TEST(color_not_number) +{ + testError("species S1;S1.color = 5", "Error in model string, line 1: Unable to set the value of 'S1.color'. '5' is not a valid color value. Try standard color names like 'red' or 'blue', or use an RGB value of the form \"#000000\" (including the quotation marks)."); +} +END_TEST + +START_TEST(color_not_variable) +{ + testError("species S1;S1.color = S2", "Error in model string, line 1: Unable to set the value of 'S1.color'. 'S2' is not a valid color value. Try standard color names like 'red' or 'blue', or use an RGB value of the form \"#000000\" (including the quotation marks)."); +} +END_TEST + +START_TEST(fontstyle_not_number) +{ + testError("species S1;S1.fontstyle = 43", "Error in model string, line 1: Unable to set the value of 'S1.fontStyle'. '43' is not a valid font style. The valid font styles and weights are 'normal', 'bold', 'italic', and 'bold_italic'."); +} +END_TEST + +START_TEST(fontstyle_not_variable) +{ + testError("species S1;S1.fontstyle = S2", "Error in model string, line 1: Unable to set the value of 'S1.fontStyle'. 'S2' is not a valid font style. The valid font styles and weights are 'normal', 'bold', 'italic', and 'bold_italic'."); +} +END_TEST + +START_TEST(shape_not_number) +{ + testError("species S1;S1.shape = 43", "Error in model string, line 1: Unable to set the value of 'S1.shape'. '43' is not a valid shape name. The valid shape names are 'rectangle', 'square', 'ellipse', 'circle', 'triangle', 'diamond', 'pentagon', 'hexagon', and 'octagon'."); +} +END_TEST + +START_TEST(x_not_vector) +{ + testError("species S1;S1.x = {43, 44}", "Error in model string, line 1: Unable to set the value of 'S1.x' to be '{43, 44}': this layout parameter must only be a single value or a single variable."); +} +END_TEST + +START_TEST(layout_not_reactant) +{ + testError("S1.x->;", "Error in model string, line 1: The variable 'S1.x' cannot be used in a reaction or interaction, as it is the wrong type ('Layout or render parameter')."); +} +END_TEST + +START_TEST(layout_not_species) +{ + testError("species S1.x", "Error in model string, line 1: Unable to use the symbol 'S1.x' in any context other than setting its value."); +} +END_TEST + +START_TEST(no_sync_layout_stuff) +{ + testError("species S1, S2; S2 is S1.x", "Error in model string, line 1: Unable to synchronize two symbols when one of them ('S1.x') is a layout term."); +} +END_TEST + +START_TEST(no_negative_size) +{ + testError("s1->; ;species.size = {-5, 5}", "Error in model string, line 1: Unable to set the value of 'species.size' to be '{ - 5, 5}': size may not be negative."); +} +END_TEST + /* START_TEST (no_replace_ar_with_ia) { @@ -373,6 +505,13 @@ create_suite_Errors (void) Suite *suite = suite_create("Antimony Errors"); TCase *tcase = tcase_create("Antimony Errors"); + tcase_add_test(tcase, layout_not_species); + tcase_add_test(tcase, no_sync_layout_stuff); + tcase_add_test(tcase, no_negative_size); + tcase_add_test(tcase, unknown_file1); + tcase_add_test(tcase, unknown_file1); + tcase_add_test(tcase, unknown_file1); + tcase_add_test( tcase, unknown_file1); tcase_add_test( tcase, unknown_file2); tcase_add_test( tcase, unknown_file3); @@ -414,6 +553,26 @@ create_suite_Errors (void) tcase_add_test( tcase, uncertval_must_be_single1); tcase_add_test( tcase, uncertval_must_be_single2); + tcase_add_test(tcase, no_aligning_set_species); + tcase_add_test(tcase, no_aligning_already_aligned); + tcase_add_test(tcase, no_aligning_alignment_set_mix); + tcase_add_test(tcase, no_aligning_alignment_set_mix_more_species); + tcase_add_test(tcase, no_layout_for_events); + tcase_add_test(tcase, pos_must_be_vector); + tcase_add_test(tcase, size_must_be_vector); + tcase_add_test(tcase, pos_must_be_len2_vectorA); + tcase_add_test(tcase, pos_must_be_len2_vectorB); + tcase_add_test(tcase, no_unit_in_position); + tcase_add_test(tcase, only_nums_in_position); + tcase_add_test(tcase, x_only_number); + tcase_add_test(tcase, color_not_number); + tcase_add_test(tcase, color_not_variable); + tcase_add_test(tcase, fontstyle_not_number); + tcase_add_test(tcase, fontstyle_not_variable); + tcase_add_test(tcase, shape_not_number); + tcase_add_test(tcase, x_not_vector); + tcase_add_test(tcase, layout_not_reactant); + suite_add_tcase(suite, tcase); return suite; diff --git a/src/test/TestRunner.cpp b/src/test/TestRunner.cpp index 9f4e1542..71eae1be 100644 --- a/src/test/TestRunner.cpp +++ b/src/test/TestRunner.cpp @@ -51,6 +51,7 @@ Suite *create_suite_Hierarchy(void); Suite *create_suite_Flattening(void); Suite *create_suite_Distrib(void); Suite *create_suite_FBC(void); +Suite* create_suite_LayoutRender(void); Suite *create_suite_Constraints(void); Suite *create_suite_CVTerms(void); Suite *create_suite_SBO(void); @@ -131,6 +132,7 @@ main (int argc, char* argv[]) //SRunner *runner = srunner_create( create_suite_Flattening() ); //SRunner *runner = srunner_create( create_suite_Distrib() ); //SRunner *runner = srunner_create( create_suite_FBC() ); + //SRunner *runner = srunner_create( create_suite_LayoutRender() ); //SRunner *runner = srunner_create( create_suite_Constraints() ); //SRunner* runner = srunner_create(create_suite_CVTerms()); //SRunner* runner = srunner_create(create_suite_SBO()); @@ -145,6 +147,7 @@ main (int argc, char* argv[]) srunner_add_suite( runner, create_suite_SBO()); srunner_add_suite( runner, create_suite_Distrib() ); srunner_add_suite( runner, create_suite_FBC() ); + srunner_add_suite( runner, create_suite_LayoutRender() ); srunner_add_suite( runner, create_suite_Constraints() ); srunner_add_suite( runner, create_suite_CVTerms() ); srunner_add_suite( runner, create_suite_Uncert() ); From 139552b3ac546ea04157d24644156282a717df4e Mon Sep 17 00:00:00 2001 From: Lucian Smith Date: Tue, 1 Oct 2024 16:45:02 -0700 Subject: [PATCH 43/43] Add actual layout/render test source. --- src/test/TestAntimonyLayoutRender.cpp | 547 ++++++++++++++++++++++++++ 1 file changed, 547 insertions(+) create mode 100644 src/test/TestAntimonyLayoutRender.cpp diff --git a/src/test/TestAntimonyLayoutRender.cpp b/src/test/TestAntimonyLayoutRender.cpp new file mode 100644 index 00000000..2137e853 --- /dev/null +++ b/src/test/TestAntimonyLayoutRender.cpp @@ -0,0 +1,547 @@ +/** + * \file TestAntimonyLayoutRender.c + * \brief Test Antimony's Layout and Render constructs. + * \author Lucian Smith + * ---------------------------------------------------------------------- -->*/ + +#include "libutil.h" +#include "antimony_api.h" +#include "registry.h" +#include +#include "libsbmlnetwork_layout_helpers.h" +#include "libsbmlnetwork_sbmldocument.h" +#include "libsbmlnetwork_sbmldocument_layout.h" +#include "libsbmlnetwork_sbmldocument_render.h" + + +#include +#include + +using namespace std; +using namespace libsbml; + +BEGIN_C_DECLS + +extern char *TestDataDirectory; + +libsbml::SBMLDocument* translateAntimony(const string& model) +{ + g_registry.SetCC("__"); + // load document + string dir(TestDataDirectory); + long ret = loadAntimonyString(model.c_str()); + fail_unless(ret != -1); + char* atosbml = getCompSBMLString(NULL); + fail_unless(atosbml != NULL); + libsbml::SBMLDocument* doc = LIBSBMLNETWORK_CPP_NAMESPACE::readSBML(atosbml); + clearPreviousLoads(); + return doc; +} + + +START_TEST(test_basic_autolayout) +{ + string model = + "S1->S2;\n" + "S2->S3;\n" + "model.layout = on" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") != 0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") != 0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2") != 0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2") != 0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S3") != 0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S3") != 0); + delete doc; +} +END_TEST + +START_TEST(test_basic_positions) +{ + string model = + "S1->S2;\n" + "S1.pos = {52, 80}\n" + "S2.x = 86\n" + "S2.y = 73\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") == 52); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") == 80); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2") == 86); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2") == 73); + delete doc; +} +END_TEST + +START_TEST(test_basic_sizes) +{ + string model = + "S1->S2;\n" + "S1.size = {52, 80}\n" + "S2.width = 86\n" + "S2.height = 73\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, "S1") == 52.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, "S1") == 80.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, "S2") == 86.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, "S2") == 73.0); + delete doc; +} +END_TEST + +START_TEST(test_maxEdges) +{ + string model = + "S1->S2;\n" + "S1->S3;\n" + "S1->S4;\n" + "S1->S5;\n" + "S1->S6;\n" + "S1->S7;\n" + "S1->S8;\n" + "model.autolayout.maxNumConnectedEdges = 7\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getNumSpeciesGlyphs(doc, "S1") == 1); + delete doc; + + string model2 = + "S1->S2;\n" + "S1->S3;\n" + "S1->S4;\n" + "S1->S5;\n" + "S1->S6;\n" + "S1->S7;\n" + "S1->S8;\n" + "model.layout = on\n" + ; + + doc = translateAntimony(model2); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getNumSpeciesGlyphs(doc, "S1") == 3); + delete doc; +} +END_TEST + +START_TEST(test_useNameAsTextLabel) +{ + string model = + "S1->S2;\n" + "S1 is \"Species 1\"\n" + "model.autolayout.useNameAsTextLabel = false\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getText(doc, "S1") == "S1"); + delete doc; + + string model2 = + "S1->S2;\n" + "S1 is \"Species 1\"\n" + "model.layout = on\n" + ; + + doc = translateAntimony(model2); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getText(doc, "S1") == "Species 1"); + delete doc; +} +END_TEST + +START_TEST(test_setLayoutStyle) +{ + string model = + "S1->S2;\n" + "model.layout = on\n" + "model.layout.style = power\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getBackgroundColor(doc) == "white"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentGeometricShapeType(doc) == "rectangle"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeColor(doc) == "mandy"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeWidth(doc) == 3.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFillColor(doc) == "pewter"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontColor(doc) == "gondola"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontSizeAsDouble(doc) == 10); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesGeometricShapeType(doc) == "rectangle"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFillColor(doc) == "carnation"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeColor(doc) == "gondola"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeWidth(doc) == 3.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontColor(doc) == "gondola"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontSizeAsDouble(doc) == 24.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeColor(doc) == "gondola"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeWidth(doc) == 3.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontColor(doc) == "gondola"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontSizeAsDouble(doc) == 12.0); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getLineEndingStrokeColor(doc) == "gondola"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getLineEndingStrokeWidth(doc) == 3.0); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getLineEndingFillColor(doc) == "gondola"); + + delete doc; +} +END_TEST + +START_TEST(test_layout_size) +{ + string model = + "S1->S2;\n" + "model.layout.size = {1234, 1432}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc) == 1234.0); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc) == 1432.0); + delete doc; + + model = + "S1->S2;\n" + "model.layout.width = 1234\n" + "model.layout.height = 1432\n" + ; + + doc = translateAntimony(model); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc) == 1234.0); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc) == 1432.0); + delete doc; +} +END_TEST + +START_TEST(test_align_top) +{ + string model = + "S1->S2;\n" + "S2->S3;\n" + "S3->S4;\n" + "model.layout.size = {1000, 1000}\n" + "model.layout.align_top = {S1, S2, S3}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2")); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S3")); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") < 300); + delete doc; +} +END_TEST + +START_TEST(test_align_bottom) +{ + string model = + "S1->S2;\n" + "S2->S3;\n" + "S3->S4;\n" + "model.layout.size = {1000, 1000}\n" + "model.layout.align_top = {S1, S2, S3}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2")); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S3")); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") > 700); + delete doc; +} +END_TEST + +START_TEST(test_align_align_hCenter) +{ + string model = + "S1->S2;\n" + "S2->S3;\n" + "S3->S4;\n" + "model.layout.size = {1000, 1000}\n" + "model.layout.align_top = {S1, S2, S3}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2")); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S3")); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") > 400); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") < 600); + delete doc; +} +END_TEST + +START_TEST(test_align_right) +{ + string model = + "S1->S2;\n" + "S2->S3;\n" + "S3->S4;\n" + "model.layout.size = {1000, 1000}\n" + "model.layout.align_right = {S1, S2, S3}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2")); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S3")); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") > 700); + delete doc; +} +END_TEST + +START_TEST(test_align_left) +{ + string model = + "S1->S2;\n" + "S2->S3;\n" + "S3->S4;\n" + "model.layout.size = {1000, 1000}\n" + "model.layout.align_right = {S1, S2, S3}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2")); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S3")); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") < 300); + delete doc; +} +END_TEST + +START_TEST(test_align_vCenter) +{ + string model = + "S1->S2;\n" + "S2->S3;\n" + "S3->S4;\n" + "model.layout.size = {1000, 1000}\n" + "model.layout.align_right = {S1, S2, S3}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2")); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2") == LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S3")); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") > 400); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") < 600); + delete doc; +} +END_TEST + +START_TEST(test_whole_model_settings) +{ + string model = + "S1->S2;\n" + "model.layout.background = orange\n" + "model.layout.color = khaki\n" + "model.layout.linecolor = azure\n" + "model.layout.fontcolor = coral\n" + "model.layout.linewidth = 32\n" + "model.layout.font = monospace\n" + "model.layout.fontsize = 4\n" + "model.layout.fontstyle = italic\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getBackgroundColor(doc) == "orange"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFillColor(doc) == "khaki"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFillColor(doc) == "khaki"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFillColor(doc) == "khaki"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeColor(doc) == "azure"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeColor(doc) == "azure"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeColor(doc) == "azure"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontColor(doc) == "coral"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontColor(doc) == "coral"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontColor(doc) == "coral"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeWidth(doc) == 32.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeWidth(doc) == 32.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeWidth(doc) == 32.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontFamily(doc) == "monospace"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontFamily(doc) == "monospace"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontFamily(doc) == "monospace"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontSizeAsDouble(doc) == 4.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontSizeAsDouble(doc) == 4.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontSizeAsDouble(doc) == 4.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontStyle(doc) == "italic"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontStyle(doc) == "italic"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontStyle(doc) == "italic"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontWeight(doc) == "normal"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontWeight(doc) == "normal"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontWeight(doc) == "normal"); + delete doc; +} +END_TEST + +START_TEST(test_species_settings) +{ + string model = + "S1->S2;\n" + "species.size = {42, 55}\n" + "species.color = khaki\n" + "species.linecolor = azure\n" + "species.fontcolor = coral\n" + "species.linewidth = 32\n" + "species.font = monospace\n" + "species.fontsize = 4\n" + "species.fontstyle = italic\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, "S1") == 42.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, "S1") == 55.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, "S2") == 42.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, "S2") == 55.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFillColor(doc) == "khaki"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeColor(doc) == "azure"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontColor(doc) == "coral"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesStrokeWidth(doc) == 32.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontFamily(doc) == "monospace"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontSizeAsDouble(doc) == 4.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontStyle(doc) == "italic"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getSpeciesFontWeight(doc) == "normal"); + delete doc; +} +END_TEST + +START_TEST(test_compartment_settings) +{ + string model = + "species S1 in C, S2 in C\n" + "S1->S2;\n" + "compartment.size = {420, 550}\n" + "compartment.color = khaki\n" + "compartment.linecolor = azure\n" + "compartment.fontcolor = coral\n" + "compartment.linewidth = 32\n" + "compartment.font = monospace\n" + "compartment.fontsize = 4\n" + "compartment.fontstyle = italic\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, "C") == 420.0); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, "C") == 550.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFillColor(doc) == "khaki"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeColor(doc) == "azure"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontColor(doc) == "coral"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentStrokeWidth(doc) == 32.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontFamily(doc) == "monospace"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontSizeAsDouble(doc) == 4.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontStyle(doc) == "italic"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getCompartmentFontWeight(doc) == "normal"); + delete doc; +} +END_TEST + +START_TEST(test_reaction_settings) +{ + string model = + "J0: S1->S2;\n" + "reaction.size = {420, 550}\n" + "reaction.color = khaki\n" + "reaction.linecolor = azure\n" + "reaction.fontcolor = coral\n" + "reaction.linewidth = 32\n" + "reaction.font = monospace\n" + "reaction.fontsize = 4\n" + "reaction.fontstyle = italic\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionWidth(doc, "J0") == 420.0); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getDimensionHeight(doc, "J0") == 550.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFillColor(doc) == "khaki"); + //fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeColor(doc) == "azure"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontColor(doc) == "coral"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionStrokeWidth(doc) == 32.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontFamily(doc) == "monospace"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontSizeAsDouble(doc) == 4.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontStyle(doc) == "italic"); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getReactionFontWeight(doc) == "normal"); + delete doc; +} +END_TEST + +START_TEST(test_locations_pos) +{ + string model = + "J0: S1->S2;\n" + "S1.pos= {120, 250}\n" + "S2.pos= {420, 550}\n" + "J0.pos= {270, 400}\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") == 120.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") == 250.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2") == 420.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2") == 550.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "J0") == 270.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "J0") == 400.0); + delete doc; +} +END_TEST + +START_TEST(test_locations_xy) +{ + string model = + "J0: S1->S2;\n" + "S1.x= 120\n" + "S2.x= 420\n" + "J0.x= 270\n" + "S1.y= 250\n" + "S2.y= 550\n" + "J0.y= 400\n" + ; + + libsbml::SBMLDocument* doc = translateAntimony(model); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S1") == 120.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S1") == 250.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "S2") == 420.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "S2") == 550.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionX(doc, "J0") == 270.0); + fail_unless(LIBSBMLNETWORK_CPP_NAMESPACE::getPositionY(doc, "J0") == 400.0); + delete doc; +} +END_TEST + + + + + +Suite * +create_suite_LayoutRender(void) +{ + Suite *suite = suite_create("Antimony LayoutRender"); + TCase *tcase = tcase_create("Antimony LayoutRender"); + + + tcase_add_test( tcase, test_useNameAsTextLabel); + tcase_add_test( tcase, test_basic_autolayout); + tcase_add_test( tcase, test_basic_positions); + tcase_add_test( tcase, test_basic_sizes); + tcase_add_test( tcase, test_maxEdges); + tcase_add_test( tcase, test_setLayoutStyle); + tcase_add_test( tcase, test_layout_size); + tcase_add_test( tcase, test_align_top); + tcase_add_test( tcase, test_align_bottom); + tcase_add_test( tcase, test_align_align_hCenter); + tcase_add_test( tcase, test_align_right); + tcase_add_test( tcase, test_align_left); + tcase_add_test( tcase, test_align_vCenter); + tcase_add_test( tcase, test_whole_model_settings); + tcase_add_test( tcase, test_species_settings); + tcase_add_test( tcase, test_compartment_settings); + tcase_add_test( tcase, test_reaction_settings); + tcase_add_test( tcase, test_locations_pos); + tcase_add_test( tcase, test_locations_xy); + //tcase_add_test( tcase, test_compartment_settings); + //tcase_add_test( tcase, test_compartment_settings); + //tcase_add_test( tcase, test_compartment_settings); + //tcase_add_test( tcase, test_compartment_settings); + //tcase_add_test( tcase, test_compartment_settings); + //tcase_add_test( tcase, test_compartment_settings); + //tcase_add_test( tcase, test_compartment_settings); + //tcase_add_test( tcase, test_compartment_settings); + + suite_add_tcase(suite, tcase); + + return suite; +} + +END_C_DECLS + +