From bb6d8b3a6b0c1a0ad4363ce3a427b4497520387a Mon Sep 17 00:00:00 2001 From: Bob Eberlein Date: Thu, 26 Jul 2018 08:33:01 -0400 Subject: [PATCH] fixes for croads --- src/Vensim/VYacc.tab.cpp | 538 +++++++++++++++++++------------------ src/Vensim/VYacc.y | 2 + src/Vensim/VensimParse.cpp | 13 +- 3 files changed, 290 insertions(+), 263 deletions(-) diff --git a/src/Vensim/VYacc.tab.cpp b/src/Vensim/VYacc.tab.cpp index 696d67c..a0d95dd 100644 --- a/src/Vensim/VYacc.tab.cpp +++ b/src/Vensim/VYacc.tab.cpp @@ -395,16 +395,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 16 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 300 +#define YYLAST 305 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 51 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 25 /* YYNRULES -- Number of rules. */ -#define YYNRULES 92 +#define YYNRULES 94 /* YYNRULES -- Number of states. */ -#define YYNSTATES 216 +#define YYNSTATES 224 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -455,13 +455,13 @@ static const yytype_uint16 yyprhs[] = 0, 0, 3, 5, 7, 9, 11, 16, 21, 25, 29, 30, 37, 39, 43, 48, 53, 64, 68, 70, 75, 79, 81, 84, 87, 89, 92, 96, 98, 101, - 105, 110, 112, 118, 122, 130, 132, 139, 148, 150, - 152, 154, 157, 160, 162, 166, 170, 174, 176, 178, - 180, 182, 185, 189, 191, 197, 201, 209, 210, 213, - 215, 219, 221, 223, 225, 227, 232, 236, 241, 245, - 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, - 288, 292, 295, 298, 302, 304, 320, 338, 340, 356, - 358, 362, 368 + 105, 110, 112, 118, 122, 130, 132, 139, 148, 154, + 162, 164, 166, 168, 171, 174, 176, 180, 184, 188, + 190, 192, 194, 196, 199, 203, 205, 211, 215, 223, + 224, 227, 229, 233, 235, 237, 239, 241, 246, 250, + 255, 259, 263, 267, 271, 275, 279, 283, 287, 291, + 295, 299, 302, 306, 309, 312, 316, 318, 334, 352, + 354, 370, 372, 376, 382 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -481,30 +481,31 @@ static const yytype_int8 yyrhs[] = 28, -1, 43, 28, 34, 28, 44, -1, 61, 45, 28, -1, 61, 45, 43, 28, 34, 28, 44, -1, 65, -1, 65, 47, 63, 45, 63, 48, -1, 65, - 47, 63, 45, 63, 45, 63, 48, -1, 64, -1, - 50, -1, 26, -1, 34, 26, -1, 35, 26, -1, - 29, -1, 65, 40, 65, -1, 65, 39, 65, -1, - 43, 65, 44, -1, 17, -1, 18, -1, 13, -1, - 14, -1, 15, 59, -1, 67, 45, 59, -1, 28, - -1, 43, 28, 46, 60, 44, -1, 68, 45, 28, - -1, 68, 45, 43, 28, 46, 60, 44, -1, -1, - 5, 68, -1, 71, -1, 70, 45, 71, -1, 26, - -1, 16, -1, 58, -1, 27, -1, 58, 43, 71, - 44, -1, 43, 71, 44, -1, 30, 43, 70, 44, - -1, 30, 43, 44, -1, 71, 35, 71, -1, 71, - 34, 71, -1, 71, 39, 71, -1, 71, 40, 71, - -1, 71, 37, 71, -1, 71, 23, 71, -1, 71, - 38, 71, -1, 71, 22, 71, -1, 71, 11, 71, - -1, 71, 8, 71, -1, 12, 71, -1, 71, 36, - 71, -1, 34, 71, -1, 35, 71, -1, 71, 41, - 71, -1, 75, -1, 47, 43, 64, 45, 64, 44, - 34, 43, 64, 45, 64, 44, 48, 45, 75, -1, - 47, 43, 64, 45, 64, 44, 34, 43, 64, 45, - 64, 44, 45, 75, 48, 45, 75, -1, 74, -1, - 47, 43, 64, 45, 64, 44, 34, 43, 64, 45, - 64, 44, 48, 45, 74, -1, 64, -1, 74, 45, - 64, -1, 43, 64, 45, 64, 44, -1, 75, 45, - 43, 64, 45, 64, 44, -1 + 47, 63, 45, 63, 45, 63, 48, -1, 47, 63, + 45, 63, 48, -1, 47, 63, 45, 63, 45, 63, + 48, -1, 64, -1, 50, -1, 26, -1, 34, 26, + -1, 35, 26, -1, 29, -1, 65, 40, 65, -1, + 65, 39, 65, -1, 43, 65, 44, -1, 17, -1, + 18, -1, 13, -1, 14, -1, 15, 59, -1, 67, + 45, 59, -1, 28, -1, 43, 28, 46, 60, 44, + -1, 68, 45, 28, -1, 68, 45, 43, 28, 46, + 60, 44, -1, -1, 5, 68, -1, 71, -1, 70, + 45, 71, -1, 26, -1, 16, -1, 58, -1, 27, + -1, 58, 43, 71, 44, -1, 43, 71, 44, -1, + 30, 43, 70, 44, -1, 30, 43, 44, -1, 71, + 35, 71, -1, 71, 34, 71, -1, 71, 39, 71, + -1, 71, 40, 71, -1, 71, 37, 71, -1, 71, + 23, 71, -1, 71, 38, 71, -1, 71, 22, 71, + -1, 71, 11, 71, -1, 71, 8, 71, -1, 12, + 71, -1, 71, 36, 71, -1, 34, 71, -1, 35, + 71, -1, 71, 41, 71, -1, 75, -1, 47, 43, + 64, 45, 64, 44, 34, 43, 64, 45, 64, 44, + 48, 45, 75, -1, 47, 43, 64, 45, 64, 44, + 34, 43, 64, 45, 64, 44, 45, 75, 48, 45, + 75, -1, 74, -1, 47, 43, 64, 45, 64, 44, + 34, 43, 64, 45, 64, 44, 48, 45, 74, -1, + 64, -1, 74, 45, 64, -1, 43, 64, 45, 64, + 44, -1, 75, 45, 43, 64, 45, 64, 44, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -513,13 +514,13 @@ static const yytype_uint8 yyrline[] = 0, 83, 83, 84, 85, 86, 87, 88, 89, 90, 94, 94, 98, 105, 106, 107, 108, 109, 110, 111, 112, 117, 118, 119, 123, 124, 128, 132, 133, 134, - 135, 138, 139, 140, 141, 145, 146, 147, 151, 152, - 155, 156, 157, 161, 162, 163, 164, 169, 170, 171, - 172, 176, 177, 181, 182, 183, 184, 189, 190, 195, - 196, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 135, 138, 139, 140, 141, 145, 146, 147, 148, 149, + 153, 154, 157, 158, 159, 163, 164, 165, 166, 171, + 172, 173, 174, 178, 179, 183, 184, 185, 186, 191, + 192, 197, 198, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 226, 227, 229, 234, 235, 240, - 241, 246, 247 + 219, 220, 221, 222, 223, 224, 228, 229, 231, 236, + 237, 242, 243, 248, 249 }; #endif @@ -565,13 +566,13 @@ static const yytype_uint8 yyr1[] = 0, 51, 52, 52, 52, 52, 52, 52, 52, 52, 54, 53, 55, 56, 56, 56, 56, 56, 56, 56, 56, 57, 57, 57, 58, 58, 59, 60, 60, 60, - 60, 61, 61, 61, 61, 62, 62, 62, 63, 63, - 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, - 66, 67, 67, 68, 68, 68, 68, 69, 69, 70, - 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, + 60, 61, 61, 61, 61, 62, 62, 62, 62, 62, + 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, + 66, 66, 66, 67, 67, 68, 68, 68, 68, 69, + 69, 70, 70, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 72, 72, 72, 73, 73, 74, - 74, 75, 75 + 71, 71, 71, 71, 71, 71, 72, 72, 72, 73, + 73, 74, 74, 75, 75 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -580,13 +581,13 @@ static const yytype_uint8 yyr2[] = 0, 2, 1, 1, 1, 1, 4, 4, 3, 3, 0, 6, 1, 3, 4, 4, 10, 3, 1, 4, 3, 1, 2, 2, 1, 2, 3, 1, 2, 3, - 4, 1, 5, 3, 7, 1, 6, 8, 1, 1, - 1, 2, 2, 1, 3, 3, 3, 1, 1, 1, - 1, 2, 3, 1, 5, 3, 7, 0, 2, 1, - 3, 1, 1, 1, 1, 4, 3, 4, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, - 3, 2, 2, 3, 1, 15, 17, 1, 15, 1, - 3, 5, 7 + 4, 1, 5, 3, 7, 1, 6, 8, 5, 7, + 1, 1, 1, 2, 2, 1, 3, 3, 3, 1, + 1, 1, 1, 2, 3, 1, 5, 3, 7, 0, + 2, 1, 3, 1, 1, 1, 1, 4, 3, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 2, 3, 2, 2, 3, 1, 15, 17, 1, + 15, 1, 3, 5, 7 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -596,71 +597,73 @@ static const yytype_uint8 yydefact[] = { 0, 3, 10, 12, 2, 24, 0, 4, 5, 0, 18, 21, 0, 0, 0, 25, 1, 0, 0, 0, - 0, 49, 50, 0, 47, 48, 23, 22, 0, 31, - 0, 57, 27, 0, 43, 9, 8, 0, 0, 35, - 0, 62, 61, 64, 24, 0, 0, 0, 0, 63, - 17, 0, 20, 13, 59, 40, 0, 0, 0, 0, - 89, 0, 0, 87, 84, 51, 0, 0, 0, 0, - 0, 19, 28, 0, 26, 0, 7, 6, 0, 0, - 0, 79, 0, 81, 82, 0, 0, 0, 0, 0, + 0, 51, 52, 0, 49, 50, 23, 22, 0, 31, + 0, 59, 27, 0, 45, 9, 8, 0, 0, 0, + 35, 0, 64, 63, 66, 24, 0, 0, 0, 0, + 65, 17, 0, 20, 13, 61, 42, 0, 0, 0, + 0, 91, 0, 0, 89, 86, 53, 0, 0, 0, + 0, 0, 19, 28, 0, 26, 0, 41, 0, 40, + 7, 6, 0, 0, 0, 81, 0, 83, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 41, 42, 0, 0, 14, 15, 0, 0, 52, - 0, 0, 53, 0, 58, 33, 0, 29, 46, 45, - 44, 39, 0, 38, 68, 0, 66, 0, 78, 77, - 76, 74, 70, 69, 80, 73, 75, 71, 72, 83, - 0, 60, 0, 0, 90, 0, 11, 0, 0, 0, - 0, 30, 0, 67, 65, 0, 0, 0, 0, 32, - 0, 55, 0, 0, 0, 0, 91, 0, 0, 0, - 0, 0, 0, 36, 0, 0, 0, 0, 54, 0, - 34, 0, 0, 0, 0, 92, 0, 37, 0, 16, - 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 88, 85, - 0, 0, 0, 86, 0, 0 + 0, 0, 0, 0, 0, 43, 44, 0, 0, 14, + 15, 0, 0, 54, 0, 0, 55, 0, 60, 33, + 0, 29, 48, 0, 47, 46, 0, 70, 0, 68, + 0, 80, 79, 78, 76, 72, 71, 82, 75, 77, + 73, 74, 85, 0, 62, 0, 0, 92, 0, 11, + 0, 0, 0, 0, 30, 0, 0, 69, 67, 0, + 0, 0, 0, 32, 0, 57, 0, 0, 0, 38, + 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 0, 56, 0, 34, 39, 0, + 0, 0, 0, 94, 0, 37, 0, 16, 0, 58, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 90, 87, 0, 0, + 0, 88, 0, 0 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { - -1, 6, 7, 12, 8, 9, 10, 49, 15, 33, - 31, 38, 122, 123, 39, 26, 27, 114, 71, 53, - 54, 61, 62, 63, 64 + -1, 6, 7, 12, 8, 9, 10, 50, 15, 33, + 31, 39, 78, 79, 40, 26, 27, 118, 72, 54, + 55, 62, 63, 64, 65 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -147 +#define YYPACT_NINF -156 static const yytype_int16 yypact[] = { - 140, -147, -147, -147, -147, -5, 144, -147, -147, 56, - 0, 239, 112, -19, 131, -147, -147, -22, 126, 81, - 208, -147, -147, 124, -147, -147, -147, 129, 166, -147, - 170, -1, 161, 78, -147, -147, -147, 59, 77, 168, - 126, -147, -147, -147, 124, 171, 126, 126, 126, 173, - 189, 175, -147, 138, 189, -147, 187, 193, 86, 177, - -147, 178, 192, 196, 199, -147, 124, 126, 203, -6, - 5, -147, -147, 210, -147, 55, -147, -147, 59, 59, - -18, 204, 205, 165, 165, 95, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, -147, -147, 201, 86, -147, -147, 86, 207, -147, - 16, 219, -147, 230, 214, -147, 232, 212, -147, -147, - -147, -147, 217, -147, -147, 69, -147, 155, -27, 27, - 51, 51, 165, 165, 51, 51, 51, 204, 204, 204, - 17, 189, 86, 218, -147, 86, -147, 220, 221, 58, - 231, -147, -18, -147, -147, 223, 224, 86, 225, -147, - 131, -147, 241, 243, 98, 53, -147, 228, 86, 83, - 227, 233, -18, -147, 235, 236, 240, 237, -147, 131, - -147, 234, 86, 242, 244, -147, 113, -147, 238, -147, - 86, -147, 86, 245, 247, 86, 250, 248, 246, 119, - 86, 251, 252, 253, 134, -16, 86, 254, 196, 199, - 249, 251, 136, 199, 255, 251 + 5, -156, -156, -156, -156, 143, 13, -156, -156, -24, + 0, 142, 14, -17, 24, -156, -156, 91, 237, 41, + 46, -156, -156, -12, -156, -156, -156, 18, 49, -156, + 107, 2, 103, -4, -156, -156, -156, 83, -18, 53, + 75, 237, -156, -156, -156, -12, 130, 237, 237, 237, + 139, 197, 144, -156, 134, 197, -156, 192, 202, 48, + 196, -156, 162, 198, 195, 205, -156, -12, 237, 217, + -9, 23, -156, -156, 213, -156, 177, -156, 209, -156, + -156, -156, 83, 83, -18, 211, -6, 173, 173, 128, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, -156, -156, 210, 48, -156, + -156, 48, 214, -156, 147, 228, -156, 230, 215, -156, + 231, 212, -156, -18, -156, -156, 221, -156, 178, -156, + 163, 136, 207, 19, 19, 173, 173, 19, 19, 19, + 211, 211, 211, 108, 197, 48, 223, -156, 48, -156, + 218, 224, 34, 235, -156, 16, -18, -156, -156, 232, + 229, 48, 233, -156, 24, -156, 246, 248, -18, -156, + 73, 47, -156, 238, 48, 180, 239, 240, 241, -18, + -156, 234, 242, 245, 243, -156, 24, -156, -156, 244, + 48, 247, 250, -156, 182, -156, 236, -156, 48, -156, + 48, 249, 251, 48, 254, 252, 255, 84, 48, 256, + 257, 258, 92, 44, 48, 259, 195, 205, 253, 256, + 113, 205, 260, 256 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -147, -147, -147, -147, -147, -147, -147, 275, -21, -145, - -147, -147, -146, -20, -32, -147, -147, -147, -147, 22, - -17, 111, -147, 74, -60 + -156, -156, -156, -156, -156, -156, -156, 283, -21, -155, + -156, -156, -83, -20, -33, -156, -156, -156, -156, -63, + 7, 119, -156, 87, -96 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -669,78 +672,78 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { - 60, 50, 65, 18, 69, 75, 164, 34, 55, 29, - 55, 35, 96, 97, 98, 169, 56, 57, 56, 57, - 36, 37, 112, 81, 30, 87, 181, 58, 88, 83, - 84, 85, 121, 115, 186, 87, 19, 113, 103, 89, - 90, 13, 14, 20, 70, 109, 119, 120, 116, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 87, - 146, 100, 155, 93, 94, 95, 96, 97, 98, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 143, 51, 161, 144, 34, 110, - 96, 97, 98, 40, 78, 79, 58, 41, 17, 118, - 174, 162, 37, 87, 125, 52, 88, 42, 43, 44, - 76, 45, 55, 153, 100, 46, 47, 89, 90, 77, - 56, 57, 156, 73, 48, 158, 74, 178, 73, 91, - 92, 93, 94, 95, 96, 97, 98, 167, 40, 126, - 28, 204, 41, 172, 16, 209, 173, 1, 177, 2, - 3, 213, 42, 43, 44, 209, 45, 191, 73, 32, - 46, 47, 188, 87, 201, 4, 88, 202, 5, 48, - 193, 14, 194, 87, 66, 197, 88, 89, 90, 108, - 203, 201, 207, 100, 214, 60, 210, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 87, 68, 154, - 88, 93, 94, 95, 96, 97, 98, 78, 79, 67, - 72, 89, 90, 101, 82, 80, 86, 40, 99, 102, - 104, 41, 105, 91, 92, 93, 94, 95, 96, 97, - 98, 42, 43, 44, 55, 45, 106, 111, 117, 46, - 47, 107, 56, 57, 108, 98, 142, 147, 48, 124, - 145, 58, 21, 22, 23, 59, 24, 25, 148, 149, - 150, 151, 152, 157, 159, 163, 165, 160, 166, 170, - 168, 171, 176, 179, 184, 11, 175, 180, 182, 208, - 183, 185, 187, 192, 198, 0, 189, 190, 0, 200, - 195, 196, 199, 212, 58, 0, 0, 205, 206, 211, - 215 + 61, 126, 66, 18, 76, 114, 41, 70, 56, 175, + 42, 29, 1, 16, 2, 3, 57, 58, 17, 116, + 43, 44, 45, 128, 46, 51, 30, 91, 47, 48, + 4, 194, 77, 5, 117, 14, 19, 49, 127, 107, + 155, 74, 28, 20, 75, 52, 113, 71, 85, 124, + 125, 119, 32, 41, 87, 88, 89, 42, 100, 101, + 102, 168, 165, 67, 169, 53, 120, 43, 44, 45, + 56, 46, 56, 170, 56, 47, 48, 166, 57, 58, + 57, 58, 57, 58, 49, 178, 80, 59, 146, 59, + 59, 147, 68, 60, 181, 81, 189, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 34, 212, 82, 83, 91, 217, 179, 92, + 34, 180, 84, 221, 35, 160, 37, 217, 162, 209, + 93, 94, 210, 36, 37, 69, 91, 112, 38, 92, + 215, 173, 95, 96, 97, 98, 99, 100, 101, 102, + 93, 94, 73, 159, 184, 21, 22, 23, 209, 24, + 25, 222, 95, 96, 97, 98, 99, 100, 101, 102, + 196, 91, 129, 86, 92, 100, 101, 102, 201, 104, + 202, 91, 90, 205, 92, 93, 94, 103, 211, 13, + 14, 149, 104, 61, 218, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 91, 109, 158, 92, 97, + 98, 99, 100, 101, 102, 91, 82, 83, 105, 93, + 94, 122, 157, 104, 185, 74, 199, 74, 106, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 108, + 111, 121, 110, 97, 98, 99, 100, 101, 102, 41, + 112, 115, 102, 42, 123, 145, 150, 148, 151, 153, + 152, 154, 163, 43, 44, 45, 156, 46, 161, 167, + 164, 47, 48, 172, 176, 171, 177, 190, 174, 192, + 49, 200, 183, 11, 187, 186, 191, 193, 206, 188, + 182, 197, 195, 198, 203, 204, 207, 220, 208, 59, + 216, 0, 213, 214, 219, 223 }; #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-147))) + (!!((Yystate) == (-156))) #define yytable_value_is_error(Yytable_value) \ YYID (0) static const yytype_int16 yycheck[] = { - 20, 18, 23, 3, 5, 37, 152, 29, 26, 28, - 26, 33, 39, 40, 41, 160, 34, 35, 34, 35, - 42, 43, 28, 40, 43, 8, 172, 43, 11, 46, - 47, 48, 50, 28, 179, 8, 36, 43, 58, 22, - 23, 46, 47, 43, 45, 66, 78, 79, 43, 22, - 23, 34, 35, 36, 37, 38, 39, 40, 41, 8, - 44, 45, 45, 36, 37, 38, 39, 40, 41, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 104, 4, 28, 107, 29, 67, - 39, 40, 41, 12, 39, 40, 43, 16, 42, 44, - 47, 43, 43, 8, 82, 24, 11, 26, 27, 28, - 33, 30, 26, 44, 45, 34, 35, 22, 23, 42, - 34, 35, 142, 45, 43, 145, 48, 44, 45, 34, - 35, 36, 37, 38, 39, 40, 41, 157, 12, 44, - 28, 201, 16, 45, 0, 205, 48, 7, 168, 9, - 10, 211, 26, 27, 28, 215, 30, 44, 45, 28, - 34, 35, 182, 8, 45, 25, 11, 48, 28, 43, - 190, 47, 192, 8, 45, 195, 11, 22, 23, 45, - 200, 45, 48, 45, 48, 205, 206, 22, 23, 34, - 35, 36, 37, 38, 39, 40, 41, 8, 28, 44, - 11, 36, 37, 38, 39, 40, 41, 39, 40, 43, - 49, 22, 23, 26, 43, 47, 43, 12, 43, 26, - 43, 16, 44, 34, 35, 36, 37, 38, 39, 40, - 41, 26, 27, 28, 26, 30, 44, 34, 28, 34, - 35, 45, 34, 35, 45, 41, 45, 28, 43, 44, - 43, 43, 13, 14, 15, 47, 17, 18, 28, 45, - 28, 49, 45, 45, 44, 34, 43, 46, 44, 28, - 45, 28, 44, 46, 34, 0, 165, 44, 43, 205, - 44, 44, 48, 45, 34, -1, 44, 43, -1, 43, - 45, 44, 44, 44, 43, -1, -1, 45, 45, 45, - 45 + 20, 84, 23, 3, 37, 68, 12, 5, 26, 164, + 16, 28, 7, 0, 9, 10, 34, 35, 42, 28, + 26, 27, 28, 86, 30, 18, 43, 8, 34, 35, + 25, 186, 50, 28, 43, 47, 36, 43, 44, 59, + 123, 45, 28, 43, 48, 4, 67, 45, 41, 82, + 83, 28, 28, 12, 47, 48, 49, 16, 39, 40, + 41, 45, 28, 45, 48, 24, 43, 26, 27, 28, + 26, 30, 26, 156, 26, 34, 35, 43, 34, 35, + 34, 35, 34, 35, 43, 168, 33, 43, 108, 43, + 43, 111, 43, 47, 47, 42, 179, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 29, 209, 39, 40, 8, 213, 45, 11, + 29, 48, 47, 219, 33, 145, 43, 223, 148, 45, + 22, 23, 48, 42, 43, 28, 8, 45, 47, 11, + 48, 161, 34, 35, 36, 37, 38, 39, 40, 41, + 22, 23, 49, 45, 174, 13, 14, 15, 45, 17, + 18, 48, 34, 35, 36, 37, 38, 39, 40, 41, + 190, 8, 44, 43, 11, 39, 40, 41, 198, 45, + 200, 8, 43, 203, 11, 22, 23, 43, 208, 46, + 47, 44, 45, 213, 214, 22, 23, 34, 35, 36, + 37, 38, 39, 40, 41, 8, 44, 44, 11, 36, + 37, 38, 39, 40, 41, 8, 39, 40, 26, 22, + 23, 44, 44, 45, 44, 45, 44, 45, 26, 22, + 23, 34, 35, 36, 37, 38, 39, 40, 41, 43, + 45, 28, 44, 36, 37, 38, 39, 40, 41, 12, + 45, 34, 41, 16, 45, 45, 28, 43, 28, 28, + 45, 49, 44, 26, 27, 28, 45, 30, 45, 34, + 46, 34, 35, 44, 28, 43, 28, 43, 45, 34, + 43, 45, 44, 0, 44, 46, 44, 44, 34, 48, + 171, 44, 48, 43, 45, 44, 44, 44, 43, 43, + 213, -1, 45, 45, 45, 45 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -750,25 +753,26 @@ static const yytype_uint8 yystos[] = 0, 7, 9, 10, 25, 28, 52, 53, 55, 56, 57, 58, 54, 46, 47, 59, 0, 42, 3, 36, 43, 13, 14, 15, 17, 18, 66, 67, 28, 28, - 43, 61, 28, 60, 29, 33, 42, 43, 62, 65, - 12, 16, 26, 27, 28, 30, 34, 35, 43, 58, - 71, 4, 24, 70, 71, 26, 34, 35, 43, 47, - 64, 72, 73, 74, 75, 59, 45, 43, 28, 5, - 45, 69, 49, 45, 48, 65, 33, 42, 39, 40, - 47, 71, 43, 71, 71, 71, 43, 8, 11, 22, - 23, 34, 35, 36, 37, 38, 39, 40, 41, 43, - 45, 26, 26, 64, 43, 44, 44, 45, 45, 59, - 70, 34, 28, 43, 68, 28, 43, 28, 44, 65, - 65, 50, 63, 64, 44, 70, 44, 71, 71, 71, + 43, 61, 28, 60, 29, 33, 42, 43, 47, 62, + 65, 12, 16, 26, 27, 28, 30, 34, 35, 43, + 58, 71, 4, 24, 70, 71, 26, 34, 35, 43, + 47, 64, 72, 73, 74, 75, 59, 45, 43, 28, + 5, 45, 69, 49, 45, 48, 65, 50, 63, 64, + 33, 42, 39, 40, 47, 71, 43, 71, 71, 71, + 43, 8, 11, 22, 23, 34, 35, 36, 37, 38, + 39, 40, 41, 43, 45, 26, 26, 64, 43, 44, + 44, 45, 45, 59, 70, 34, 28, 43, 68, 28, + 43, 28, 44, 45, 65, 65, 63, 44, 70, 44, 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 45, 64, 64, 43, 44, 28, 28, 45, - 28, 49, 45, 44, 44, 45, 64, 45, 64, 44, - 46, 28, 43, 34, 63, 43, 44, 64, 45, 60, - 28, 28, 45, 48, 47, 72, 44, 64, 44, 46, - 44, 63, 43, 44, 34, 44, 60, 48, 64, 44, - 43, 44, 45, 64, 64, 45, 44, 64, 34, 44, - 43, 45, 48, 64, 75, 45, 45, 48, 74, 75, - 64, 45, 44, 75, 48, 45 + 71, 71, 71, 71, 71, 45, 64, 64, 43, 44, + 28, 28, 45, 28, 49, 63, 45, 44, 44, 45, + 64, 45, 64, 44, 46, 28, 43, 34, 45, 48, + 63, 43, 44, 64, 45, 60, 28, 28, 63, 45, + 48, 47, 72, 44, 64, 44, 46, 44, 48, 63, + 43, 44, 34, 44, 60, 48, 64, 44, 43, 44, + 45, 64, 64, 45, 44, 64, 34, 44, 43, 45, + 48, 64, 75, 45, 45, 48, 74, 75, 64, 45, + 44, 75, 48, 45 }; #define yyerrok (yyerrstatus = 0) @@ -1786,68 +1790,68 @@ yyparse () case 38: /* Line 1792 of yacc.c */ -#line 151 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.num) = (yyvsp[(1) - (1)].num) ; } +#line 148 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.uni) = vpyy_unitsrange(NULL,(yyvsp[(2) - (5)].num),(yyvsp[(4) - (5)].num),-1) ; } break; case 39: /* Line 1792 of yacc.c */ -#line 152 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.num) = -1e30 ; } +#line 149 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.uni) = vpyy_unitsrange(NULL,(yyvsp[(2) - (7)].num),(yyvsp[(4) - (7)].num),(yyvsp[(6) - (7)].num)) ; } break; case 40: /* Line 1792 of yacc.c */ -#line 155 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" +#line 153 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" {(yyval.num) = (yyvsp[(1) - (1)].num) ; } break; case 41: /* Line 1792 of yacc.c */ -#line 156 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.num) = -(yyvsp[(2) - (2)].num) ;} +#line 154 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + {(yyval.num) = -1e30 ; } break; case 42: /* Line 1792 of yacc.c */ #line 157 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.num) = (yyvsp[(2) - (2)].num) ;} + {(yyval.num) = (yyvsp[(1) - (1)].num) ; } break; case 43: /* Line 1792 of yacc.c */ -#line 161 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.uni) = (yyvsp[(1) - (1)].uni) ; } +#line 158 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + {(yyval.num) = -(yyvsp[(2) - (2)].num) ;} break; case 44: /* Line 1792 of yacc.c */ -#line 162 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.uni) = vpyy_unitsdiv((yyvsp[(1) - (3)].uni),(yyvsp[(3) - (3)].uni));} +#line 159 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + {(yyval.num) = (yyvsp[(2) - (2)].num) ;} break; case 45: /* Line 1792 of yacc.c */ #line 163 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.uni) = vpyy_unitsmult((yyvsp[(1) - (3)].uni),(yyvsp[(3) - (3)].uni));} + { (yyval.uni) = (yyvsp[(1) - (1)].uni) ; } break; case 46: /* Line 1792 of yacc.c */ #line 164 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.uni) = (yyvsp[(2) - (3)].uni) ; } + {(yyval.uni) = vpyy_unitsdiv((yyvsp[(1) - (3)].uni),(yyvsp[(3) - (3)].uni));} break; case 47: /* Line 1792 of yacc.c */ -#line 169 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.tok) = (yyvsp[(1) - (1)].tok) ; } +#line 165 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + {(yyval.uni) = vpyy_unitsmult((yyvsp[(1) - (3)].uni),(yyvsp[(3) - (3)].uni));} break; case 48: /* Line 1792 of yacc.c */ -#line 170 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.tok) = (yyvsp[(1) - (1)].tok) ; } +#line 166 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.uni) = (yyvsp[(2) - (3)].uni) ; } break; case 49: @@ -1864,259 +1868,271 @@ yyparse () case 51: /* Line 1792 of yacc.c */ -#line 176 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.sll) = vpyy_chain_sublist(NULL,(yyvsp[(2) - (2)].sml)) ; } +#line 173 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.tok) = (yyvsp[(1) - (1)].tok) ; } break; case 52: /* Line 1792 of yacc.c */ -#line 177 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { vpyy_chain_sublist((yyvsp[(1) - (3)].sll),(yyvsp[(3) - (3)].sml)) ; (yyval.sll) = (yyvsp[(1) - (3)].sll) ; } +#line 174 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.tok) = (yyvsp[(1) - (1)].tok) ; } break; case 53: /* Line 1792 of yacc.c */ -#line 181 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.sml) = vpyy_symlist(NULL,(yyvsp[(1) - (1)].sym),0,NULL) ; } +#line 178 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.sll) = vpyy_chain_sublist(NULL,(yyvsp[(2) - (2)].sml)) ; } break; case 54: /* Line 1792 of yacc.c */ -#line 182 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.sml) = vpyy_mapsymlist(NULL, (yyvsp[(2) - (5)].sym), (yyvsp[(4) - (5)].sml)); } +#line 179 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { vpyy_chain_sublist((yyvsp[(1) - (3)].sll),(yyvsp[(3) - (3)].sml)) ; (yyval.sll) = (yyvsp[(1) - (3)].sll) ; } break; case 55: /* Line 1792 of yacc.c */ #line 183 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.sml) = vpyy_symlist((yyvsp[(1) - (3)].sml),(yyvsp[(3) - (3)].sym),0,NULL) ;} + { (yyval.sml) = vpyy_symlist(NULL,(yyvsp[(1) - (1)].sym),0,NULL) ; } break; case 56: /* Line 1792 of yacc.c */ #line 184 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.sml) = vpyy_mapsymlist((yyvsp[(1) - (7)].sml), (yyvsp[(4) - (7)].sym), (yyvsp[(6) - (7)].sml));} + { (yyval.sml) = vpyy_mapsymlist(NULL, (yyvsp[(2) - (5)].sym), (yyvsp[(4) - (5)].sml)); } break; case 57: /* Line 1792 of yacc.c */ -#line 189 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.sml) = NULL ; } +#line 185 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.sml) = vpyy_symlist((yyvsp[(1) - (3)].sml),(yyvsp[(3) - (3)].sym),0,NULL) ;} break; case 58: /* Line 1792 of yacc.c */ -#line 190 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.sml) = (yyvsp[(2) - (2)].sml) ; } +#line 186 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.sml) = vpyy_mapsymlist((yyvsp[(1) - (7)].sml), (yyvsp[(4) - (7)].sym), (yyvsp[(6) - (7)].sml));} break; case 59: /* Line 1792 of yacc.c */ -#line 195 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.exl) = vpyy_chain_exprlist(NULL,(yyvsp[(1) - (1)].exn)) ;} +#line 191 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.sml) = NULL ; } break; case 60: /* Line 1792 of yacc.c */ -#line 196 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - {(yyval.exl) = vpyy_chain_exprlist((yyvsp[(1) - (3)].exl),(yyvsp[(3) - (3)].exn)) ; } +#line 192 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.sml) = (yyvsp[(2) - (2)].sml) ; } break; case 61: /* Line 1792 of yacc.c */ -#line 200 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_num_expression((yyvsp[(1) - (1)].num)) ; } +#line 197 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + {(yyval.exl) = vpyy_chain_exprlist(NULL,(yyvsp[(1) - (1)].exn)) ;} break; case 62: /* Line 1792 of yacc.c */ -#line 201 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_num_expression(-1E38);} +#line 198 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + {(yyval.exl) = vpyy_chain_exprlist((yyvsp[(1) - (3)].exl),(yyvsp[(3) - (3)].exn)) ; } break; case 63: /* Line 1792 of yacc.c */ #line 202 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = (Expression *)(yyvsp[(1) - (1)].var) ; } + { (yyval.exn) = vpyy_num_expression((yyvsp[(1) - (1)].num)) ; } break; case 64: /* Line 1792 of yacc.c */ #line 203 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_literal_expression((yyvsp[(1) - (1)].lit)) ; } + { (yyval.exn) = vpyy_num_expression(-1E38);} break; case 65: /* Line 1792 of yacc.c */ #line 204 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_lookup_expression((yyvsp[(1) - (4)].var),(yyvsp[(3) - (4)].exn)) ; } + { (yyval.exn) = (Expression *)(yyvsp[(1) - (1)].var) ; } break; case 66: /* Line 1792 of yacc.c */ #line 205 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('(',(yyvsp[(2) - (3)].exn),NULL) ; } + { (yyval.exn) = vpyy_literal_expression((yyvsp[(1) - (1)].lit)) ; } break; case 67: /* Line 1792 of yacc.c */ #line 206 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_function_expression((yyvsp[(1) - (4)].fnc),(yyvsp[(3) - (4)].exl)) ;} + { (yyval.exn) = vpyy_lookup_expression((yyvsp[(1) - (4)].var),(yyvsp[(3) - (4)].exn)) ; } break; case 68: /* Line 1792 of yacc.c */ #line 207 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_function_expression((yyvsp[(1) - (3)].fnc),NULL) ;} + { (yyval.exn) = vpyy_operator_expression('(',(yyvsp[(2) - (3)].exn),NULL) ; } break; case 69: /* Line 1792 of yacc.c */ #line 208 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('+',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_function_expression((yyvsp[(1) - (4)].fnc),(yyvsp[(3) - (4)].exl)) ;} break; case 70: /* Line 1792 of yacc.c */ #line 209 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('-',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_function_expression((yyvsp[(1) - (3)].fnc),NULL) ;} break; case 71: /* Line 1792 of yacc.c */ #line 210 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('*',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('+',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 72: /* Line 1792 of yacc.c */ #line 211 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('/',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('-',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 73: /* Line 1792 of yacc.c */ #line 212 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('<',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('*',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 74: /* Line 1792 of yacc.c */ #line 213 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression(VPTT_le,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('/',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 75: /* Line 1792 of yacc.c */ #line 214 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('>',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('<',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 76: /* Line 1792 of yacc.c */ #line 215 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression(VPTT_ge,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression(VPTT_le,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 77: /* Line 1792 of yacc.c */ #line 216 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression(VPTT_or,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('>',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 78: /* Line 1792 of yacc.c */ #line 217 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression(VPTT_and,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression(VPTT_ge,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 79: /* Line 1792 of yacc.c */ #line 218 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression(VPTT_not,(yyvsp[(2) - (2)].exn),NULL) ; } + { (yyval.exn) = vpyy_operator_expression(VPTT_or,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 80: /* Line 1792 of yacc.c */ #line 219 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('=',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression(VPTT_and,(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 81: /* Line 1792 of yacc.c */ #line 220 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('-',NULL, (yyvsp[(2) - (2)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression(VPTT_not,(yyvsp[(2) - (2)].exn),NULL) ; } break; case 82: /* Line 1792 of yacc.c */ #line 221 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('+',NULL, (yyvsp[(2) - (2)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('=',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 83: /* Line 1792 of yacc.c */ #line 222 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.exn) = vpyy_operator_expression('^',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } + { (yyval.exn) = vpyy_operator_expression('-',NULL, (yyvsp[(2) - (2)].exn)) ; } break; case 84: /* Line 1792 of yacc.c */ -#line 226 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.tbl) = (yyvsp[(1) - (1)].tbl) ; } +#line 223 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.exn) = vpyy_operator_expression('+',NULL, (yyvsp[(2) - (2)].exn)) ; } break; case 85: /* Line 1792 of yacc.c */ -#line 228 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.tbl) = vpyy_tablerange((yyvsp[(15) - (15)].tbl),(yyvsp[(3) - (15)].num),(yyvsp[(5) - (15)].num),(yyvsp[(9) - (15)].num),(yyvsp[(11) - (15)].num)) ; } +#line 224 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.exn) = vpyy_operator_expression('^',(yyvsp[(1) - (3)].exn),(yyvsp[(3) - (3)].exn)) ; } break; case 86: /* Line 1792 of yacc.c */ -#line 230 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.tbl) = vpyy_tablerange((yyvsp[(17) - (17)].tbl),(yyvsp[(3) - (17)].num),(yyvsp[(5) - (17)].num),(yyvsp[(9) - (17)].num),(yyvsp[(11) - (17)].num)) ; } +#line 228 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.tbl) = (yyvsp[(1) - (1)].tbl) ; } break; case 87: /* Line 1792 of yacc.c */ -#line 234 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" - { (yyval.tbl) = (yyvsp[(1) - (1)].tbl) ; } +#line 230 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.tbl) = vpyy_tablerange((yyvsp[(15) - (15)].tbl),(yyvsp[(3) - (15)].num),(yyvsp[(5) - (15)].num),(yyvsp[(9) - (15)].num),(yyvsp[(11) - (15)].num)) ; } break; case 88: /* Line 1792 of yacc.c */ +#line 232 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.tbl) = vpyy_tablerange((yyvsp[(17) - (17)].tbl),(yyvsp[(3) - (17)].num),(yyvsp[(5) - (17)].num),(yyvsp[(9) - (17)].num),(yyvsp[(11) - (17)].num)) ; } + break; + + case 89: +/* Line 1792 of yacc.c */ #line 236 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" + { (yyval.tbl) = (yyvsp[(1) - (1)].tbl) ; } + break; + + case 90: +/* Line 1792 of yacc.c */ +#line 238 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" { (yyval.tbl) = vpyy_tablerange((yyvsp[(15) - (15)].tbl),(yyvsp[(3) - (15)].num),(yyvsp[(5) - (15)].num),(yyvsp[(9) - (15)].num),(yyvsp[(11) - (15)].num)) ; } break; - case 89: + case 91: /* Line 1792 of yacc.c */ -#line 240 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" +#line 242 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" { (yyval.tbl) = vpyy_tablevec(NULL,(yyvsp[(1) - (1)].num)) ;} break; - case 90: + case 92: /* Line 1792 of yacc.c */ -#line 241 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" +#line 243 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" {(yyval.tbl) = vpyy_tablevec((yyvsp[(1) - (3)].tbl),(yyvsp[(3) - (3)].num)) ;} break; - case 91: + case 93: /* Line 1792 of yacc.c */ -#line 246 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" +#line 248 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" { (yyval.tbl) = vpyy_tablepair(NULL,(yyvsp[(2) - (5)].num),(yyvsp[(4) - (5)].num)) ;} break; - case 92: + case 94: /* Line 1792 of yacc.c */ -#line 247 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" +#line 249 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" {(yyval.tbl) = vpyy_tablepair((yyvsp[(1) - (7)].tbl),(yyvsp[(4) - (7)].num),(yyvsp[(6) - (7)].num)) ;} break; /* Line 1792 of yacc.c */ -#line 2120 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.tab.cpp" +#line 2136 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.tab.cpp" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2348,4 +2364,4 @@ yyparse () /* Line 2055 of yacc.c */ -#line 253 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" +#line 255 "C:\\sdev\\xmutil\\src\\Vensim\\VYacc.y" diff --git a/src/Vensim/VYacc.y b/src/Vensim/VYacc.y index cd86d00..cfc0d31 100644 --- a/src/Vensim/VYacc.y +++ b/src/Vensim/VYacc.y @@ -145,6 +145,8 @@ unitsrange : units { $$ = $1 ; } | units '[' urangenum ',' urangenum ']' { $$ = vpyy_unitsrange($1,$3,$5,-1) ; } | units '[' urangenum ',' urangenum ',' urangenum ']' { $$ = vpyy_unitsrange($1,$3,$5,$7) ; } + | '[' urangenum ',' urangenum ']' { $$ = vpyy_unitsrange(NULL,$2,$4,-1) ; } + | '[' urangenum ',' urangenum ',' urangenum ']' { $$ = vpyy_unitsrange(NULL,$2,$4,$6) ; } ; urangenum : diff --git a/src/Vensim/VensimParse.cpp b/src/Vensim/VensimParse.cpp index b0650f0..9b1d49f 100644 --- a/src/Vensim/VensimParse.cpp +++ b/src/Vensim/VensimParse.cpp @@ -114,11 +114,17 @@ Equation *VensimParse::AddEq(LeftHandSide *lhs,Expression *ex,ExpressionList *ex int i ; for(i=0;iGetExp(i) ; - if(ex->GetType() != EXPTYPE_Number) { + if (ex->GetType() == EXPTYPE_Operator && ex->GetArg(0) == NULL && *ex->GetOperator() == '-') + { + // alloe unary minus here + ent->AddValue(0, -ex->GetArg(1)->Eval(NULL)); // note eval does not need context for number + } + else if(ex->GetType() != EXPTYPE_Number) { mSyntaxError.str = "Expecting only comma delimited numbers " ; throw mSyntaxError ; } - ent->AddValue(0,ex->Eval(NULL)) ; // note eval does not need context for number + else + ent->AddValue(0,ex->Eval(NULL)) ; // note eval does not need context for number delete ex ; } delete exl ; @@ -430,6 +436,9 @@ UnitExpression *VensimParse::UnitsMult(UnitExpression *f,UnitExpression *s) } UnitExpression *VensimParse::UnitsRange(UnitExpression *e,double minval,double maxval,double increment) { + if (e == NULL) { + e = VPObject->InsertUnitExpression(VPObject->InsertUnits("1")); + } e->SetRange(minval,maxval,increment) ; return e ; }