diff --git a/InkBlot/Generated/InkBlotAntlrGrammar.interp b/InkBlot/Generated/InkBlotAntlrGrammar.interp index fa5d560..6bbd98c 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammar.interp +++ b/InkBlot/Generated/InkBlotAntlrGrammar.interp @@ -53,6 +53,7 @@ IDENTIFIER rule names: story topLevelStatements +topLevelStatement knotLevelStatements stitchLevelStatements innerBlockLevelStatements @@ -73,4 +74,4 @@ innerInlineSequenceObjects atn: -[4, 1, 23, 215, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 1, 0, 1, 0, 1, 1, 4, 1, 42, 8, 1, 11, 1, 12, 1, 43, 1, 2, 4, 2, 47, 8, 2, 11, 2, 12, 2, 48, 1, 3, 4, 3, 52, 8, 3, 11, 3, 12, 3, 53, 1, 4, 4, 4, 57, 8, 4, 11, 4, 12, 4, 58, 1, 5, 1, 5, 1, 6, 3, 6, 64, 8, 6, 1, 6, 3, 6, 67, 8, 6, 1, 6, 1, 6, 1, 6, 3, 6, 72, 8, 6, 4, 6, 74, 8, 6, 11, 6, 12, 6, 75, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8, 3, 8, 84, 8, 8, 1, 8, 1, 8, 1, 8, 1, 9, 3, 9, 90, 8, 9, 1, 9, 1, 9, 1, 9, 1, 10, 3, 10, 96, 8, 10, 1, 10, 1, 10, 1, 10, 1, 10, 4, 10, 102, 8, 10, 11, 10, 12, 10, 103, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 4, 10, 111, 8, 10, 11, 10, 12, 10, 112, 1, 10, 1, 10, 1, 10, 1, 10, 4, 10, 119, 8, 10, 11, 10, 12, 10, 120, 1, 10, 1, 10, 1, 10, 1, 10, 3, 10, 127, 8, 10, 1, 11, 3, 11, 130, 8, 11, 1, 11, 1, 11, 3, 11, 134, 8, 11, 1, 11, 1, 11, 3, 11, 138, 8, 11, 1, 11, 1, 11, 3, 11, 142, 8, 11, 5, 11, 144, 8, 11, 10, 11, 12, 11, 147, 9, 11, 1, 11, 3, 11, 150, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 5, 11, 156, 8, 11, 10, 11, 12, 11, 159, 9, 11, 1, 11, 1, 11, 3, 11, 163, 8, 11, 1, 11, 3, 11, 166, 8, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 3, 15, 177, 8, 15, 1, 16, 4, 16, 180, 8, 16, 11, 16, 12, 16, 181, 1, 17, 3, 17, 185, 8, 17, 1, 17, 1, 17, 3, 17, 189, 8, 17, 1, 17, 1, 17, 3, 17, 193, 8, 17, 1, 18, 1, 18, 1, 18, 3, 18, 198, 8, 18, 5, 18, 200, 8, 18, 10, 18, 12, 18, 203, 9, 18, 1, 18, 1, 18, 3, 18, 207, 8, 18, 4, 18, 209, 8, 18, 11, 18, 12, 18, 210, 3, 18, 213, 8, 18, 1, 18, 0, 0, 19, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 0, 1, 1, 0, 13, 19, 234, 0, 38, 1, 0, 0, 0, 2, 41, 1, 0, 0, 0, 4, 46, 1, 0, 0, 0, 6, 51, 1, 0, 0, 0, 8, 56, 1, 0, 0, 0, 10, 60, 1, 0, 0, 0, 12, 63, 1, 0, 0, 0, 14, 79, 1, 0, 0, 0, 16, 81, 1, 0, 0, 0, 18, 89, 1, 0, 0, 0, 20, 95, 1, 0, 0, 0, 22, 129, 1, 0, 0, 0, 24, 167, 1, 0, 0, 0, 26, 169, 1, 0, 0, 0, 28, 171, 1, 0, 0, 0, 30, 176, 1, 0, 0, 0, 32, 179, 1, 0, 0, 0, 34, 184, 1, 0, 0, 0, 36, 212, 1, 0, 0, 0, 38, 39, 3, 2, 1, 0, 39, 1, 1, 0, 0, 0, 40, 42, 3, 10, 5, 0, 41, 40, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 3, 1, 0, 0, 0, 45, 47, 3, 10, 5, 0, 46, 45, 1, 0, 0, 0, 47, 48, 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 5, 1, 0, 0, 0, 50, 52, 3, 10, 5, 0, 51, 50, 1, 0, 0, 0, 52, 53, 1, 0, 0, 0, 53, 51, 1, 0, 0, 0, 53, 54, 1, 0, 0, 0, 54, 7, 1, 0, 0, 0, 55, 57, 3, 10, 5, 0, 56, 55, 1, 0, 0, 0, 57, 58, 1, 0, 0, 0, 58, 56, 1, 0, 0, 0, 58, 59, 1, 0, 0, 0, 59, 9, 1, 0, 0, 0, 60, 61, 5, 10, 0, 0, 61, 11, 1, 0, 0, 0, 62, 64, 3, 10, 5, 0, 63, 62, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 73, 1, 0, 0, 0, 65, 67, 3, 14, 7, 0, 66, 65, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 74, 3, 10, 5, 0, 69, 71, 3, 14, 7, 0, 70, 72, 3, 10, 5, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 66, 1, 0, 0, 0, 73, 69, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 78, 3, 20, 10, 0, 78, 13, 1, 0, 0, 0, 79, 80, 3, 16, 8, 0, 80, 15, 1, 0, 0, 0, 81, 83, 5, 11, 0, 0, 82, 84, 5, 7, 0, 0, 83, 82, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 3, 18, 9, 0, 86, 87, 5, 12, 0, 0, 87, 17, 1, 0, 0, 0, 88, 90, 5, 7, 0, 0, 89, 88, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 91, 1, 0, 0, 0, 91, 92, 3, 28, 14, 0, 92, 93, 3, 30, 15, 0, 93, 19, 1, 0, 0, 0, 94, 96, 5, 7, 0, 0, 95, 94, 1, 0, 0, 0, 95, 96, 1, 0, 0, 0, 96, 126, 1, 0, 0, 0, 97, 98, 5, 20, 0, 0, 98, 127, 3, 22, 11, 0, 99, 100, 5, 21, 0, 0, 100, 102, 3, 22, 11, 0, 101, 99, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 106, 5, 22, 0, 0, 106, 107, 3, 22, 11, 0, 107, 127, 1, 0, 0, 0, 108, 109, 5, 21, 0, 0, 109, 111, 3, 22, 11, 0, 110, 108, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 110, 1, 0, 0, 0, 112, 113, 1, 0, 0, 0, 113, 114, 1, 0, 0, 0, 114, 115, 5, 22, 0, 0, 115, 127, 1, 0, 0, 0, 116, 117, 5, 21, 0, 0, 117, 119, 3, 22, 11, 0, 118, 116, 1, 0, 0, 0, 119, 120, 1, 0, 0, 0, 120, 118, 1, 0, 0, 0, 120, 121, 1, 0, 0, 0, 121, 122, 1, 0, 0, 0, 122, 123, 5, 21, 0, 0, 123, 127, 1, 0, 0, 0, 124, 127, 5, 22, 0, 0, 125, 127, 5, 21, 0, 0, 126, 97, 1, 0, 0, 0, 126, 101, 1, 0, 0, 0, 126, 110, 1, 0, 0, 0, 126, 118, 1, 0, 0, 0, 126, 124, 1, 0, 0, 0, 126, 125, 1, 0, 0, 0, 127, 21, 1, 0, 0, 0, 128, 130, 5, 7, 0, 0, 129, 128, 1, 0, 0, 0, 129, 130, 1, 0, 0, 0, 130, 131, 1, 0, 0, 0, 131, 133, 3, 24, 12, 0, 132, 134, 5, 7, 0, 0, 133, 132, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 145, 1, 0, 0, 0, 135, 137, 5, 1, 0, 0, 136, 138, 5, 7, 0, 0, 137, 136, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 141, 3, 24, 12, 0, 140, 142, 5, 7, 0, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 144, 1, 0, 0, 0, 143, 135, 1, 0, 0, 0, 144, 147, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 149, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 148, 150, 5, 7, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 162, 1, 0, 0, 0, 151, 152, 5, 2, 0, 0, 152, 157, 3, 26, 13, 0, 153, 154, 5, 3, 0, 0, 154, 156, 3, 26, 13, 0, 155, 153, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 160, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 161, 5, 4, 0, 0, 161, 163, 1, 0, 0, 0, 162, 151, 1, 0, 0, 0, 162, 163, 1, 0, 0, 0, 163, 165, 1, 0, 0, 0, 164, 166, 5, 7, 0, 0, 165, 164, 1, 0, 0, 0, 165, 166, 1, 0, 0, 0, 166, 23, 1, 0, 0, 0, 167, 168, 5, 23, 0, 0, 168, 25, 1, 0, 0, 0, 169, 170, 5, 23, 0, 0, 170, 27, 1, 0, 0, 0, 171, 172, 7, 0, 0, 0, 172, 29, 1, 0, 0, 0, 173, 174, 5, 8, 0, 0, 174, 177, 3, 32, 16, 0, 175, 177, 3, 36, 18, 0, 176, 173, 1, 0, 0, 0, 176, 175, 1, 0, 0, 0, 177, 31, 1, 0, 0, 0, 178, 180, 3, 34, 17, 0, 179, 178, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 179, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 33, 1, 0, 0, 0, 183, 185, 5, 7, 0, 0, 184, 183, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 188, 5, 5, 0, 0, 187, 189, 5, 7, 0, 0, 188, 187, 1, 0, 0, 0, 188, 189, 1, 0, 0, 0, 189, 192, 1, 0, 0, 0, 190, 193, 3, 8, 4, 0, 191, 193, 5, 9, 0, 0, 192, 190, 1, 0, 0, 0, 192, 191, 1, 0, 0, 0, 193, 35, 1, 0, 0, 0, 194, 201, 3, 12, 6, 0, 195, 197, 5, 6, 0, 0, 196, 198, 3, 12, 6, 0, 197, 196, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 200, 1, 0, 0, 0, 199, 195, 1, 0, 0, 0, 200, 203, 1, 0, 0, 0, 201, 199, 1, 0, 0, 0, 201, 202, 1, 0, 0, 0, 202, 213, 1, 0, 0, 0, 203, 201, 1, 0, 0, 0, 204, 206, 5, 6, 0, 0, 205, 207, 3, 12, 6, 0, 206, 205, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 209, 1, 0, 0, 0, 208, 204, 1, 0, 0, 0, 209, 210, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 211, 1, 0, 0, 0, 211, 213, 1, 0, 0, 0, 212, 194, 1, 0, 0, 0, 212, 208, 1, 0, 0, 0, 213, 37, 1, 0, 0, 0, 35, 43, 48, 53, 58, 63, 66, 71, 73, 75, 83, 89, 95, 103, 112, 120, 126, 129, 133, 137, 141, 145, 149, 157, 162, 165, 176, 181, 184, 188, 192, 197, 201, 206, 210, 212] \ No newline at end of file +[4, 1, 23, 234, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 1, 0, 1, 0, 1, 1, 4, 1, 44, 8, 1, 11, 1, 12, 1, 45, 1, 2, 1, 2, 3, 2, 50, 8, 2, 1, 3, 1, 3, 4, 3, 54, 8, 3, 11, 3, 12, 3, 55, 1, 4, 1, 4, 4, 4, 60, 8, 4, 11, 4, 12, 4, 61, 1, 5, 1, 5, 4, 5, 66, 8, 5, 11, 5, 12, 5, 67, 1, 6, 1, 6, 1, 7, 3, 7, 73, 8, 7, 1, 7, 3, 7, 76, 8, 7, 1, 7, 1, 7, 1, 7, 3, 7, 81, 8, 7, 4, 7, 83, 8, 7, 11, 7, 12, 7, 84, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 93, 8, 9, 1, 9, 1, 9, 3, 9, 97, 8, 9, 1, 9, 1, 9, 1, 10, 3, 10, 102, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 3, 11, 108, 8, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 114, 8, 11, 11, 11, 12, 11, 115, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 123, 8, 11, 11, 11, 12, 11, 124, 1, 11, 1, 11, 1, 11, 1, 11, 4, 11, 131, 8, 11, 11, 11, 12, 11, 132, 1, 11, 1, 11, 1, 11, 1, 11, 3, 11, 139, 8, 11, 1, 12, 3, 12, 142, 8, 12, 1, 12, 1, 12, 3, 12, 146, 8, 12, 1, 12, 1, 12, 3, 12, 150, 8, 12, 1, 12, 1, 12, 3, 12, 154, 8, 12, 5, 12, 156, 8, 12, 10, 12, 12, 12, 159, 9, 12, 1, 12, 3, 12, 162, 8, 12, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 168, 8, 12, 10, 12, 12, 12, 171, 9, 12, 1, 12, 1, 12, 3, 12, 175, 8, 12, 1, 12, 3, 12, 178, 8, 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 191, 8, 15, 1, 16, 1, 16, 1, 16, 3, 16, 196, 8, 16, 1, 17, 4, 17, 199, 8, 17, 11, 17, 12, 17, 200, 1, 18, 3, 18, 204, 8, 18, 1, 18, 1, 18, 3, 18, 208, 8, 18, 1, 18, 1, 18, 3, 18, 212, 8, 18, 1, 19, 1, 19, 1, 19, 3, 19, 217, 8, 19, 5, 19, 219, 8, 19, 10, 19, 12, 19, 222, 9, 19, 1, 19, 1, 19, 3, 19, 226, 8, 19, 4, 19, 228, 8, 19, 11, 19, 12, 19, 229, 3, 19, 232, 8, 19, 1, 19, 0, 0, 20, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 0, 0, 263, 0, 40, 1, 0, 0, 0, 2, 43, 1, 0, 0, 0, 4, 49, 1, 0, 0, 0, 6, 53, 1, 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 65, 1, 0, 0, 0, 12, 69, 1, 0, 0, 0, 14, 72, 1, 0, 0, 0, 16, 88, 1, 0, 0, 0, 18, 90, 1, 0, 0, 0, 20, 101, 1, 0, 0, 0, 22, 107, 1, 0, 0, 0, 24, 141, 1, 0, 0, 0, 26, 179, 1, 0, 0, 0, 28, 181, 1, 0, 0, 0, 30, 190, 1, 0, 0, 0, 32, 195, 1, 0, 0, 0, 34, 198, 1, 0, 0, 0, 36, 203, 1, 0, 0, 0, 38, 231, 1, 0, 0, 0, 40, 41, 3, 2, 1, 0, 41, 1, 1, 0, 0, 0, 42, 44, 3, 4, 2, 0, 43, 42, 1, 0, 0, 0, 44, 45, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 3, 1, 0, 0, 0, 47, 50, 3, 12, 6, 0, 48, 50, 3, 22, 11, 0, 49, 47, 1, 0, 0, 0, 49, 48, 1, 0, 0, 0, 50, 5, 1, 0, 0, 0, 51, 54, 3, 12, 6, 0, 52, 54, 3, 22, 11, 0, 53, 51, 1, 0, 0, 0, 53, 52, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 7, 1, 0, 0, 0, 57, 60, 3, 12, 6, 0, 58, 60, 3, 22, 11, 0, 59, 57, 1, 0, 0, 0, 59, 58, 1, 0, 0, 0, 60, 61, 1, 0, 0, 0, 61, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 9, 1, 0, 0, 0, 63, 66, 3, 12, 6, 0, 64, 66, 3, 22, 11, 0, 65, 63, 1, 0, 0, 0, 65, 64, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 65, 1, 0, 0, 0, 67, 68, 1, 0, 0, 0, 68, 11, 1, 0, 0, 0, 69, 70, 5, 10, 0, 0, 70, 13, 1, 0, 0, 0, 71, 73, 3, 12, 6, 0, 72, 71, 1, 0, 0, 0, 72, 73, 1, 0, 0, 0, 73, 82, 1, 0, 0, 0, 74, 76, 3, 16, 8, 0, 75, 74, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 77, 1, 0, 0, 0, 77, 83, 3, 12, 6, 0, 78, 80, 3, 16, 8, 0, 79, 81, 3, 12, 6, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 83, 1, 0, 0, 0, 82, 75, 1, 0, 0, 0, 82, 78, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 87, 3, 22, 11, 0, 87, 15, 1, 0, 0, 0, 88, 89, 3, 18, 9, 0, 89, 17, 1, 0, 0, 0, 90, 92, 5, 11, 0, 0, 91, 93, 5, 7, 0, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 96, 3, 20, 10, 0, 95, 97, 5, 7, 0, 0, 96, 95, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 98, 1, 0, 0, 0, 98, 99, 5, 12, 0, 0, 99, 19, 1, 0, 0, 0, 100, 102, 5, 7, 0, 0, 101, 100, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 103, 1, 0, 0, 0, 103, 104, 3, 30, 15, 0, 104, 105, 3, 32, 16, 0, 105, 21, 1, 0, 0, 0, 106, 108, 5, 7, 0, 0, 107, 106, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 138, 1, 0, 0, 0, 109, 110, 5, 20, 0, 0, 110, 139, 3, 24, 12, 0, 111, 112, 5, 21, 0, 0, 112, 114, 3, 24, 12, 0, 113, 111, 1, 0, 0, 0, 114, 115, 1, 0, 0, 0, 115, 113, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 5, 22, 0, 0, 118, 119, 3, 24, 12, 0, 119, 139, 1, 0, 0, 0, 120, 121, 5, 21, 0, 0, 121, 123, 3, 24, 12, 0, 122, 120, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 122, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 127, 5, 22, 0, 0, 127, 139, 1, 0, 0, 0, 128, 129, 5, 21, 0, 0, 129, 131, 3, 24, 12, 0, 130, 128, 1, 0, 0, 0, 131, 132, 1, 0, 0, 0, 132, 130, 1, 0, 0, 0, 132, 133, 1, 0, 0, 0, 133, 134, 1, 0, 0, 0, 134, 135, 5, 21, 0, 0, 135, 139, 1, 0, 0, 0, 136, 139, 5, 22, 0, 0, 137, 139, 5, 21, 0, 0, 138, 109, 1, 0, 0, 0, 138, 113, 1, 0, 0, 0, 138, 122, 1, 0, 0, 0, 138, 130, 1, 0, 0, 0, 138, 136, 1, 0, 0, 0, 138, 137, 1, 0, 0, 0, 139, 23, 1, 0, 0, 0, 140, 142, 5, 7, 0, 0, 141, 140, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 143, 1, 0, 0, 0, 143, 145, 3, 26, 13, 0, 144, 146, 5, 7, 0, 0, 145, 144, 1, 0, 0, 0, 145, 146, 1, 0, 0, 0, 146, 157, 1, 0, 0, 0, 147, 149, 5, 1, 0, 0, 148, 150, 5, 7, 0, 0, 149, 148, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 153, 3, 26, 13, 0, 152, 154, 5, 7, 0, 0, 153, 152, 1, 0, 0, 0, 153, 154, 1, 0, 0, 0, 154, 156, 1, 0, 0, 0, 155, 147, 1, 0, 0, 0, 156, 159, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 161, 1, 0, 0, 0, 159, 157, 1, 0, 0, 0, 160, 162, 5, 7, 0, 0, 161, 160, 1, 0, 0, 0, 161, 162, 1, 0, 0, 0, 162, 174, 1, 0, 0, 0, 163, 164, 5, 2, 0, 0, 164, 169, 3, 28, 14, 0, 165, 166, 5, 3, 0, 0, 166, 168, 3, 28, 14, 0, 167, 165, 1, 0, 0, 0, 168, 171, 1, 0, 0, 0, 169, 167, 1, 0, 0, 0, 169, 170, 1, 0, 0, 0, 170, 172, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 172, 173, 5, 4, 0, 0, 173, 175, 1, 0, 0, 0, 174, 163, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 177, 1, 0, 0, 0, 176, 178, 5, 7, 0, 0, 177, 176, 1, 0, 0, 0, 177, 178, 1, 0, 0, 0, 178, 25, 1, 0, 0, 0, 179, 180, 5, 23, 0, 0, 180, 27, 1, 0, 0, 0, 181, 182, 5, 23, 0, 0, 182, 29, 1, 0, 0, 0, 183, 191, 5, 13, 0, 0, 184, 191, 5, 14, 0, 0, 185, 191, 5, 15, 0, 0, 186, 191, 5, 16, 0, 0, 187, 191, 5, 17, 0, 0, 188, 191, 5, 18, 0, 0, 189, 191, 5, 19, 0, 0, 190, 183, 1, 0, 0, 0, 190, 184, 1, 0, 0, 0, 190, 185, 1, 0, 0, 0, 190, 186, 1, 0, 0, 0, 190, 187, 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 189, 1, 0, 0, 0, 191, 31, 1, 0, 0, 0, 192, 193, 5, 8, 0, 0, 193, 196, 3, 34, 17, 0, 194, 196, 3, 38, 19, 0, 195, 192, 1, 0, 0, 0, 195, 194, 1, 0, 0, 0, 196, 33, 1, 0, 0, 0, 197, 199, 3, 36, 18, 0, 198, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 198, 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 35, 1, 0, 0, 0, 202, 204, 5, 7, 0, 0, 203, 202, 1, 0, 0, 0, 203, 204, 1, 0, 0, 0, 204, 205, 1, 0, 0, 0, 205, 207, 5, 5, 0, 0, 206, 208, 5, 7, 0, 0, 207, 206, 1, 0, 0, 0, 207, 208, 1, 0, 0, 0, 208, 211, 1, 0, 0, 0, 209, 212, 3, 10, 5, 0, 210, 212, 5, 9, 0, 0, 211, 209, 1, 0, 0, 0, 211, 210, 1, 0, 0, 0, 212, 37, 1, 0, 0, 0, 213, 220, 3, 14, 7, 0, 214, 216, 5, 6, 0, 0, 215, 217, 3, 14, 7, 0, 216, 215, 1, 0, 0, 0, 216, 217, 1, 0, 0, 0, 217, 219, 1, 0, 0, 0, 218, 214, 1, 0, 0, 0, 219, 222, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 232, 1, 0, 0, 0, 222, 220, 1, 0, 0, 0, 223, 225, 5, 6, 0, 0, 224, 226, 3, 14, 7, 0, 225, 224, 1, 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 228, 1, 0, 0, 0, 227, 223, 1, 0, 0, 0, 228, 229, 1, 0, 0, 0, 229, 227, 1, 0, 0, 0, 229, 230, 1, 0, 0, 0, 230, 232, 1, 0, 0, 0, 231, 213, 1, 0, 0, 0, 231, 227, 1, 0, 0, 0, 232, 39, 1, 0, 0, 0, 41, 45, 49, 53, 55, 59, 61, 65, 67, 72, 75, 80, 82, 84, 92, 96, 101, 107, 115, 124, 132, 138, 141, 145, 149, 153, 157, 161, 169, 174, 177, 190, 195, 200, 203, 207, 211, 216, 220, 225, 229, 231] \ No newline at end of file diff --git a/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs b/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs index 2644bba..bc8a7c6 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs @@ -60,6 +60,18 @@ public partial class InkBlotAntlrGrammarBaseListener : IInkBlotAntlrGrammarListe /// The parse tree. public virtual void ExitTopLevelStatements([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementsContext context) { } /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context) { } + /// /// Enter a parse tree produced by . /// The default implementation does nothing. /// diff --git a/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs b/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs index a3d009a..118a14b 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs @@ -55,6 +55,16 @@ public partial class InkBlotAntlrGrammarBaseVisitor : AbstractParseTreeV /// The visitor result. public virtual Result VisitTopLevelStatements([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementsContext context) { return VisitChildren(context); } /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context) { return VisitChildren(context); } + /// /// Visit a parse tree produced by . /// /// The default implementation returns the result of calling diff --git a/InkBlot/Generated/InkBlotAntlrGrammarListener.cs b/InkBlot/Generated/InkBlotAntlrGrammarListener.cs index 3b9e95a..d73bde4 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarListener.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarListener.cs @@ -51,6 +51,16 @@ public interface IInkBlotAntlrGrammarListener : IParseTreeListener { /// The parse tree. void ExitTopLevelStatements([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementsContext context); /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context); + /// /// Enter a parse tree produced by . /// /// The parse tree. diff --git a/InkBlot/Generated/InkBlotAntlrGrammarParser.cs b/InkBlot/Generated/InkBlotAntlrGrammarParser.cs index a49f6dd..d524565 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarParser.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarParser.cs @@ -42,19 +42,20 @@ public partial class InkBlotAntlrGrammarParser : Parser { SHUFFLE_ONCE=18, SHUFFLE_STOPPING=19, THREAD_ARROW=20, DIVERT_ARROW=21, TUNNEL_ARROW=22, IDENTIFIER=23; public const int - RULE_story = 0, RULE_topLevelStatements = 1, RULE_knotLevelStatements = 2, - RULE_stitchLevelStatements = 3, RULE_innerBlockLevelStatements = 4, RULE_contentText = 5, - RULE_mixedTextAndLogic = 6, RULE_inlineLogicOrGlueOrTagStart = 7, RULE_inlineLogic = 8, - RULE_innerLogic = 9, RULE_multiDivert = 10, RULE_divertIdentifierWithArguments = 11, - RULE_identifier = 12, RULE_expression = 13, RULE_sequenceTypeAnnotation = 14, - RULE_innerSequenceObjects = 15, RULE_innerMultilineSequenceObjects = 16, - RULE_singleMultilineSequenceElement = 17, RULE_innerInlineSequenceObjects = 18; + RULE_story = 0, RULE_topLevelStatements = 1, RULE_topLevelStatement = 2, + RULE_knotLevelStatements = 3, RULE_stitchLevelStatements = 4, RULE_innerBlockLevelStatements = 5, + RULE_contentText = 6, RULE_mixedTextAndLogic = 7, RULE_inlineLogicOrGlueOrTagStart = 8, + RULE_inlineLogic = 9, RULE_innerLogic = 10, RULE_multiDivert = 11, RULE_divertIdentifierWithArguments = 12, + RULE_identifier = 13, RULE_expression = 14, RULE_sequenceTypeAnnotation = 15, + RULE_innerSequenceObjects = 16, RULE_innerMultilineSequenceObjects = 17, + RULE_singleMultilineSequenceElement = 18, RULE_innerInlineSequenceObjects = 19; public static readonly string[] ruleNames = { - "story", "topLevelStatements", "knotLevelStatements", "stitchLevelStatements", - "innerBlockLevelStatements", "contentText", "mixedTextAndLogic", "inlineLogicOrGlueOrTagStart", - "inlineLogic", "innerLogic", "multiDivert", "divertIdentifierWithArguments", - "identifier", "expression", "sequenceTypeAnnotation", "innerSequenceObjects", - "innerMultilineSequenceObjects", "singleMultilineSequenceElement", "innerInlineSequenceObjects" + "story", "topLevelStatements", "topLevelStatement", "knotLevelStatements", + "stitchLevelStatements", "innerBlockLevelStatements", "contentText", "mixedTextAndLogic", + "inlineLogicOrGlueOrTagStart", "inlineLogic", "innerLogic", "multiDivert", + "divertIdentifierWithArguments", "identifier", "expression", "sequenceTypeAnnotation", + "innerSequenceObjects", "innerMultilineSequenceObjects", "singleMultilineSequenceElement", + "innerInlineSequenceObjects" }; private static readonly string[] _LiteralNames = { @@ -135,7 +136,7 @@ public partial class InkBlotAntlrGrammarParser : Parser { try { EnterOuterAlt(_localctx, 1); { - State = 38; + State = 40; topLevelStatements(); } } @@ -151,11 +152,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { } public partial class TopLevelStatementsContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext[] contentText() { - return GetRuleContexts(); + [System.Diagnostics.DebuggerNonUserCode] public TopLevelStatementContext[] topLevelStatement() { + return GetRuleContexts(); } - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { - return GetRuleContext(i); + [System.Diagnostics.DebuggerNonUserCode] public TopLevelStatementContext topLevelStatement(int i) { + return GetRuleContext(i); } public TopLevelStatementsContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) @@ -188,20 +189,90 @@ public partial class InkBlotAntlrGrammarParser : Parser { try { EnterOuterAlt(_localctx, 1); { - State = 41; + State = 43; ErrorHandler.Sync(this); _la = TokenStream.LA(1); do { { { - State = 40; - contentText(); + State = 42; + topLevelStatement(); } } - State = 43; + State = 45; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - } while ( _la==CONTENT_TEXT_NO_ESCAPE_SIMPLE ); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) ); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class TopLevelStatementContext : ParserRuleContext { + [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText() { + return GetRuleContext(0); + } + [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert() { + return GetRuleContext(0); + } + public TopLevelStatementContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_topLevelStatement; } } + [System.Diagnostics.DebuggerNonUserCode] + public override void EnterRule(IParseTreeListener listener) { + IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; + if (typedListener != null) typedListener.EnterTopLevelStatement(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override void ExitRule(IParseTreeListener listener) { + IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; + if (typedListener != null) typedListener.ExitTopLevelStatement(this); + } + [System.Diagnostics.DebuggerNonUserCode] + public override TResult Accept(IParseTreeVisitor visitor) { + IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; + if (typedVisitor != null) return typedVisitor.VisitTopLevelStatement(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public TopLevelStatementContext topLevelStatement() { + TopLevelStatementContext _localctx = new TopLevelStatementContext(Context, State); + EnterRule(_localctx, 4, RULE_topLevelStatement); + try { + State = 49; + ErrorHandler.Sync(this); + switch (TokenStream.LA(1)) { + case CONTENT_TEXT_NO_ESCAPE_SIMPLE: + EnterOuterAlt(_localctx, 1); + { + State = 47; + contentText(); + } + break; + case WS: + case THREAD_ARROW: + case DIVERT_ARROW: + case TUNNEL_ARROW: + EnterOuterAlt(_localctx, 2); + { + State = 48; + multiDivert(); + } + break; + default: + throw new NoViableAltException(this); } } catch (RecognitionException re) { @@ -222,6 +293,12 @@ public partial class InkBlotAntlrGrammarParser : Parser { [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { return GetRuleContext(i); } + [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext[] multiDivert() { + return GetRuleContexts(); + } + [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert(int i) { + return GetRuleContext(i); + } public KnotLevelStatementsContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { @@ -248,25 +325,42 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public KnotLevelStatementsContext knotLevelStatements() { KnotLevelStatementsContext _localctx = new KnotLevelStatementsContext(Context, State); - EnterRule(_localctx, 4, RULE_knotLevelStatements); + EnterRule(_localctx, 6, RULE_knotLevelStatements); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 46; + State = 53; ErrorHandler.Sync(this); _la = TokenStream.LA(1); do { { - { - State = 45; - contentText(); + State = 53; + ErrorHandler.Sync(this); + switch (TokenStream.LA(1)) { + case CONTENT_TEXT_NO_ESCAPE_SIMPLE: + { + State = 51; + contentText(); + } + break; + case WS: + case THREAD_ARROW: + case DIVERT_ARROW: + case TUNNEL_ARROW: + { + State = 52; + multiDivert(); + } + break; + default: + throw new NoViableAltException(this); } } - State = 48; + State = 55; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - } while ( _la==CONTENT_TEXT_NO_ESCAPE_SIMPLE ); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) ); } } catch (RecognitionException re) { @@ -287,6 +381,12 @@ public partial class InkBlotAntlrGrammarParser : Parser { [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { return GetRuleContext(i); } + [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext[] multiDivert() { + return GetRuleContexts(); + } + [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert(int i) { + return GetRuleContext(i); + } public StitchLevelStatementsContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { @@ -313,25 +413,42 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public StitchLevelStatementsContext stitchLevelStatements() { StitchLevelStatementsContext _localctx = new StitchLevelStatementsContext(Context, State); - EnterRule(_localctx, 6, RULE_stitchLevelStatements); + EnterRule(_localctx, 8, RULE_stitchLevelStatements); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 51; + State = 59; ErrorHandler.Sync(this); _la = TokenStream.LA(1); do { { - { - State = 50; - contentText(); + State = 59; + ErrorHandler.Sync(this); + switch (TokenStream.LA(1)) { + case CONTENT_TEXT_NO_ESCAPE_SIMPLE: + { + State = 57; + contentText(); + } + break; + case WS: + case THREAD_ARROW: + case DIVERT_ARROW: + case TUNNEL_ARROW: + { + State = 58; + multiDivert(); + } + break; + default: + throw new NoViableAltException(this); } } - State = 53; + State = 61; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - } while ( _la==CONTENT_TEXT_NO_ESCAPE_SIMPLE ); + } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) ); } } catch (RecognitionException re) { @@ -352,6 +469,12 @@ public partial class InkBlotAntlrGrammarParser : Parser { [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { return GetRuleContext(i); } + [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext[] multiDivert() { + return GetRuleContexts(); + } + [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert(int i) { + return GetRuleContext(i); + } public InnerBlockLevelStatementsContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { @@ -378,25 +501,48 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public InnerBlockLevelStatementsContext innerBlockLevelStatements() { InnerBlockLevelStatementsContext _localctx = new InnerBlockLevelStatementsContext(Context, State); - EnterRule(_localctx, 8, RULE_innerBlockLevelStatements); - int _la; + EnterRule(_localctx, 10, RULE_innerBlockLevelStatements); try { + int _alt; EnterOuterAlt(_localctx, 1); { - State = 56; + State = 65; ErrorHandler.Sync(this); - _la = TokenStream.LA(1); + _alt = 1; do { - { - { - State = 55; - contentText(); + switch (_alt) { + case 1: + { + State = 65; + ErrorHandler.Sync(this); + switch (TokenStream.LA(1)) { + case CONTENT_TEXT_NO_ESCAPE_SIMPLE: + { + State = 63; + contentText(); + } + break; + case WS: + case THREAD_ARROW: + case DIVERT_ARROW: + case TUNNEL_ARROW: + { + State = 64; + multiDivert(); + } + break; + default: + throw new NoViableAltException(this); + } + } + break; + default: + throw new NoViableAltException(this); } - } - State = 58; + State = 67; ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - } while ( _la==CONTENT_TEXT_NO_ESCAPE_SIMPLE ); + _alt = Interpreter.AdaptivePredict(TokenStream,7,Context); + } while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ); } } catch (RecognitionException re) { @@ -438,11 +584,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public ContentTextContext contentText() { ContentTextContext _localctx = new ContentTextContext(Context, State); - EnterRule(_localctx, 10, RULE_contentText); + EnterRule(_localctx, 12, RULE_contentText); try { EnterOuterAlt(_localctx, 1); { - State = 60; + State = 69; Match(CONTENT_TEXT_NO_ESCAPE_SIMPLE); } } @@ -499,55 +645,55 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public MixedTextAndLogicContext mixedTextAndLogic() { MixedTextAndLogicContext _localctx = new MixedTextAndLogicContext(Context, State); - EnterRule(_localctx, 12, RULE_mixedTextAndLogic); + EnterRule(_localctx, 14, RULE_mixedTextAndLogic); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 63; + State = 72; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,4,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,8,Context) ) { case 1: { - State = 62; + State = 71; contentText(); } break; } - State = 73; + State = 82; ErrorHandler.Sync(this); _la = TokenStream.LA(1); do { { - State = 73; + State = 82; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,7,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,11,Context) ) { case 1: { - State = 66; + State = 75; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==INLINE_LOGIC_START) { { - State = 65; + State = 74; inlineLogicOrGlueOrTagStart(); } } - State = 68; + State = 77; contentText(); } break; case 2: { - State = 69; + State = 78; inlineLogicOrGlueOrTagStart(); - State = 71; + State = 80; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,6,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,10,Context) ) { case 1: { - State = 70; + State = 79; contentText(); } break; @@ -556,11 +702,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { break; } } - State = 75; + State = 84; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } while ( _la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START ); - State = 77; + State = 86; multiDivert(); } } @@ -605,11 +751,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public InlineLogicOrGlueOrTagStartContext inlineLogicOrGlueOrTagStart() { InlineLogicOrGlueOrTagStartContext _localctx = new InlineLogicOrGlueOrTagStartContext(Context, State); - EnterRule(_localctx, 14, RULE_inlineLogicOrGlueOrTagStart); + EnterRule(_localctx, 16, RULE_inlineLogicOrGlueOrTagStart); try { EnterOuterAlt(_localctx, 1); { - State = 79; + State = 88; inlineLogic(); } } @@ -630,7 +776,10 @@ public partial class InkBlotAntlrGrammarParser : Parser { return GetRuleContext(0); } [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INLINE_LOGIC_END() { return GetToken(InkBlotAntlrGrammarParser.INLINE_LOGIC_END, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS() { return GetToken(InkBlotAntlrGrammarParser.WS, 0); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] WS() { return GetTokens(InkBlotAntlrGrammarParser.WS); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS(int i) { + return GetToken(InkBlotAntlrGrammarParser.WS, i); + } public InlineLogicContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { @@ -657,25 +806,36 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public InlineLogicContext inlineLogic() { InlineLogicContext _localctx = new InlineLogicContext(Context, State); - EnterRule(_localctx, 16, RULE_inlineLogic); + EnterRule(_localctx, 18, RULE_inlineLogic); + int _la; try { EnterOuterAlt(_localctx, 1); { - State = 81; + State = 90; Match(INLINE_LOGIC_START); - State = 83; + State = 92; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,9,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) { case 1: { - State = 82; + State = 91; Match(WS); } break; } - State = 85; + State = 94; innerLogic(); - State = 86; + State = 96; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (_la==WS) { + { + State = 95; + Match(WS); + } + } + + State = 98; Match(INLINE_LOGIC_END); } } @@ -724,24 +884,24 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public InnerLogicContext innerLogic() { InnerLogicContext _localctx = new InnerLogicContext(Context, State); - EnterRule(_localctx, 18, RULE_innerLogic); + EnterRule(_localctx, 20, RULE_innerLogic); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 89; + State = 101; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 88; + State = 100; Match(WS); } } - State = 91; + State = 103; sequenceTypeAnnotation(); - State = 92; + State = 104; innerSequenceObjects(); } } @@ -796,82 +956,82 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public MultiDivertContext multiDivert() { MultiDivertContext _localctx = new MultiDivertContext(Context, State); - EnterRule(_localctx, 20, RULE_multiDivert); + EnterRule(_localctx, 22, RULE_multiDivert); int _la; try { int _alt; EnterOuterAlt(_localctx, 1); { - State = 95; + State = 107; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 94; + State = 106; Match(WS); } } - State = 126; + State = 138; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,15,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,20,Context) ) { case 1: { - State = 97; + State = 109; Match(THREAD_ARROW); - State = 98; + State = 110; divertIdentifierWithArguments(); } break; case 2: { - State = 101; + State = 113; ErrorHandler.Sync(this); _la = TokenStream.LA(1); do { { { - State = 99; + State = 111; Match(DIVERT_ARROW); - State = 100; + State = 112; divertIdentifierWithArguments(); } } - State = 103; + State = 115; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } while ( _la==DIVERT_ARROW ); - State = 105; + State = 117; Match(TUNNEL_ARROW); - State = 106; + State = 118; divertIdentifierWithArguments(); } break; case 3: { - State = 110; + State = 122; ErrorHandler.Sync(this); _la = TokenStream.LA(1); do { { { - State = 108; + State = 120; Match(DIVERT_ARROW); - State = 109; + State = 121; divertIdentifierWithArguments(); } } - State = 112; + State = 124; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } while ( _la==DIVERT_ARROW ); - State = 114; + State = 126; Match(TUNNEL_ARROW); } break; case 4: { - State = 118; + State = 130; ErrorHandler.Sync(this); _alt = 1; do { @@ -879,9 +1039,9 @@ public partial class InkBlotAntlrGrammarParser : Parser { case 1: { { - State = 116; + State = 128; Match(DIVERT_ARROW); - State = 117; + State = 129; divertIdentifierWithArguments(); } } @@ -889,23 +1049,23 @@ public partial class InkBlotAntlrGrammarParser : Parser { default: throw new NoViableAltException(this); } - State = 120; + State = 132; ErrorHandler.Sync(this); - _alt = Interpreter.AdaptivePredict(TokenStream,14,Context); + _alt = Interpreter.AdaptivePredict(TokenStream,19,Context); } while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ); - State = 122; + State = 134; Match(DIVERT_ARROW); } break; case 5: { - State = 124; + State = 136; Match(TUNNEL_ARROW); } break; case 6: { - State = 125; + State = 137; Match(DIVERT_ARROW); } break; @@ -966,119 +1126,119 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments() { DivertIdentifierWithArgumentsContext _localctx = new DivertIdentifierWithArgumentsContext(Context, State); - EnterRule(_localctx, 22, RULE_divertIdentifierWithArguments); + EnterRule(_localctx, 24, RULE_divertIdentifierWithArguments); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 129; + State = 141; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 128; + State = 140; Match(WS); } } - State = 131; + State = 143; identifier(); - State = 133; + State = 145; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,17,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,22,Context) ) { case 1: { - State = 132; + State = 144; Match(WS); } break; } - State = 145; + State = 157; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__0) { { { - State = 135; + State = 147; Match(T__0); - State = 137; + State = 149; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 136; + State = 148; Match(WS); } } - State = 139; + State = 151; identifier(); - State = 141; + State = 153; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,19,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,24,Context) ) { case 1: { - State = 140; + State = 152; Match(WS); } break; } } } - State = 147; + State = 159; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } - State = 149; + State = 161; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,21,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,26,Context) ) { case 1: { - State = 148; + State = 160; Match(WS); } break; } - State = 162; + State = 174; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==T__1) { { - State = 151; + State = 163; Match(T__1); - State = 152; + State = 164; expression(); - State = 157; + State = 169; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__2) { { { - State = 153; + State = 165; Match(T__2); - State = 154; + State = 166; expression(); } } - State = 159; + State = 171; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } - State = 160; + State = 172; Match(T__3); } } - State = 165; + State = 177; ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==WS) { + switch ( Interpreter.AdaptivePredict(TokenStream,29,Context) ) { + case 1: { - State = 164; + State = 176; Match(WS); } + break; } - } } catch (RecognitionException re) { @@ -1120,11 +1280,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public IdentifierContext identifier() { IdentifierContext _localctx = new IdentifierContext(Context, State); - EnterRule(_localctx, 24, RULE_identifier); + EnterRule(_localctx, 26, RULE_identifier); try { EnterOuterAlt(_localctx, 1); { - State = 167; + State = 179; Match(IDENTIFIER); } } @@ -1167,11 +1327,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public ExpressionContext expression() { ExpressionContext _localctx = new ExpressionContext(Context, State); - EnterRule(_localctx, 26, RULE_expression); + EnterRule(_localctx, 28, RULE_expression); try { EnterOuterAlt(_localctx, 1); { - State = 169; + State = 181; Match(IDENTIFIER); } } @@ -1187,6 +1347,7 @@ public partial class InkBlotAntlrGrammarParser : Parser { } public partial class SequenceTypeAnnotationContext : ParserRuleContext { + public IToken op; [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SEQUENCE_TYPE_SYMBOL_ANNOTATION() { return GetToken(InkBlotAntlrGrammarParser.SEQUENCE_TYPE_SYMBOL_ANNOTATION, 0); } [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ONCE() { return GetToken(InkBlotAntlrGrammarParser.ONCE, 0); } [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CYCLE() { return GetToken(InkBlotAntlrGrammarParser.CYCLE, 0); } @@ -1220,20 +1381,62 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public SequenceTypeAnnotationContext sequenceTypeAnnotation() { SequenceTypeAnnotationContext _localctx = new SequenceTypeAnnotationContext(Context, State); - EnterRule(_localctx, 28, RULE_sequenceTypeAnnotation); - int _la; + EnterRule(_localctx, 30, RULE_sequenceTypeAnnotation); try { - EnterOuterAlt(_localctx, 1); - { - State = 171; - _la = TokenStream.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 1040384L) != 0)) ) { - ErrorHandler.RecoverInline(this); - } - else { - ErrorHandler.ReportMatch(this); - Consume(); - } + State = 190; + ErrorHandler.Sync(this); + switch (TokenStream.LA(1)) { + case SEQUENCE_TYPE_SYMBOL_ANNOTATION: + EnterOuterAlt(_localctx, 1); + { + State = 183; + _localctx.op = Match(SEQUENCE_TYPE_SYMBOL_ANNOTATION); + } + break; + case ONCE: + EnterOuterAlt(_localctx, 2); + { + State = 184; + Match(ONCE); + } + break; + case CYCLE: + EnterOuterAlt(_localctx, 3); + { + State = 185; + Match(CYCLE); + } + break; + case SHUFFLE: + EnterOuterAlt(_localctx, 4); + { + State = 186; + Match(SHUFFLE); + } + break; + case STOPPING: + EnterOuterAlt(_localctx, 5); + { + State = 187; + Match(STOPPING); + } + break; + case SHUFFLE_ONCE: + EnterOuterAlt(_localctx, 6); + { + State = 188; + Match(SHUFFLE_ONCE); + } + break; + case SHUFFLE_STOPPING: + EnterOuterAlt(_localctx, 7); + { + State = 189; + Match(SHUFFLE_STOPPING); + } + break; + default: + throw new NoViableAltException(this); } } catch (RecognitionException re) { @@ -1281,17 +1484,17 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public InnerSequenceObjectsContext innerSequenceObjects() { InnerSequenceObjectsContext _localctx = new InnerSequenceObjectsContext(Context, State); - EnterRule(_localctx, 30, RULE_innerSequenceObjects); + EnterRule(_localctx, 32, RULE_innerSequenceObjects); try { - State = 176; + State = 195; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case NL: EnterOuterAlt(_localctx, 1); { - State = 173; + State = 192; Match(NL); - State = 174; + State = 193; innerMultilineSequenceObjects(); } break; @@ -1300,7 +1503,7 @@ public partial class InkBlotAntlrGrammarParser : Parser { case INLINE_LOGIC_START: EnterOuterAlt(_localctx, 2); { - State = 175; + State = 194; innerInlineSequenceObjects(); } break; @@ -1352,25 +1555,31 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public InnerMultilineSequenceObjectsContext innerMultilineSequenceObjects() { InnerMultilineSequenceObjectsContext _localctx = new InnerMultilineSequenceObjectsContext(Context, State); - EnterRule(_localctx, 32, RULE_innerMultilineSequenceObjects); - int _la; + EnterRule(_localctx, 34, RULE_innerMultilineSequenceObjects); try { + int _alt; EnterOuterAlt(_localctx, 1); { - State = 179; + State = 198; ErrorHandler.Sync(this); - _la = TokenStream.LA(1); + _alt = 1; do { - { - { - State = 178; - singleMultilineSequenceElement(); + switch (_alt) { + case 1: + { + { + State = 197; + singleMultilineSequenceElement(); + } + } + break; + default: + throw new NoViableAltException(this); } - } - State = 181; + State = 200; ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - } while ( _la==T__4 || _la==WS ); + _alt = Interpreter.AdaptivePredict(TokenStream,32,Context); + } while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ); } } catch (RecognitionException re) { @@ -1419,45 +1628,49 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public SingleMultilineSequenceElementContext singleMultilineSequenceElement() { SingleMultilineSequenceElementContext _localctx = new SingleMultilineSequenceElementContext(Context, State); - EnterRule(_localctx, 34, RULE_singleMultilineSequenceElement); + EnterRule(_localctx, 36, RULE_singleMultilineSequenceElement); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 184; + State = 203; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 183; + State = 202; Match(WS); } } - State = 186; + State = 205; Match(T__4); - State = 188; + State = 207; ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==WS) { + switch ( Interpreter.AdaptivePredict(TokenStream,34,Context) ) { + case 1: { - State = 187; + State = 206; Match(WS); } + break; } - - State = 192; + State = 211; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { + case WS: case CONTENT_TEXT_NO_ESCAPE_SIMPLE: + case THREAD_ARROW: + case DIVERT_ARROW: + case TUNNEL_ARROW: { - State = 190; + State = 209; innerBlockLevelStatements(); } break; case MULTILINE_WS: { - State = 191; + State = 210; Match(MULTILINE_WS); } break; @@ -1510,10 +1723,10 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public InnerInlineSequenceObjectsContext innerInlineSequenceObjects() { InnerInlineSequenceObjectsContext _localctx = new InnerInlineSequenceObjectsContext(Context, State); - EnterRule(_localctx, 36, RULE_innerInlineSequenceObjects); + EnterRule(_localctx, 38, RULE_innerInlineSequenceObjects); int _la; try { - State = 212; + State = 231; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case CONTENT_TEXT_NO_ESCAPE_SIMPLE: @@ -1521,29 +1734,29 @@ public partial class InkBlotAntlrGrammarParser : Parser { EnterOuterAlt(_localctx, 1); { { - State = 194; + State = 213; mixedTextAndLogic(); - State = 201; + State = 220; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__5) { { { - State = 195; + State = 214; Match(T__5); - State = 197; + State = 216; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START) { { - State = 196; + State = 215; mixedTextAndLogic(); } } } } - State = 203; + State = 222; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -1553,27 +1766,27 @@ public partial class InkBlotAntlrGrammarParser : Parser { case T__5: EnterOuterAlt(_localctx, 2); { - State = 208; + State = 227; ErrorHandler.Sync(this); _la = TokenStream.LA(1); do { { { - State = 204; + State = 223; Match(T__5); - State = 206; + State = 225; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START) { { - State = 205; + State = 224; mixedTextAndLogic(); } } } } - State = 210; + State = 229; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } while ( _la==T__5 ); @@ -1595,77 +1808,86 @@ public partial class InkBlotAntlrGrammarParser : Parser { } private static int[] _serializedATN = { - 4,1,23,215,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7, + 4,1,23,234,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7, 7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14, - 2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,1,0,1,0,1,1,4,1,42,8,1,11,1,12, - 1,43,1,2,4,2,47,8,2,11,2,12,2,48,1,3,4,3,52,8,3,11,3,12,3,53,1,4,4,4,57, - 8,4,11,4,12,4,58,1,5,1,5,1,6,3,6,64,8,6,1,6,3,6,67,8,6,1,6,1,6,1,6,3,6, - 72,8,6,4,6,74,8,6,11,6,12,6,75,1,6,1,6,1,7,1,7,1,8,1,8,3,8,84,8,8,1,8, - 1,8,1,8,1,9,3,9,90,8,9,1,9,1,9,1,9,1,10,3,10,96,8,10,1,10,1,10,1,10,1, - 10,4,10,102,8,10,11,10,12,10,103,1,10,1,10,1,10,1,10,1,10,4,10,111,8,10, - 11,10,12,10,112,1,10,1,10,1,10,1,10,4,10,119,8,10,11,10,12,10,120,1,10, - 1,10,1,10,1,10,3,10,127,8,10,1,11,3,11,130,8,11,1,11,1,11,3,11,134,8,11, - 1,11,1,11,3,11,138,8,11,1,11,1,11,3,11,142,8,11,5,11,144,8,11,10,11,12, - 11,147,9,11,1,11,3,11,150,8,11,1,11,1,11,1,11,1,11,5,11,156,8,11,10,11, - 12,11,159,9,11,1,11,1,11,3,11,163,8,11,1,11,3,11,166,8,11,1,12,1,12,1, - 13,1,13,1,14,1,14,1,15,1,15,1,15,3,15,177,8,15,1,16,4,16,180,8,16,11,16, - 12,16,181,1,17,3,17,185,8,17,1,17,1,17,3,17,189,8,17,1,17,1,17,3,17,193, - 8,17,1,18,1,18,1,18,3,18,198,8,18,5,18,200,8,18,10,18,12,18,203,9,18,1, - 18,1,18,3,18,207,8,18,4,18,209,8,18,11,18,12,18,210,3,18,213,8,18,1,18, - 0,0,19,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,0,1,1,0,13, - 19,234,0,38,1,0,0,0,2,41,1,0,0,0,4,46,1,0,0,0,6,51,1,0,0,0,8,56,1,0,0, - 0,10,60,1,0,0,0,12,63,1,0,0,0,14,79,1,0,0,0,16,81,1,0,0,0,18,89,1,0,0, - 0,20,95,1,0,0,0,22,129,1,0,0,0,24,167,1,0,0,0,26,169,1,0,0,0,28,171,1, - 0,0,0,30,176,1,0,0,0,32,179,1,0,0,0,34,184,1,0,0,0,36,212,1,0,0,0,38,39, - 3,2,1,0,39,1,1,0,0,0,40,42,3,10,5,0,41,40,1,0,0,0,42,43,1,0,0,0,43,41, - 1,0,0,0,43,44,1,0,0,0,44,3,1,0,0,0,45,47,3,10,5,0,46,45,1,0,0,0,47,48, - 1,0,0,0,48,46,1,0,0,0,48,49,1,0,0,0,49,5,1,0,0,0,50,52,3,10,5,0,51,50, - 1,0,0,0,52,53,1,0,0,0,53,51,1,0,0,0,53,54,1,0,0,0,54,7,1,0,0,0,55,57,3, - 10,5,0,56,55,1,0,0,0,57,58,1,0,0,0,58,56,1,0,0,0,58,59,1,0,0,0,59,9,1, - 0,0,0,60,61,5,10,0,0,61,11,1,0,0,0,62,64,3,10,5,0,63,62,1,0,0,0,63,64, - 1,0,0,0,64,73,1,0,0,0,65,67,3,14,7,0,66,65,1,0,0,0,66,67,1,0,0,0,67,68, - 1,0,0,0,68,74,3,10,5,0,69,71,3,14,7,0,70,72,3,10,5,0,71,70,1,0,0,0,71, - 72,1,0,0,0,72,74,1,0,0,0,73,66,1,0,0,0,73,69,1,0,0,0,74,75,1,0,0,0,75, - 73,1,0,0,0,75,76,1,0,0,0,76,77,1,0,0,0,77,78,3,20,10,0,78,13,1,0,0,0,79, - 80,3,16,8,0,80,15,1,0,0,0,81,83,5,11,0,0,82,84,5,7,0,0,83,82,1,0,0,0,83, - 84,1,0,0,0,84,85,1,0,0,0,85,86,3,18,9,0,86,87,5,12,0,0,87,17,1,0,0,0,88, - 90,5,7,0,0,89,88,1,0,0,0,89,90,1,0,0,0,90,91,1,0,0,0,91,92,3,28,14,0,92, - 93,3,30,15,0,93,19,1,0,0,0,94,96,5,7,0,0,95,94,1,0,0,0,95,96,1,0,0,0,96, - 126,1,0,0,0,97,98,5,20,0,0,98,127,3,22,11,0,99,100,5,21,0,0,100,102,3, - 22,11,0,101,99,1,0,0,0,102,103,1,0,0,0,103,101,1,0,0,0,103,104,1,0,0,0, - 104,105,1,0,0,0,105,106,5,22,0,0,106,107,3,22,11,0,107,127,1,0,0,0,108, - 109,5,21,0,0,109,111,3,22,11,0,110,108,1,0,0,0,111,112,1,0,0,0,112,110, - 1,0,0,0,112,113,1,0,0,0,113,114,1,0,0,0,114,115,5,22,0,0,115,127,1,0,0, - 0,116,117,5,21,0,0,117,119,3,22,11,0,118,116,1,0,0,0,119,120,1,0,0,0,120, - 118,1,0,0,0,120,121,1,0,0,0,121,122,1,0,0,0,122,123,5,21,0,0,123,127,1, - 0,0,0,124,127,5,22,0,0,125,127,5,21,0,0,126,97,1,0,0,0,126,101,1,0,0,0, - 126,110,1,0,0,0,126,118,1,0,0,0,126,124,1,0,0,0,126,125,1,0,0,0,127,21, - 1,0,0,0,128,130,5,7,0,0,129,128,1,0,0,0,129,130,1,0,0,0,130,131,1,0,0, - 0,131,133,3,24,12,0,132,134,5,7,0,0,133,132,1,0,0,0,133,134,1,0,0,0,134, - 145,1,0,0,0,135,137,5,1,0,0,136,138,5,7,0,0,137,136,1,0,0,0,137,138,1, - 0,0,0,138,139,1,0,0,0,139,141,3,24,12,0,140,142,5,7,0,0,141,140,1,0,0, - 0,141,142,1,0,0,0,142,144,1,0,0,0,143,135,1,0,0,0,144,147,1,0,0,0,145, - 143,1,0,0,0,145,146,1,0,0,0,146,149,1,0,0,0,147,145,1,0,0,0,148,150,5, - 7,0,0,149,148,1,0,0,0,149,150,1,0,0,0,150,162,1,0,0,0,151,152,5,2,0,0, - 152,157,3,26,13,0,153,154,5,3,0,0,154,156,3,26,13,0,155,153,1,0,0,0,156, - 159,1,0,0,0,157,155,1,0,0,0,157,158,1,0,0,0,158,160,1,0,0,0,159,157,1, - 0,0,0,160,161,5,4,0,0,161,163,1,0,0,0,162,151,1,0,0,0,162,163,1,0,0,0, - 163,165,1,0,0,0,164,166,5,7,0,0,165,164,1,0,0,0,165,166,1,0,0,0,166,23, - 1,0,0,0,167,168,5,23,0,0,168,25,1,0,0,0,169,170,5,23,0,0,170,27,1,0,0, - 0,171,172,7,0,0,0,172,29,1,0,0,0,173,174,5,8,0,0,174,177,3,32,16,0,175, - 177,3,36,18,0,176,173,1,0,0,0,176,175,1,0,0,0,177,31,1,0,0,0,178,180,3, - 34,17,0,179,178,1,0,0,0,180,181,1,0,0,0,181,179,1,0,0,0,181,182,1,0,0, - 0,182,33,1,0,0,0,183,185,5,7,0,0,184,183,1,0,0,0,184,185,1,0,0,0,185,186, - 1,0,0,0,186,188,5,5,0,0,187,189,5,7,0,0,188,187,1,0,0,0,188,189,1,0,0, - 0,189,192,1,0,0,0,190,193,3,8,4,0,191,193,5,9,0,0,192,190,1,0,0,0,192, - 191,1,0,0,0,193,35,1,0,0,0,194,201,3,12,6,0,195,197,5,6,0,0,196,198,3, - 12,6,0,197,196,1,0,0,0,197,198,1,0,0,0,198,200,1,0,0,0,199,195,1,0,0,0, - 200,203,1,0,0,0,201,199,1,0,0,0,201,202,1,0,0,0,202,213,1,0,0,0,203,201, - 1,0,0,0,204,206,5,6,0,0,205,207,3,12,6,0,206,205,1,0,0,0,206,207,1,0,0, - 0,207,209,1,0,0,0,208,204,1,0,0,0,209,210,1,0,0,0,210,208,1,0,0,0,210, - 211,1,0,0,0,211,213,1,0,0,0,212,194,1,0,0,0,212,208,1,0,0,0,213,37,1,0, - 0,0,35,43,48,53,58,63,66,71,73,75,83,89,95,103,112,120,126,129,133,137, - 141,145,149,157,162,165,176,181,184,188,192,197,201,206,210,212 + 2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,1,0,1,0,1,1,4,1,44,8, + 1,11,1,12,1,45,1,2,1,2,3,2,50,8,2,1,3,1,3,4,3,54,8,3,11,3,12,3,55,1,4, + 1,4,4,4,60,8,4,11,4,12,4,61,1,5,1,5,4,5,66,8,5,11,5,12,5,67,1,6,1,6,1, + 7,3,7,73,8,7,1,7,3,7,76,8,7,1,7,1,7,1,7,3,7,81,8,7,4,7,83,8,7,11,7,12, + 7,84,1,7,1,7,1,8,1,8,1,9,1,9,3,9,93,8,9,1,9,1,9,3,9,97,8,9,1,9,1,9,1,10, + 3,10,102,8,10,1,10,1,10,1,10,1,11,3,11,108,8,11,1,11,1,11,1,11,1,11,4, + 11,114,8,11,11,11,12,11,115,1,11,1,11,1,11,1,11,1,11,4,11,123,8,11,11, + 11,12,11,124,1,11,1,11,1,11,1,11,4,11,131,8,11,11,11,12,11,132,1,11,1, + 11,1,11,1,11,3,11,139,8,11,1,12,3,12,142,8,12,1,12,1,12,3,12,146,8,12, + 1,12,1,12,3,12,150,8,12,1,12,1,12,3,12,154,8,12,5,12,156,8,12,10,12,12, + 12,159,9,12,1,12,3,12,162,8,12,1,12,1,12,1,12,1,12,5,12,168,8,12,10,12, + 12,12,171,9,12,1,12,1,12,3,12,175,8,12,1,12,3,12,178,8,12,1,13,1,13,1, + 14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,15,3,15,191,8,15,1,16,1,16,1,16, + 3,16,196,8,16,1,17,4,17,199,8,17,11,17,12,17,200,1,18,3,18,204,8,18,1, + 18,1,18,3,18,208,8,18,1,18,1,18,3,18,212,8,18,1,19,1,19,1,19,3,19,217, + 8,19,5,19,219,8,19,10,19,12,19,222,9,19,1,19,1,19,3,19,226,8,19,4,19,228, + 8,19,11,19,12,19,229,3,19,232,8,19,1,19,0,0,20,0,2,4,6,8,10,12,14,16,18, + 20,22,24,26,28,30,32,34,36,38,0,0,263,0,40,1,0,0,0,2,43,1,0,0,0,4,49,1, + 0,0,0,6,53,1,0,0,0,8,59,1,0,0,0,10,65,1,0,0,0,12,69,1,0,0,0,14,72,1,0, + 0,0,16,88,1,0,0,0,18,90,1,0,0,0,20,101,1,0,0,0,22,107,1,0,0,0,24,141,1, + 0,0,0,26,179,1,0,0,0,28,181,1,0,0,0,30,190,1,0,0,0,32,195,1,0,0,0,34,198, + 1,0,0,0,36,203,1,0,0,0,38,231,1,0,0,0,40,41,3,2,1,0,41,1,1,0,0,0,42,44, + 3,4,2,0,43,42,1,0,0,0,44,45,1,0,0,0,45,43,1,0,0,0,45,46,1,0,0,0,46,3,1, + 0,0,0,47,50,3,12,6,0,48,50,3,22,11,0,49,47,1,0,0,0,49,48,1,0,0,0,50,5, + 1,0,0,0,51,54,3,12,6,0,52,54,3,22,11,0,53,51,1,0,0,0,53,52,1,0,0,0,54, + 55,1,0,0,0,55,53,1,0,0,0,55,56,1,0,0,0,56,7,1,0,0,0,57,60,3,12,6,0,58, + 60,3,22,11,0,59,57,1,0,0,0,59,58,1,0,0,0,60,61,1,0,0,0,61,59,1,0,0,0,61, + 62,1,0,0,0,62,9,1,0,0,0,63,66,3,12,6,0,64,66,3,22,11,0,65,63,1,0,0,0,65, + 64,1,0,0,0,66,67,1,0,0,0,67,65,1,0,0,0,67,68,1,0,0,0,68,11,1,0,0,0,69, + 70,5,10,0,0,70,13,1,0,0,0,71,73,3,12,6,0,72,71,1,0,0,0,72,73,1,0,0,0,73, + 82,1,0,0,0,74,76,3,16,8,0,75,74,1,0,0,0,75,76,1,0,0,0,76,77,1,0,0,0,77, + 83,3,12,6,0,78,80,3,16,8,0,79,81,3,12,6,0,80,79,1,0,0,0,80,81,1,0,0,0, + 81,83,1,0,0,0,82,75,1,0,0,0,82,78,1,0,0,0,83,84,1,0,0,0,84,82,1,0,0,0, + 84,85,1,0,0,0,85,86,1,0,0,0,86,87,3,22,11,0,87,15,1,0,0,0,88,89,3,18,9, + 0,89,17,1,0,0,0,90,92,5,11,0,0,91,93,5,7,0,0,92,91,1,0,0,0,92,93,1,0,0, + 0,93,94,1,0,0,0,94,96,3,20,10,0,95,97,5,7,0,0,96,95,1,0,0,0,96,97,1,0, + 0,0,97,98,1,0,0,0,98,99,5,12,0,0,99,19,1,0,0,0,100,102,5,7,0,0,101,100, + 1,0,0,0,101,102,1,0,0,0,102,103,1,0,0,0,103,104,3,30,15,0,104,105,3,32, + 16,0,105,21,1,0,0,0,106,108,5,7,0,0,107,106,1,0,0,0,107,108,1,0,0,0,108, + 138,1,0,0,0,109,110,5,20,0,0,110,139,3,24,12,0,111,112,5,21,0,0,112,114, + 3,24,12,0,113,111,1,0,0,0,114,115,1,0,0,0,115,113,1,0,0,0,115,116,1,0, + 0,0,116,117,1,0,0,0,117,118,5,22,0,0,118,119,3,24,12,0,119,139,1,0,0,0, + 120,121,5,21,0,0,121,123,3,24,12,0,122,120,1,0,0,0,123,124,1,0,0,0,124, + 122,1,0,0,0,124,125,1,0,0,0,125,126,1,0,0,0,126,127,5,22,0,0,127,139,1, + 0,0,0,128,129,5,21,0,0,129,131,3,24,12,0,130,128,1,0,0,0,131,132,1,0,0, + 0,132,130,1,0,0,0,132,133,1,0,0,0,133,134,1,0,0,0,134,135,5,21,0,0,135, + 139,1,0,0,0,136,139,5,22,0,0,137,139,5,21,0,0,138,109,1,0,0,0,138,113, + 1,0,0,0,138,122,1,0,0,0,138,130,1,0,0,0,138,136,1,0,0,0,138,137,1,0,0, + 0,139,23,1,0,0,0,140,142,5,7,0,0,141,140,1,0,0,0,141,142,1,0,0,0,142,143, + 1,0,0,0,143,145,3,26,13,0,144,146,5,7,0,0,145,144,1,0,0,0,145,146,1,0, + 0,0,146,157,1,0,0,0,147,149,5,1,0,0,148,150,5,7,0,0,149,148,1,0,0,0,149, + 150,1,0,0,0,150,151,1,0,0,0,151,153,3,26,13,0,152,154,5,7,0,0,153,152, + 1,0,0,0,153,154,1,0,0,0,154,156,1,0,0,0,155,147,1,0,0,0,156,159,1,0,0, + 0,157,155,1,0,0,0,157,158,1,0,0,0,158,161,1,0,0,0,159,157,1,0,0,0,160, + 162,5,7,0,0,161,160,1,0,0,0,161,162,1,0,0,0,162,174,1,0,0,0,163,164,5, + 2,0,0,164,169,3,28,14,0,165,166,5,3,0,0,166,168,3,28,14,0,167,165,1,0, + 0,0,168,171,1,0,0,0,169,167,1,0,0,0,169,170,1,0,0,0,170,172,1,0,0,0,171, + 169,1,0,0,0,172,173,5,4,0,0,173,175,1,0,0,0,174,163,1,0,0,0,174,175,1, + 0,0,0,175,177,1,0,0,0,176,178,5,7,0,0,177,176,1,0,0,0,177,178,1,0,0,0, + 178,25,1,0,0,0,179,180,5,23,0,0,180,27,1,0,0,0,181,182,5,23,0,0,182,29, + 1,0,0,0,183,191,5,13,0,0,184,191,5,14,0,0,185,191,5,15,0,0,186,191,5,16, + 0,0,187,191,5,17,0,0,188,191,5,18,0,0,189,191,5,19,0,0,190,183,1,0,0,0, + 190,184,1,0,0,0,190,185,1,0,0,0,190,186,1,0,0,0,190,187,1,0,0,0,190,188, + 1,0,0,0,190,189,1,0,0,0,191,31,1,0,0,0,192,193,5,8,0,0,193,196,3,34,17, + 0,194,196,3,38,19,0,195,192,1,0,0,0,195,194,1,0,0,0,196,33,1,0,0,0,197, + 199,3,36,18,0,198,197,1,0,0,0,199,200,1,0,0,0,200,198,1,0,0,0,200,201, + 1,0,0,0,201,35,1,0,0,0,202,204,5,7,0,0,203,202,1,0,0,0,203,204,1,0,0,0, + 204,205,1,0,0,0,205,207,5,5,0,0,206,208,5,7,0,0,207,206,1,0,0,0,207,208, + 1,0,0,0,208,211,1,0,0,0,209,212,3,10,5,0,210,212,5,9,0,0,211,209,1,0,0, + 0,211,210,1,0,0,0,212,37,1,0,0,0,213,220,3,14,7,0,214,216,5,6,0,0,215, + 217,3,14,7,0,216,215,1,0,0,0,216,217,1,0,0,0,217,219,1,0,0,0,218,214,1, + 0,0,0,219,222,1,0,0,0,220,218,1,0,0,0,220,221,1,0,0,0,221,232,1,0,0,0, + 222,220,1,0,0,0,223,225,5,6,0,0,224,226,3,14,7,0,225,224,1,0,0,0,225,226, + 1,0,0,0,226,228,1,0,0,0,227,223,1,0,0,0,228,229,1,0,0,0,229,227,1,0,0, + 0,229,230,1,0,0,0,230,232,1,0,0,0,231,213,1,0,0,0,231,227,1,0,0,0,232, + 39,1,0,0,0,41,45,49,53,55,59,61,65,67,72,75,80,82,84,92,96,101,107,115, + 124,132,138,141,145,149,153,157,161,169,174,177,190,195,200,203,207,211, + 216,220,225,229,231 }; public static readonly ATN _ATN = diff --git a/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs b/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs index 6876b78..7e4b7be 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs @@ -44,6 +44,12 @@ public interface IInkBlotAntlrGrammarVisitor : IParseTreeVisitor /// The visitor result. Result VisitTopLevelStatements([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementsContext context); /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context); + /// /// Visit a parse tree produced by . /// /// The parse tree. diff --git a/InkBlot/InkBlotAntlrGrammar.g4 b/InkBlot/InkBlotAntlrGrammar.g4 index a8a8eec..66d0871 100644 --- a/InkBlot/InkBlotAntlrGrammar.g4 +++ b/InkBlot/InkBlotAntlrGrammar.g4 @@ -13,19 +13,30 @@ story: topLevelStatements ; */ topLevelStatements: - contentText+ + topLevelStatement+ + ; + +topLevelStatement: + contentText + | multiDivert ; knotLevelStatements: - contentText+ + (contentText + | multiDivert + )+ ; stitchLevelStatements: - contentText+ + (contentText + | multiDivert + )+ ; innerBlockLevelStatements: - contentText+ + (contentText + | multiDivert + )+ ; /* @@ -52,7 +63,10 @@ inlineLogic: INLINE_LOGIC_START WS? innerLogic + // TODO: += and -= are disabled here (don't know why) + WS? INLINE_LOGIC_END + // TODO: tags ftw ; innerLogic: @@ -97,7 +111,7 @@ expression: // all possible symbols or word(s) for sequencing sequenceTypeAnnotation: - SEQUENCE_TYPE_SYMBOL_ANNOTATION + op=SEQUENCE_TYPE_SYMBOL_ANNOTATION | ONCE | CYCLE | SHUFFLE diff --git a/InkBlot/ParseHierarchy/MultiDivert.cs b/InkBlot/ParseHierarchy/MultiDivert.cs new file mode 100644 index 0000000..0711c25 --- /dev/null +++ b/InkBlot/ParseHierarchy/MultiDivert.cs @@ -0,0 +1,3 @@ +namespace InkBlot.ParseHierarchy; + +public record MultiDivert : StoryNode; \ No newline at end of file diff --git a/InkBlot/Visitor/ListenerContentText.cs b/InkBlot/Visitor/ListenerContentText.cs index 1382b59..89fa0f1 100644 --- a/InkBlot/Visitor/ListenerContentText.cs +++ b/InkBlot/Visitor/ListenerContentText.cs @@ -1,18 +1,19 @@ using System.Text.RegularExpressions; using Antlr4.Runtime.Tree; +using InkBlot.ParseHierarchy; namespace InkBlot.Visitor; public partial class Listener { - private readonly ParseTreeProperty _contentTextValue = new(); + private readonly ParseTreeProperty _contentTextValue = new(); private readonly Regex _escapeRegex = MyRegex(); [GeneratedRegex(@"\\(.)")] private static partial Regex MyRegex(); - private string GetContentText(InkBlotAntlrGrammarParser.ContentTextContext context) + private Content GetContentText(InkBlotAntlrGrammarParser.ContentTextContext context) { return _contentTextValue.Get(context); } @@ -29,6 +30,6 @@ public partial class Listener var content = _escapeRegex.Replace(contentWithEscapes, match => match.Groups[1].Value); // save the result - _contentTextValue.Put(context, content); + _contentTextValue.Put(context, new Content(content)); } } \ No newline at end of file diff --git a/InkBlot/Visitor/ListenerMultiDivert.cs b/InkBlot/Visitor/ListenerMultiDivert.cs new file mode 100644 index 0000000..6f6b1e2 --- /dev/null +++ b/InkBlot/Visitor/ListenerMultiDivert.cs @@ -0,0 +1,19 @@ +using Antlr4.Runtime.Tree; +using InkBlot.ParseHierarchy; + +namespace InkBlot.Visitor; + +public partial class Listener +{ + private readonly ParseTreeProperty _multiDivertValues = new(); + + private MultiDivert GetMultiDivert(InkBlotAntlrGrammarParser.MultiDivertContext context) + { + return _multiDivertValues.Get(context); + } + + public override void ExitMultiDivert(InkBlotAntlrGrammarParser.MultiDivertContext context) + { + _multiDivertValues.Put(context, new MultiDivert()); + } +} \ No newline at end of file diff --git a/InkBlot/Visitor/ListenerStory.cs b/InkBlot/Visitor/ListenerStory.cs index e2f97f5..80feda6 100644 --- a/InkBlot/Visitor/ListenerStory.cs +++ b/InkBlot/Visitor/ListenerStory.cs @@ -12,8 +12,16 @@ public partial class Listener { var storyNodes = context .topLevelStatements() - .contentText() - .Select(child => new Content(GetContentText(child))); + .topLevelStatement() + .Select(topLevelStatement => + topLevelStatement.children.Single() switch + { + InkBlotAntlrGrammarParser.ContentTextContext contentTextContext => + (StoryNode)GetContentText(contentTextContext), + InkBlotAntlrGrammarParser.MultiDivertContext multiDivertContext => + GetMultiDivert(multiDivertContext), + _ => throw new InvalidOperationException() + }); _story = new Story(storyNodes); } } \ No newline at end of file