diff --git a/InkBlot.Tests/ContentTextTest.cs b/InkBlot.Tests/ContentTextTest.cs
index 1e804bc..14aee36 100644
--- a/InkBlot.Tests/ContentTextTest.cs
+++ b/InkBlot.Tests/ContentTextTest.cs
@@ -17,11 +17,12 @@ public class ContentTextTest
public void TestBaseContentSuccess(string inkInput, string result, int numErrors)
{
// parse the story
- var fileReader = new PreMadeFileReader([
+ var fileReader = new InMemoryFileReader([
("main.ink", inkInput)
]);
var parser = new InkBlotParser();
- var (story, diagnostics) = parser.Parse(fileReader, "main.ink");
+ using var loggerFactory = Helpers.GetLoggerFactory();
+ var (story, diagnostics) = InkBlotParser.Parse(fileReader, loggerFactory, "main.ink");
// check the diagnostic counts match
diagnostics.Count().ShouldBe(numErrors);
diff --git a/InkBlot.Tests/Helpers.cs b/InkBlot.Tests/Helpers.cs
index b9cbdab..10e237f 100644
--- a/InkBlot.Tests/Helpers.cs
+++ b/InkBlot.Tests/Helpers.cs
@@ -1,4 +1,5 @@
using System.Text;
+using Microsoft.Extensions.Logging;
namespace InkBlot.Tests;
@@ -6,10 +7,19 @@ namespace InkBlot.Tests;
/// A file reader where the contents are directly provided as strings.
///
/// A map between file names and their contents.
-internal class PreMadeFileReader((string, string)[] filesToContents) : IFileReader
+internal class InMemoryFileReader((string, string)[] filesToContents) : IFileReader
{
public Stream GetContents(string filename)
{
return new MemoryStream(Encoding.UTF8.GetBytes(filesToContents.First(e => e.Item1 == filename).Item2));
}
+}
+
+internal static class Helpers
+{
+ public static ILoggerFactory GetLoggerFactory()
+ {
+ var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
+ return loggerFactory;
+ }
}
\ No newline at end of file
diff --git a/InkBlot.Tests/InkBlot.Tests.csproj b/InkBlot.Tests/InkBlot.Tests.csproj
index 62f9816..80a949e 100644
--- a/InkBlot.Tests/InkBlot.Tests.csproj
+++ b/InkBlot.Tests/InkBlot.Tests.csproj
@@ -9,6 +9,7 @@
+
diff --git a/InkBlot.Tests/LexerTest.cs b/InkBlot.Tests/LexerTest.cs
new file mode 100644
index 0000000..dd86065
--- /dev/null
+++ b/InkBlot.Tests/LexerTest.cs
@@ -0,0 +1,34 @@
+using Antlr4.Runtime;
+using Shouldly;
+
+namespace InkBlot.Tests;
+
+public class LexerTest
+{
+ [Fact]
+ public void TestDivertForLexer()
+ {
+ var divertTokens = GetTokens("<- threadName");
+ divertTokens.ShouldSatisfyAllConditions(
+ () => divertTokens[0].Text.ShouldBe("<-"),
+ () => divertTokens[0].Type.ShouldBe(InkBlotAntlrGrammarLexer.THREAD_ARROW),
+ () => divertTokens[1].Text.ShouldBe(" "),
+ () => divertTokens[1].Type.ShouldBe(InkBlotAntlrGrammarLexer.WS),
+ () => divertTokens[2].Text.ShouldBe("threadName"),
+ () => divertTokens[2].Type.ShouldBe(InkBlotAntlrGrammarLexer.IDENTIFIER),
+ () => divertTokens[3].Text.ShouldBe(""),
+ () => divertTokens[3].Type.ShouldBe(InkBlotAntlrGrammarLexer.Eof)
+ );
+ }
+
+ private IList GetTokens(string text)
+ {
+ var fileReader = new InMemoryFileReader([
+ ("main.ink", text)
+ ]);
+ var tokensStream = InkBlotParser.GetTokenStream(fileReader, "main.ink");
+ tokensStream.Fill();
+ var tokens = tokensStream.GetTokens();
+ return tokens;
+ }
+}
\ No newline at end of file
diff --git a/InkBlot.Tests/MultiDivertTest.cs b/InkBlot.Tests/MultiDivertTest.cs
new file mode 100644
index 0000000..8501349
--- /dev/null
+++ b/InkBlot.Tests/MultiDivertTest.cs
@@ -0,0 +1,24 @@
+using InkBlot.ParseHierarchy;
+using Shouldly;
+
+namespace InkBlot.Tests;
+
+public class MultiDivertTest
+{
+ [Fact]
+ public void TestThreadDivert()
+ {
+ var fileReader = new InMemoryFileReader([
+ ("main.ink", "<- threadName")
+ ]);
+ var tokensStream = InkBlotParser.GetTokenStream(fileReader, "main.ink");
+ tokensStream.Fill();
+ var tokens = tokensStream.GetTokens();
+ using var loggerFactory = Helpers.GetLoggerFactory();
+ var (story, diagnostics) = InkBlotParser.Parse(fileReader, loggerFactory, "main.ink");
+
+ diagnostics.ShouldBe([]);
+ var storyNodes = story.StoryNodes.ToArray();
+ storyNodes.ShouldBe([new MultiDivert(new ThreadDivert(new Identifier(["threadName"])))]);
+ }
+}
\ No newline at end of file
diff --git a/InkBlot/Generated/InkBlotAntlrGrammar.interp b/InkBlot/Generated/InkBlotAntlrGrammar.interp
index 6bbd98c..2f3ffa4 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammar.interp
+++ b/InkBlot/Generated/InkBlotAntlrGrammar.interp
@@ -1,9 +1,9 @@
token literal names:
null
-'.'
'('
','
')'
+'.'
'-'
'|'
null
@@ -63,7 +63,11 @@ inlineLogicOrGlueOrTagStart
inlineLogic
innerLogic
multiDivert
+multiDivert_withoutWS
+multiDivertArrows_tail
divertIdentifierWithArguments
+divertIdentifierWithArguments_name
+divertIdentifierWithArguments_arguments
identifier
expression
sequenceTypeAnnotation
@@ -74,4 +78,4 @@ innerInlineSequenceObjects
atn:
-[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
+[4, 1, 23, 254, 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, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 1, 0, 1, 0, 1, 1, 4, 1, 52, 8, 1, 11, 1, 12, 1, 53, 1, 2, 1, 2, 3, 2, 58, 8, 2, 1, 3, 1, 3, 4, 3, 62, 8, 3, 11, 3, 12, 3, 63, 1, 4, 1, 4, 4, 4, 68, 8, 4, 11, 4, 12, 4, 69, 1, 5, 1, 5, 4, 5, 74, 8, 5, 11, 5, 12, 5, 75, 1, 6, 1, 6, 1, 7, 3, 7, 81, 8, 7, 1, 7, 3, 7, 84, 8, 7, 1, 7, 1, 7, 1, 7, 3, 7, 89, 8, 7, 4, 7, 91, 8, 7, 11, 7, 12, 7, 92, 1, 7, 1, 7, 1, 8, 1, 8, 1, 9, 1, 9, 3, 9, 101, 8, 9, 1, 9, 1, 9, 3, 9, 105, 8, 9, 1, 9, 1, 9, 1, 10, 3, 10, 110, 8, 10, 1, 10, 1, 10, 1, 10, 1, 11, 3, 11, 116, 8, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 5, 12, 124, 8, 12, 10, 12, 12, 12, 127, 9, 12, 1, 12, 3, 12, 130, 8, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 138, 8, 13, 1, 14, 3, 14, 141, 8, 14, 1, 14, 1, 14, 3, 14, 145, 8, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 151, 8, 14, 1, 14, 5, 14, 154, 8, 14, 10, 14, 12, 14, 157, 9, 14, 1, 14, 1, 14, 3, 14, 161, 8, 14, 1, 14, 3, 14, 164, 8, 14, 1, 15, 3, 15, 167, 8, 15, 1, 15, 1, 15, 3, 15, 171, 8, 15, 1, 15, 1, 15, 3, 15, 175, 8, 15, 1, 15, 1, 15, 3, 15, 179, 8, 15, 5, 15, 181, 8, 15, 10, 15, 12, 15, 184, 9, 15, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 190, 8, 16, 1, 16, 5, 16, 193, 8, 16, 10, 16, 12, 16, 196, 9, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 3, 19, 211, 8, 19, 1, 20, 1, 20, 1, 20, 3, 20, 216, 8, 20, 1, 21, 4, 21, 219, 8, 21, 11, 21, 12, 21, 220, 1, 22, 3, 22, 224, 8, 22, 1, 22, 1, 22, 3, 22, 228, 8, 22, 1, 22, 1, 22, 3, 22, 232, 8, 22, 1, 23, 1, 23, 1, 23, 3, 23, 237, 8, 23, 5, 23, 239, 8, 23, 10, 23, 12, 23, 242, 9, 23, 1, 23, 1, 23, 3, 23, 246, 8, 23, 4, 23, 248, 8, 23, 11, 23, 12, 23, 249, 3, 23, 252, 8, 23, 1, 23, 0, 0, 24, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 0, 0, 280, 0, 48, 1, 0, 0, 0, 2, 51, 1, 0, 0, 0, 4, 57, 1, 0, 0, 0, 6, 61, 1, 0, 0, 0, 8, 67, 1, 0, 0, 0, 10, 73, 1, 0, 0, 0, 12, 77, 1, 0, 0, 0, 14, 80, 1, 0, 0, 0, 16, 96, 1, 0, 0, 0, 18, 98, 1, 0, 0, 0, 20, 109, 1, 0, 0, 0, 22, 115, 1, 0, 0, 0, 24, 129, 1, 0, 0, 0, 26, 137, 1, 0, 0, 0, 28, 140, 1, 0, 0, 0, 30, 166, 1, 0, 0, 0, 32, 185, 1, 0, 0, 0, 34, 199, 1, 0, 0, 0, 36, 201, 1, 0, 0, 0, 38, 210, 1, 0, 0, 0, 40, 215, 1, 0, 0, 0, 42, 218, 1, 0, 0, 0, 44, 223, 1, 0, 0, 0, 46, 251, 1, 0, 0, 0, 48, 49, 3, 2, 1, 0, 49, 1, 1, 0, 0, 0, 50, 52, 3, 4, 2, 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, 3, 1, 0, 0, 0, 55, 58, 3, 22, 11, 0, 56, 58, 3, 12, 6, 0, 57, 55, 1, 0, 0, 0, 57, 56, 1, 0, 0, 0, 58, 5, 1, 0, 0, 0, 59, 62, 3, 12, 6, 0, 60, 62, 3, 22, 11, 0, 61, 59, 1, 0, 0, 0, 61, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 61, 1, 0, 0, 0, 63, 64, 1, 0, 0, 0, 64, 7, 1, 0, 0, 0, 65, 68, 3, 12, 6, 0, 66, 68, 3, 22, 11, 0, 67, 65, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 67, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 9, 1, 0, 0, 0, 71, 74, 3, 12, 6, 0, 72, 74, 3, 22, 11, 0, 73, 71, 1, 0, 0, 0, 73, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 11, 1, 0, 0, 0, 77, 78, 5, 10, 0, 0, 78, 13, 1, 0, 0, 0, 79, 81, 3, 12, 6, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 90, 1, 0, 0, 0, 82, 84, 3, 16, 8, 0, 83, 82, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 91, 3, 12, 6, 0, 86, 88, 3, 16, 8, 0, 87, 89, 3, 12, 6, 0, 88, 87, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 91, 1, 0, 0, 0, 90, 83, 1, 0, 0, 0, 90, 86, 1, 0, 0, 0, 91, 92, 1, 0, 0, 0, 92, 90, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 94, 1, 0, 0, 0, 94, 95, 3, 22, 11, 0, 95, 15, 1, 0, 0, 0, 96, 97, 3, 18, 9, 0, 97, 17, 1, 0, 0, 0, 98, 100, 5, 11, 0, 0, 99, 101, 5, 7, 0, 0, 100, 99, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 104, 3, 20, 10, 0, 103, 105, 5, 7, 0, 0, 104, 103, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 106, 1, 0, 0, 0, 106, 107, 5, 12, 0, 0, 107, 19, 1, 0, 0, 0, 108, 110, 5, 7, 0, 0, 109, 108, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 112, 3, 38, 19, 0, 112, 113, 3, 40, 20, 0, 113, 21, 1, 0, 0, 0, 114, 116, 5, 7, 0, 0, 115, 114, 1, 0, 0, 0, 115, 116, 1, 0, 0, 0, 116, 117, 1, 0, 0, 0, 117, 118, 3, 24, 12, 0, 118, 23, 1, 0, 0, 0, 119, 120, 5, 20, 0, 0, 120, 130, 3, 28, 14, 0, 121, 122, 5, 21, 0, 0, 122, 124, 3, 28, 14, 0, 123, 121, 1, 0, 0, 0, 124, 127, 1, 0, 0, 0, 125, 123, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 128, 1, 0, 0, 0, 127, 125, 1, 0, 0, 0, 128, 130, 3, 26, 13, 0, 129, 119, 1, 0, 0, 0, 129, 125, 1, 0, 0, 0, 130, 25, 1, 0, 0, 0, 131, 138, 5, 21, 0, 0, 132, 133, 5, 21, 0, 0, 133, 138, 3, 28, 14, 0, 134, 135, 5, 22, 0, 0, 135, 138, 3, 28, 14, 0, 136, 138, 5, 22, 0, 0, 137, 131, 1, 0, 0, 0, 137, 132, 1, 0, 0, 0, 137, 134, 1, 0, 0, 0, 137, 136, 1, 0, 0, 0, 138, 27, 1, 0, 0, 0, 139, 141, 5, 7, 0, 0, 140, 139, 1, 0, 0, 0, 140, 141, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 144, 3, 30, 15, 0, 143, 145, 5, 7, 0, 0, 144, 143, 1, 0, 0, 0, 144, 145, 1, 0, 0, 0, 145, 160, 1, 0, 0, 0, 146, 147, 5, 1, 0, 0, 147, 155, 3, 36, 18, 0, 148, 150, 5, 2, 0, 0, 149, 151, 5, 7, 0, 0, 150, 149, 1, 0, 0, 0, 150, 151, 1, 0, 0, 0, 151, 152, 1, 0, 0, 0, 152, 154, 3, 36, 18, 0, 153, 148, 1, 0, 0, 0, 154, 157, 1, 0, 0, 0, 155, 153, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 158, 1, 0, 0, 0, 157, 155, 1, 0, 0, 0, 158, 159, 5, 3, 0, 0, 159, 161, 1, 0, 0, 0, 160, 146, 1, 0, 0, 0, 160, 161, 1, 0, 0, 0, 161, 163, 1, 0, 0, 0, 162, 164, 5, 7, 0, 0, 163, 162, 1, 0, 0, 0, 163, 164, 1, 0, 0, 0, 164, 29, 1, 0, 0, 0, 165, 167, 5, 7, 0, 0, 166, 165, 1, 0, 0, 0, 166, 167, 1, 0, 0, 0, 167, 168, 1, 0, 0, 0, 168, 170, 3, 34, 17, 0, 169, 171, 5, 7, 0, 0, 170, 169, 1, 0, 0, 0, 170, 171, 1, 0, 0, 0, 171, 182, 1, 0, 0, 0, 172, 174, 5, 4, 0, 0, 173, 175, 5, 7, 0, 0, 174, 173, 1, 0, 0, 0, 174, 175, 1, 0, 0, 0, 175, 176, 1, 0, 0, 0, 176, 178, 3, 34, 17, 0, 177, 179, 5, 7, 0, 0, 178, 177, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 181, 1, 0, 0, 0, 180, 172, 1, 0, 0, 0, 181, 184, 1, 0, 0, 0, 182, 180, 1, 0, 0, 0, 182, 183, 1, 0, 0, 0, 183, 31, 1, 0, 0, 0, 184, 182, 1, 0, 0, 0, 185, 186, 5, 1, 0, 0, 186, 194, 3, 36, 18, 0, 187, 189, 5, 2, 0, 0, 188, 190, 5, 7, 0, 0, 189, 188, 1, 0, 0, 0, 189, 190, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 3, 36, 18, 0, 192, 187, 1, 0, 0, 0, 193, 196, 1, 0, 0, 0, 194, 192, 1, 0, 0, 0, 194, 195, 1, 0, 0, 0, 195, 197, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 197, 198, 5, 3, 0, 0, 198, 33, 1, 0, 0, 0, 199, 200, 5, 23, 0, 0, 200, 35, 1, 0, 0, 0, 201, 202, 5, 23, 0, 0, 202, 37, 1, 0, 0, 0, 203, 211, 5, 13, 0, 0, 204, 211, 5, 14, 0, 0, 205, 211, 5, 15, 0, 0, 206, 211, 5, 16, 0, 0, 207, 211, 5, 17, 0, 0, 208, 211, 5, 18, 0, 0, 209, 211, 5, 19, 0, 0, 210, 203, 1, 0, 0, 0, 210, 204, 1, 0, 0, 0, 210, 205, 1, 0, 0, 0, 210, 206, 1, 0, 0, 0, 210, 207, 1, 0, 0, 0, 210, 208, 1, 0, 0, 0, 210, 209, 1, 0, 0, 0, 211, 39, 1, 0, 0, 0, 212, 213, 5, 8, 0, 0, 213, 216, 3, 42, 21, 0, 214, 216, 3, 46, 23, 0, 215, 212, 1, 0, 0, 0, 215, 214, 1, 0, 0, 0, 216, 41, 1, 0, 0, 0, 217, 219, 3, 44, 22, 0, 218, 217, 1, 0, 0, 0, 219, 220, 1, 0, 0, 0, 220, 218, 1, 0, 0, 0, 220, 221, 1, 0, 0, 0, 221, 43, 1, 0, 0, 0, 222, 224, 5, 7, 0, 0, 223, 222, 1, 0, 0, 0, 223, 224, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 227, 5, 5, 0, 0, 226, 228, 5, 7, 0, 0, 227, 226, 1, 0, 0, 0, 227, 228, 1, 0, 0, 0, 228, 231, 1, 0, 0, 0, 229, 232, 3, 10, 5, 0, 230, 232, 5, 9, 0, 0, 231, 229, 1, 0, 0, 0, 231, 230, 1, 0, 0, 0, 232, 45, 1, 0, 0, 0, 233, 240, 3, 14, 7, 0, 234, 236, 5, 6, 0, 0, 235, 237, 3, 14, 7, 0, 236, 235, 1, 0, 0, 0, 236, 237, 1, 0, 0, 0, 237, 239, 1, 0, 0, 0, 238, 234, 1, 0, 0, 0, 239, 242, 1, 0, 0, 0, 240, 238, 1, 0, 0, 0, 240, 241, 1, 0, 0, 0, 241, 252, 1, 0, 0, 0, 242, 240, 1, 0, 0, 0, 243, 245, 5, 6, 0, 0, 244, 246, 3, 14, 7, 0, 245, 244, 1, 0, 0, 0, 245, 246, 1, 0, 0, 0, 246, 248, 1, 0, 0, 0, 247, 243, 1, 0, 0, 0, 248, 249, 1, 0, 0, 0, 249, 247, 1, 0, 0, 0, 249, 250, 1, 0, 0, 0, 250, 252, 1, 0, 0, 0, 251, 233, 1, 0, 0, 0, 251, 247, 1, 0, 0, 0, 252, 47, 1, 0, 0, 0, 44, 53, 57, 61, 63, 67, 69, 73, 75, 80, 83, 88, 90, 92, 100, 104, 109, 115, 125, 129, 137, 140, 144, 150, 155, 160, 163, 166, 170, 174, 178, 182, 189, 194, 210, 215, 220, 223, 227, 231, 236, 240, 245, 249, 251]
\ No newline at end of file
diff --git a/InkBlot/Generated/InkBlotAntlrGrammar.tokens b/InkBlot/Generated/InkBlotAntlrGrammar.tokens
index 1211459..0fc8b1c 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammar.tokens
+++ b/InkBlot/Generated/InkBlotAntlrGrammar.tokens
@@ -21,10 +21,10 @@ THREAD_ARROW=20
DIVERT_ARROW=21
TUNNEL_ARROW=22
IDENTIFIER=23
-'.'=1
-'('=2
-','=3
-')'=4
+'('=1
+','=2
+')'=3
+'.'=4
'-'=5
'|'=6
'{'=11
diff --git a/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs b/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs
index bc8a7c6..874c6b8 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs
+++ b/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
+// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
// Unreachable code detected
#pragma warning disable 0162
@@ -180,6 +180,90 @@ public partial class InkBlotAntlrGrammarBaseListener : IInkBlotAntlrGrammarListe
/// The parse tree.
public virtual void ExitMultiDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertContext context) { }
///
+ /// Enter a parse tree produced by the MultiDivertThread
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterMultiDivertThread([NotNull] InkBlotAntlrGrammarParser.MultiDivertThreadContext context) { }
+ ///
+ /// Exit a parse tree produced by the MultiDivertThread
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitMultiDivertThread([NotNull] InkBlotAntlrGrammarParser.MultiDivertThreadContext context) { }
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterMultiDivertArrows([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrowsContext context) { }
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitMultiDivertArrows([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrowsContext context) { }
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailDefaultChoice
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterMultiDivertArrows_tailDefaultChoice([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDefaultChoiceContext context) { }
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailDefaultChoice
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitMultiDivertArrows_tailDefaultChoice([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDefaultChoiceContext context) { }
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailDivert
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterMultiDivertArrows_tailDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDivertContext context) { }
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailDivert
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitMultiDivertArrows_tailDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDivertContext context) { }
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailTunnelWithReplacement
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterMultiDivertArrows_tailTunnelWithReplacement([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelWithReplacementContext context) { }
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailTunnelWithReplacement
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitMultiDivertArrows_tailTunnelWithReplacement([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelWithReplacementContext context) { }
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailTunnel
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterMultiDivertArrows_tailTunnel([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelContext context) { }
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailTunnel
+ /// labeled alternative in .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitMultiDivertArrows_tailTunnel([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelContext context) { }
+ ///
/// Enter a parse tree produced by .
/// The default implementation does nothing.
///
@@ -192,6 +276,30 @@ public partial class InkBlotAntlrGrammarBaseListener : IInkBlotAntlrGrammarListe
/// The parse tree.
public virtual void ExitDivertIdentifierWithArguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArgumentsContext context) { }
///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterDivertIdentifierWithArguments_name([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitDivertIdentifierWithArguments_name([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext context) { }
+ ///
+ /// Enter a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void EnterDivertIdentifierWithArguments_arguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_argumentsContext context) { }
+ ///
+ /// Exit a parse tree produced by .
+ /// The default implementation does nothing.
+ ///
+ /// The parse tree.
+ public virtual void ExitDivertIdentifierWithArguments_arguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_argumentsContext 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 118a14b..e4e48de 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs
+++ b/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
+// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
// Unreachable code detected
#pragma warning disable 0162
@@ -155,6 +155,72 @@ public partial class InkBlotAntlrGrammarBaseVisitor : AbstractParseTreeV
/// The visitor result.
public virtual Result VisitMultiDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertContext context) { return VisitChildren(context); }
///
+ /// Visit a parse tree produced by the MultiDivertThread
+ /// labeled alternative in .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMultiDivertThread([NotNull] InkBlotAntlrGrammarParser.MultiDivertThreadContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows
+ /// labeled alternative in .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMultiDivertArrows([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrowsContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailDefaultChoice
+ /// labeled alternative in .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMultiDivertArrows_tailDefaultChoice([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDefaultChoiceContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailDivert
+ /// labeled alternative in .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMultiDivertArrows_tailDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDivertContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailTunnelWithReplacement
+ /// labeled alternative in .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMultiDivertArrows_tailTunnelWithReplacement([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelWithReplacementContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailTunnel
+ /// labeled alternative in .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMultiDivertArrows_tailTunnel([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelContext context) { return VisitChildren(context); }
+ ///
/// Visit a parse tree produced by .
///
/// The default implementation returns the result of calling
@@ -165,6 +231,26 @@ public partial class InkBlotAntlrGrammarBaseVisitor : AbstractParseTreeV
/// The visitor result.
public virtual Result VisitDivertIdentifierWithArguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArgumentsContext 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 VisitDivertIdentifierWithArguments_name([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext 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 VisitDivertIdentifierWithArguments_arguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_argumentsContext context) { return VisitChildren(context); }
+ ///
/// Visit a parse tree produced by .
///
/// The default implementation returns the result of calling
diff --git a/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs b/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs
index b497f61..bff499f 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs
+++ b/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
+// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
// Unreachable code detected
#pragma warning disable 0162
@@ -65,7 +65,7 @@ public partial class InkBlotAntlrGrammarLexer : Lexer {
}
private static readonly string[] _LiteralNames = {
- null, "'.'", "'('", "','", "')'", "'-'", "'|'", null, null, null, null,
+ null, "'('", "','", "')'", "'.'", "'-'", "'|'", null, null, null, null,
"'{'", "'}'", null, null, null, null, null, null, null, "'<-'", "'->'",
"'->->'"
};
@@ -112,78 +112,76 @@ public partial class InkBlotAntlrGrammarLexer : Lexer {
private bool CONTENT_TEXT_NO_ESCAPE_SIMPLE_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 0: return InputStream.LA(1) != '>' ;
- case 1: return InputStream.LA(1) != '-' && InputStream.LA(1) != '>' ;
}
return true;
}
private static int[] _serializedATN = {
- 4,0,23,200,6,-1,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,
+ 4,0,23,198,6,-1,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,2,20,7,20,2,21,
7,21,2,22,7,22,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,4,6,
61,8,6,11,6,12,6,62,1,7,3,7,66,8,7,1,7,3,7,69,8,7,1,7,1,7,1,8,4,8,74,8,
- 8,11,8,12,8,75,1,9,1,9,1,9,1,9,1,9,1,9,1,9,4,9,85,8,9,11,9,12,9,86,1,10,
- 1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,3,13,101,8,13,1,
- 13,1,13,1,14,1,14,1,14,1,14,1,14,1,14,1,14,3,14,112,8,14,1,14,1,14,1,15,
- 1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,3,15,125,8,15,1,15,1,15,1,16,1,
- 16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,3,16,139,8,16,1,16,1,16,1,17,
- 1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,
- 3,17,158,8,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,
- 18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,181,8,18,1,18,1,18,
- 1,19,1,19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,22,4,22,197,8,
- 22,11,22,12,22,198,0,0,23,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,
- 21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,
- 45,23,1,0,5,2,0,9,9,32,32,5,0,10,10,13,13,35,60,92,92,123,125,1,0,0,65535,
- 4,0,32,33,36,36,38,38,126,126,4,0,48,57,65,90,95,95,97,122,214,0,1,1,0,
+ 8,11,8,12,8,75,1,9,1,9,1,9,1,9,1,9,4,9,83,8,9,11,9,12,9,84,1,10,1,10,1,
+ 11,1,11,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,3,13,99,8,13,1,13,1,13,
+ 1,14,1,14,1,14,1,14,1,14,1,14,1,14,3,14,110,8,14,1,14,1,14,1,15,1,15,1,
+ 15,1,15,1,15,1,15,1,15,1,15,1,15,3,15,123,8,15,1,15,1,15,1,16,1,16,1,16,
+ 1,16,1,16,1,16,1,16,1,16,1,16,1,16,3,16,137,8,16,1,16,1,16,1,17,1,17,1,
+ 17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,1,17,3,17,156,
+ 8,17,1,17,1,17,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,
+ 1,18,1,18,1,18,1,18,1,18,1,18,1,18,1,18,3,18,179,8,18,1,18,1,18,1,19,1,
+ 19,1,19,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,22,4,22,195,8,22,11,
+ 22,12,22,196,0,0,23,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,
+ 23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,
+ 1,0,5,2,0,9,9,32,32,6,0,10,10,13,13,32,32,35,60,92,92,123,125,1,0,0,65535,
+ 4,0,32,33,36,36,38,38,126,126,4,0,48,57,65,90,95,95,97,122,211,0,1,1,0,
0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,
1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,
0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,
1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,
0,1,47,1,0,0,0,3,49,1,0,0,0,5,51,1,0,0,0,7,53,1,0,0,0,9,55,1,0,0,0,11,
- 57,1,0,0,0,13,60,1,0,0,0,15,65,1,0,0,0,17,73,1,0,0,0,19,84,1,0,0,0,21,
- 88,1,0,0,0,23,90,1,0,0,0,25,92,1,0,0,0,27,94,1,0,0,0,29,104,1,0,0,0,31,
- 115,1,0,0,0,33,128,1,0,0,0,35,142,1,0,0,0,37,161,1,0,0,0,39,184,1,0,0,
- 0,41,187,1,0,0,0,43,190,1,0,0,0,45,196,1,0,0,0,47,48,5,46,0,0,48,2,1,0,
- 0,0,49,50,5,40,0,0,50,4,1,0,0,0,51,52,5,44,0,0,52,6,1,0,0,0,53,54,5,41,
+ 57,1,0,0,0,13,60,1,0,0,0,15,65,1,0,0,0,17,73,1,0,0,0,19,82,1,0,0,0,21,
+ 86,1,0,0,0,23,88,1,0,0,0,25,90,1,0,0,0,27,92,1,0,0,0,29,102,1,0,0,0,31,
+ 113,1,0,0,0,33,126,1,0,0,0,35,140,1,0,0,0,37,159,1,0,0,0,39,182,1,0,0,
+ 0,41,185,1,0,0,0,43,188,1,0,0,0,45,194,1,0,0,0,47,48,5,40,0,0,48,2,1,0,
+ 0,0,49,50,5,44,0,0,50,4,1,0,0,0,51,52,5,41,0,0,52,6,1,0,0,0,53,54,5,46,
0,0,54,8,1,0,0,0,55,56,5,45,0,0,56,10,1,0,0,0,57,58,5,124,0,0,58,12,1,
0,0,0,59,61,7,0,0,0,60,59,1,0,0,0,61,62,1,0,0,0,62,60,1,0,0,0,62,63,1,
0,0,0,63,14,1,0,0,0,64,66,3,13,6,0,65,64,1,0,0,0,65,66,1,0,0,0,66,68,1,
0,0,0,67,69,5,13,0,0,68,67,1,0,0,0,68,69,1,0,0,0,69,70,1,0,0,0,70,71,5,
10,0,0,71,16,1,0,0,0,72,74,3,15,7,0,73,72,1,0,0,0,74,75,1,0,0,0,75,73,
- 1,0,0,0,75,76,1,0,0,0,76,18,1,0,0,0,77,85,8,1,0,0,78,79,5,92,0,0,79,85,
- 7,2,0,0,80,81,5,45,0,0,81,85,4,9,0,0,82,83,5,60,0,0,83,85,4,9,1,0,84,77,
- 1,0,0,0,84,78,1,0,0,0,84,80,1,0,0,0,84,82,1,0,0,0,85,86,1,0,0,0,86,84,
- 1,0,0,0,86,87,1,0,0,0,87,20,1,0,0,0,88,89,5,123,0,0,89,22,1,0,0,0,90,91,
- 5,125,0,0,91,24,1,0,0,0,92,93,7,3,0,0,93,26,1,0,0,0,94,95,5,111,0,0,95,
- 96,5,110,0,0,96,97,5,99,0,0,97,98,5,101,0,0,98,100,1,0,0,0,99,101,3,13,
- 6,0,100,99,1,0,0,0,100,101,1,0,0,0,101,102,1,0,0,0,102,103,5,58,0,0,103,
- 28,1,0,0,0,104,105,5,99,0,0,105,106,5,121,0,0,106,107,5,99,0,0,107,108,
- 5,108,0,0,108,109,5,101,0,0,109,111,1,0,0,0,110,112,3,13,6,0,111,110,1,
- 0,0,0,111,112,1,0,0,0,112,113,1,0,0,0,113,114,5,58,0,0,114,30,1,0,0,0,
- 115,116,5,115,0,0,116,117,5,104,0,0,117,118,5,117,0,0,118,119,5,102,0,
- 0,119,120,5,102,0,0,120,121,5,108,0,0,121,122,5,101,0,0,122,124,1,0,0,
- 0,123,125,3,13,6,0,124,123,1,0,0,0,124,125,1,0,0,0,125,126,1,0,0,0,126,
- 127,5,58,0,0,127,32,1,0,0,0,128,129,5,115,0,0,129,130,5,116,0,0,130,131,
- 5,111,0,0,131,132,5,112,0,0,132,133,5,112,0,0,133,134,5,105,0,0,134,135,
- 5,110,0,0,135,136,5,103,0,0,136,138,1,0,0,0,137,139,3,13,6,0,138,137,1,
- 0,0,0,138,139,1,0,0,0,139,140,1,0,0,0,140,141,5,58,0,0,141,34,1,0,0,0,
- 142,143,5,115,0,0,143,144,5,104,0,0,144,145,5,117,0,0,145,146,5,102,0,
- 0,146,147,5,102,0,0,147,148,5,108,0,0,148,149,5,101,0,0,149,150,1,0,0,
- 0,150,151,3,13,6,0,151,152,5,111,0,0,152,153,5,110,0,0,153,154,5,99,0,
- 0,154,155,5,101,0,0,155,157,1,0,0,0,156,158,3,13,6,0,157,156,1,0,0,0,157,
- 158,1,0,0,0,158,159,1,0,0,0,159,160,5,58,0,0,160,36,1,0,0,0,161,162,5,
- 115,0,0,162,163,5,104,0,0,163,164,5,117,0,0,164,165,5,102,0,0,165,166,
- 5,102,0,0,166,167,5,108,0,0,167,168,5,101,0,0,168,169,1,0,0,0,169,170,
- 3,13,6,0,170,171,5,115,0,0,171,172,5,116,0,0,172,173,5,111,0,0,173,174,
- 5,112,0,0,174,175,5,112,0,0,175,176,5,105,0,0,176,177,5,110,0,0,177,178,
- 5,103,0,0,178,180,1,0,0,0,179,181,3,13,6,0,180,179,1,0,0,0,180,181,1,0,
- 0,0,181,182,1,0,0,0,182,183,5,58,0,0,183,38,1,0,0,0,184,185,5,60,0,0,185,
- 186,5,45,0,0,186,40,1,0,0,0,187,188,5,45,0,0,188,189,5,62,0,0,189,42,1,
- 0,0,0,190,191,5,45,0,0,191,192,5,62,0,0,192,193,5,45,0,0,193,194,5,62,
- 0,0,194,44,1,0,0,0,195,197,7,4,0,0,196,195,1,0,0,0,197,198,1,0,0,0,198,
- 196,1,0,0,0,198,199,1,0,0,0,199,46,1,0,0,0,14,0,62,65,68,75,84,86,100,
- 111,124,138,157,180,198,0
+ 1,0,0,0,75,76,1,0,0,0,76,18,1,0,0,0,77,83,8,1,0,0,78,79,5,92,0,0,79,83,
+ 7,2,0,0,80,81,5,45,0,0,81,83,4,9,0,0,82,77,1,0,0,0,82,78,1,0,0,0,82,80,
+ 1,0,0,0,83,84,1,0,0,0,84,82,1,0,0,0,84,85,1,0,0,0,85,20,1,0,0,0,86,87,
+ 5,123,0,0,87,22,1,0,0,0,88,89,5,125,0,0,89,24,1,0,0,0,90,91,7,3,0,0,91,
+ 26,1,0,0,0,92,93,5,111,0,0,93,94,5,110,0,0,94,95,5,99,0,0,95,96,5,101,
+ 0,0,96,98,1,0,0,0,97,99,3,13,6,0,98,97,1,0,0,0,98,99,1,0,0,0,99,100,1,
+ 0,0,0,100,101,5,58,0,0,101,28,1,0,0,0,102,103,5,99,0,0,103,104,5,121,0,
+ 0,104,105,5,99,0,0,105,106,5,108,0,0,106,107,5,101,0,0,107,109,1,0,0,0,
+ 108,110,3,13,6,0,109,108,1,0,0,0,109,110,1,0,0,0,110,111,1,0,0,0,111,112,
+ 5,58,0,0,112,30,1,0,0,0,113,114,5,115,0,0,114,115,5,104,0,0,115,116,5,
+ 117,0,0,116,117,5,102,0,0,117,118,5,102,0,0,118,119,5,108,0,0,119,120,
+ 5,101,0,0,120,122,1,0,0,0,121,123,3,13,6,0,122,121,1,0,0,0,122,123,1,0,
+ 0,0,123,124,1,0,0,0,124,125,5,58,0,0,125,32,1,0,0,0,126,127,5,115,0,0,
+ 127,128,5,116,0,0,128,129,5,111,0,0,129,130,5,112,0,0,130,131,5,112,0,
+ 0,131,132,5,105,0,0,132,133,5,110,0,0,133,134,5,103,0,0,134,136,1,0,0,
+ 0,135,137,3,13,6,0,136,135,1,0,0,0,136,137,1,0,0,0,137,138,1,0,0,0,138,
+ 139,5,58,0,0,139,34,1,0,0,0,140,141,5,115,0,0,141,142,5,104,0,0,142,143,
+ 5,117,0,0,143,144,5,102,0,0,144,145,5,102,0,0,145,146,5,108,0,0,146,147,
+ 5,101,0,0,147,148,1,0,0,0,148,149,3,13,6,0,149,150,5,111,0,0,150,151,5,
+ 110,0,0,151,152,5,99,0,0,152,153,5,101,0,0,153,155,1,0,0,0,154,156,3,13,
+ 6,0,155,154,1,0,0,0,155,156,1,0,0,0,156,157,1,0,0,0,157,158,5,58,0,0,158,
+ 36,1,0,0,0,159,160,5,115,0,0,160,161,5,104,0,0,161,162,5,117,0,0,162,163,
+ 5,102,0,0,163,164,5,102,0,0,164,165,5,108,0,0,165,166,5,101,0,0,166,167,
+ 1,0,0,0,167,168,3,13,6,0,168,169,5,115,0,0,169,170,5,116,0,0,170,171,5,
+ 111,0,0,171,172,5,112,0,0,172,173,5,112,0,0,173,174,5,105,0,0,174,175,
+ 5,110,0,0,175,176,5,103,0,0,176,178,1,0,0,0,177,179,3,13,6,0,178,177,1,
+ 0,0,0,178,179,1,0,0,0,179,180,1,0,0,0,180,181,5,58,0,0,181,38,1,0,0,0,
+ 182,183,5,60,0,0,183,184,5,45,0,0,184,40,1,0,0,0,185,186,5,45,0,0,186,
+ 187,5,62,0,0,187,42,1,0,0,0,188,189,5,45,0,0,189,190,5,62,0,0,190,191,
+ 5,45,0,0,191,192,5,62,0,0,192,44,1,0,0,0,193,195,7,4,0,0,194,193,1,0,0,
+ 0,195,196,1,0,0,0,196,194,1,0,0,0,196,197,1,0,0,0,197,46,1,0,0,0,14,0,
+ 62,65,68,75,82,84,98,109,122,136,155,178,196,0
};
public static readonly ATN _ATN =
diff --git a/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp b/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp
index 5da2512..75c2a98 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp
+++ b/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp
@@ -1,9 +1,9 @@
token literal names:
null
-'.'
'('
','
')'
+'.'
'-'
'|'
null
@@ -83,4 +83,4 @@ mode names:
DEFAULT_MODE
atn:
-[4, 0, 23, 200, 6, -1, 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, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 4, 6, 61, 8, 6, 11, 6, 12, 6, 62, 1, 7, 3, 7, 66, 8, 7, 1, 7, 3, 7, 69, 8, 7, 1, 7, 1, 7, 1, 8, 4, 8, 74, 8, 8, 11, 8, 12, 8, 75, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 4, 9, 85, 8, 9, 11, 9, 12, 9, 86, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 101, 8, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 112, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 125, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 139, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 158, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 181, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 4, 22, 197, 8, 22, 11, 22, 12, 22, 198, 0, 0, 23, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 1, 0, 5, 2, 0, 9, 9, 32, 32, 5, 0, 10, 10, 13, 13, 35, 60, 92, 92, 123, 125, 1, 0, 0, 65535, 4, 0, 32, 33, 36, 36, 38, 38, 126, 126, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 214, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 1, 47, 1, 0, 0, 0, 3, 49, 1, 0, 0, 0, 5, 51, 1, 0, 0, 0, 7, 53, 1, 0, 0, 0, 9, 55, 1, 0, 0, 0, 11, 57, 1, 0, 0, 0, 13, 60, 1, 0, 0, 0, 15, 65, 1, 0, 0, 0, 17, 73, 1, 0, 0, 0, 19, 84, 1, 0, 0, 0, 21, 88, 1, 0, 0, 0, 23, 90, 1, 0, 0, 0, 25, 92, 1, 0, 0, 0, 27, 94, 1, 0, 0, 0, 29, 104, 1, 0, 0, 0, 31, 115, 1, 0, 0, 0, 33, 128, 1, 0, 0, 0, 35, 142, 1, 0, 0, 0, 37, 161, 1, 0, 0, 0, 39, 184, 1, 0, 0, 0, 41, 187, 1, 0, 0, 0, 43, 190, 1, 0, 0, 0, 45, 196, 1, 0, 0, 0, 47, 48, 5, 46, 0, 0, 48, 2, 1, 0, 0, 0, 49, 50, 5, 40, 0, 0, 50, 4, 1, 0, 0, 0, 51, 52, 5, 44, 0, 0, 52, 6, 1, 0, 0, 0, 53, 54, 5, 41, 0, 0, 54, 8, 1, 0, 0, 0, 55, 56, 5, 45, 0, 0, 56, 10, 1, 0, 0, 0, 57, 58, 5, 124, 0, 0, 58, 12, 1, 0, 0, 0, 59, 61, 7, 0, 0, 0, 60, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 14, 1, 0, 0, 0, 64, 66, 3, 13, 6, 0, 65, 64, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 68, 1, 0, 0, 0, 67, 69, 5, 13, 0, 0, 68, 67, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 5, 10, 0, 0, 71, 16, 1, 0, 0, 0, 72, 74, 3, 15, 7, 0, 73, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 18, 1, 0, 0, 0, 77, 85, 8, 1, 0, 0, 78, 79, 5, 92, 0, 0, 79, 85, 7, 2, 0, 0, 80, 81, 5, 45, 0, 0, 81, 85, 4, 9, 0, 0, 82, 83, 5, 60, 0, 0, 83, 85, 4, 9, 1, 0, 84, 77, 1, 0, 0, 0, 84, 78, 1, 0, 0, 0, 84, 80, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 84, 1, 0, 0, 0, 86, 87, 1, 0, 0, 0, 87, 20, 1, 0, 0, 0, 88, 89, 5, 123, 0, 0, 89, 22, 1, 0, 0, 0, 90, 91, 5, 125, 0, 0, 91, 24, 1, 0, 0, 0, 92, 93, 7, 3, 0, 0, 93, 26, 1, 0, 0, 0, 94, 95, 5, 111, 0, 0, 95, 96, 5, 110, 0, 0, 96, 97, 5, 99, 0, 0, 97, 98, 5, 101, 0, 0, 98, 100, 1, 0, 0, 0, 99, 101, 3, 13, 6, 0, 100, 99, 1, 0, 0, 0, 100, 101, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 103, 5, 58, 0, 0, 103, 28, 1, 0, 0, 0, 104, 105, 5, 99, 0, 0, 105, 106, 5, 121, 0, 0, 106, 107, 5, 99, 0, 0, 107, 108, 5, 108, 0, 0, 108, 109, 5, 101, 0, 0, 109, 111, 1, 0, 0, 0, 110, 112, 3, 13, 6, 0, 111, 110, 1, 0, 0, 0, 111, 112, 1, 0, 0, 0, 112, 113, 1, 0, 0, 0, 113, 114, 5, 58, 0, 0, 114, 30, 1, 0, 0, 0, 115, 116, 5, 115, 0, 0, 116, 117, 5, 104, 0, 0, 117, 118, 5, 117, 0, 0, 118, 119, 5, 102, 0, 0, 119, 120, 5, 102, 0, 0, 120, 121, 5, 108, 0, 0, 121, 122, 5, 101, 0, 0, 122, 124, 1, 0, 0, 0, 123, 125, 3, 13, 6, 0, 124, 123, 1, 0, 0, 0, 124, 125, 1, 0, 0, 0, 125, 126, 1, 0, 0, 0, 126, 127, 5, 58, 0, 0, 127, 32, 1, 0, 0, 0, 128, 129, 5, 115, 0, 0, 129, 130, 5, 116, 0, 0, 130, 131, 5, 111, 0, 0, 131, 132, 5, 112, 0, 0, 132, 133, 5, 112, 0, 0, 133, 134, 5, 105, 0, 0, 134, 135, 5, 110, 0, 0, 135, 136, 5, 103, 0, 0, 136, 138, 1, 0, 0, 0, 137, 139, 3, 13, 6, 0, 138, 137, 1, 0, 0, 0, 138, 139, 1, 0, 0, 0, 139, 140, 1, 0, 0, 0, 140, 141, 5, 58, 0, 0, 141, 34, 1, 0, 0, 0, 142, 143, 5, 115, 0, 0, 143, 144, 5, 104, 0, 0, 144, 145, 5, 117, 0, 0, 145, 146, 5, 102, 0, 0, 146, 147, 5, 102, 0, 0, 147, 148, 5, 108, 0, 0, 148, 149, 5, 101, 0, 0, 149, 150, 1, 0, 0, 0, 150, 151, 3, 13, 6, 0, 151, 152, 5, 111, 0, 0, 152, 153, 5, 110, 0, 0, 153, 154, 5, 99, 0, 0, 154, 155, 5, 101, 0, 0, 155, 157, 1, 0, 0, 0, 156, 158, 3, 13, 6, 0, 157, 156, 1, 0, 0, 0, 157, 158, 1, 0, 0, 0, 158, 159, 1, 0, 0, 0, 159, 160, 5, 58, 0, 0, 160, 36, 1, 0, 0, 0, 161, 162, 5, 115, 0, 0, 162, 163, 5, 104, 0, 0, 163, 164, 5, 117, 0, 0, 164, 165, 5, 102, 0, 0, 165, 166, 5, 102, 0, 0, 166, 167, 5, 108, 0, 0, 167, 168, 5, 101, 0, 0, 168, 169, 1, 0, 0, 0, 169, 170, 3, 13, 6, 0, 170, 171, 5, 115, 0, 0, 171, 172, 5, 116, 0, 0, 172, 173, 5, 111, 0, 0, 173, 174, 5, 112, 0, 0, 174, 175, 5, 112, 0, 0, 175, 176, 5, 105, 0, 0, 176, 177, 5, 110, 0, 0, 177, 178, 5, 103, 0, 0, 178, 180, 1, 0, 0, 0, 179, 181, 3, 13, 6, 0, 180, 179, 1, 0, 0, 0, 180, 181, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 183, 5, 58, 0, 0, 183, 38, 1, 0, 0, 0, 184, 185, 5, 60, 0, 0, 185, 186, 5, 45, 0, 0, 186, 40, 1, 0, 0, 0, 187, 188, 5, 45, 0, 0, 188, 189, 5, 62, 0, 0, 189, 42, 1, 0, 0, 0, 190, 191, 5, 45, 0, 0, 191, 192, 5, 62, 0, 0, 192, 193, 5, 45, 0, 0, 193, 194, 5, 62, 0, 0, 194, 44, 1, 0, 0, 0, 195, 197, 7, 4, 0, 0, 196, 195, 1, 0, 0, 0, 197, 198, 1, 0, 0, 0, 198, 196, 1, 0, 0, 0, 198, 199, 1, 0, 0, 0, 199, 46, 1, 0, 0, 0, 14, 0, 62, 65, 68, 75, 84, 86, 100, 111, 124, 138, 157, 180, 198, 0]
\ No newline at end of file
+[4, 0, 23, 198, 6, -1, 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, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 4, 6, 61, 8, 6, 11, 6, 12, 6, 62, 1, 7, 3, 7, 66, 8, 7, 1, 7, 3, 7, 69, 8, 7, 1, 7, 1, 7, 1, 8, 4, 8, 74, 8, 8, 11, 8, 12, 8, 75, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 4, 9, 83, 8, 9, 11, 9, 12, 9, 84, 1, 10, 1, 10, 1, 11, 1, 11, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 3, 13, 99, 8, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 1, 14, 3, 14, 110, 8, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 3, 15, 123, 8, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 1, 16, 3, 16, 137, 8, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 3, 17, 156, 8, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 3, 18, 179, 8, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 4, 22, 195, 8, 22, 11, 22, 12, 22, 196, 0, 0, 23, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17, 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 1, 0, 5, 2, 0, 9, 9, 32, 32, 6, 0, 10, 10, 13, 13, 32, 32, 35, 60, 92, 92, 123, 125, 1, 0, 0, 65535, 4, 0, 32, 33, 36, 36, 38, 38, 126, 126, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 211, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 1, 47, 1, 0, 0, 0, 3, 49, 1, 0, 0, 0, 5, 51, 1, 0, 0, 0, 7, 53, 1, 0, 0, 0, 9, 55, 1, 0, 0, 0, 11, 57, 1, 0, 0, 0, 13, 60, 1, 0, 0, 0, 15, 65, 1, 0, 0, 0, 17, 73, 1, 0, 0, 0, 19, 82, 1, 0, 0, 0, 21, 86, 1, 0, 0, 0, 23, 88, 1, 0, 0, 0, 25, 90, 1, 0, 0, 0, 27, 92, 1, 0, 0, 0, 29, 102, 1, 0, 0, 0, 31, 113, 1, 0, 0, 0, 33, 126, 1, 0, 0, 0, 35, 140, 1, 0, 0, 0, 37, 159, 1, 0, 0, 0, 39, 182, 1, 0, 0, 0, 41, 185, 1, 0, 0, 0, 43, 188, 1, 0, 0, 0, 45, 194, 1, 0, 0, 0, 47, 48, 5, 40, 0, 0, 48, 2, 1, 0, 0, 0, 49, 50, 5, 44, 0, 0, 50, 4, 1, 0, 0, 0, 51, 52, 5, 41, 0, 0, 52, 6, 1, 0, 0, 0, 53, 54, 5, 46, 0, 0, 54, 8, 1, 0, 0, 0, 55, 56, 5, 45, 0, 0, 56, 10, 1, 0, 0, 0, 57, 58, 5, 124, 0, 0, 58, 12, 1, 0, 0, 0, 59, 61, 7, 0, 0, 0, 60, 59, 1, 0, 0, 0, 61, 62, 1, 0, 0, 0, 62, 60, 1, 0, 0, 0, 62, 63, 1, 0, 0, 0, 63, 14, 1, 0, 0, 0, 64, 66, 3, 13, 6, 0, 65, 64, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 68, 1, 0, 0, 0, 67, 69, 5, 13, 0, 0, 68, 67, 1, 0, 0, 0, 68, 69, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 5, 10, 0, 0, 71, 16, 1, 0, 0, 0, 72, 74, 3, 15, 7, 0, 73, 72, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 73, 1, 0, 0, 0, 75, 76, 1, 0, 0, 0, 76, 18, 1, 0, 0, 0, 77, 83, 8, 1, 0, 0, 78, 79, 5, 92, 0, 0, 79, 83, 7, 2, 0, 0, 80, 81, 5, 45, 0, 0, 81, 83, 4, 9, 0, 0, 82, 77, 1, 0, 0, 0, 82, 78, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 83, 84, 1, 0, 0, 0, 84, 82, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 20, 1, 0, 0, 0, 86, 87, 5, 123, 0, 0, 87, 22, 1, 0, 0, 0, 88, 89, 5, 125, 0, 0, 89, 24, 1, 0, 0, 0, 90, 91, 7, 3, 0, 0, 91, 26, 1, 0, 0, 0, 92, 93, 5, 111, 0, 0, 93, 94, 5, 110, 0, 0, 94, 95, 5, 99, 0, 0, 95, 96, 5, 101, 0, 0, 96, 98, 1, 0, 0, 0, 97, 99, 3, 13, 6, 0, 98, 97, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 100, 1, 0, 0, 0, 100, 101, 5, 58, 0, 0, 101, 28, 1, 0, 0, 0, 102, 103, 5, 99, 0, 0, 103, 104, 5, 121, 0, 0, 104, 105, 5, 99, 0, 0, 105, 106, 5, 108, 0, 0, 106, 107, 5, 101, 0, 0, 107, 109, 1, 0, 0, 0, 108, 110, 3, 13, 6, 0, 109, 108, 1, 0, 0, 0, 109, 110, 1, 0, 0, 0, 110, 111, 1, 0, 0, 0, 111, 112, 5, 58, 0, 0, 112, 30, 1, 0, 0, 0, 113, 114, 5, 115, 0, 0, 114, 115, 5, 104, 0, 0, 115, 116, 5, 117, 0, 0, 116, 117, 5, 102, 0, 0, 117, 118, 5, 102, 0, 0, 118, 119, 5, 108, 0, 0, 119, 120, 5, 101, 0, 0, 120, 122, 1, 0, 0, 0, 121, 123, 3, 13, 6, 0, 122, 121, 1, 0, 0, 0, 122, 123, 1, 0, 0, 0, 123, 124, 1, 0, 0, 0, 124, 125, 5, 58, 0, 0, 125, 32, 1, 0, 0, 0, 126, 127, 5, 115, 0, 0, 127, 128, 5, 116, 0, 0, 128, 129, 5, 111, 0, 0, 129, 130, 5, 112, 0, 0, 130, 131, 5, 112, 0, 0, 131, 132, 5, 105, 0, 0, 132, 133, 5, 110, 0, 0, 133, 134, 5, 103, 0, 0, 134, 136, 1, 0, 0, 0, 135, 137, 3, 13, 6, 0, 136, 135, 1, 0, 0, 0, 136, 137, 1, 0, 0, 0, 137, 138, 1, 0, 0, 0, 138, 139, 5, 58, 0, 0, 139, 34, 1, 0, 0, 0, 140, 141, 5, 115, 0, 0, 141, 142, 5, 104, 0, 0, 142, 143, 5, 117, 0, 0, 143, 144, 5, 102, 0, 0, 144, 145, 5, 102, 0, 0, 145, 146, 5, 108, 0, 0, 146, 147, 5, 101, 0, 0, 147, 148, 1, 0, 0, 0, 148, 149, 3, 13, 6, 0, 149, 150, 5, 111, 0, 0, 150, 151, 5, 110, 0, 0, 151, 152, 5, 99, 0, 0, 152, 153, 5, 101, 0, 0, 153, 155, 1, 0, 0, 0, 154, 156, 3, 13, 6, 0, 155, 154, 1, 0, 0, 0, 155, 156, 1, 0, 0, 0, 156, 157, 1, 0, 0, 0, 157, 158, 5, 58, 0, 0, 158, 36, 1, 0, 0, 0, 159, 160, 5, 115, 0, 0, 160, 161, 5, 104, 0, 0, 161, 162, 5, 117, 0, 0, 162, 163, 5, 102, 0, 0, 163, 164, 5, 102, 0, 0, 164, 165, 5, 108, 0, 0, 165, 166, 5, 101, 0, 0, 166, 167, 1, 0, 0, 0, 167, 168, 3, 13, 6, 0, 168, 169, 5, 115, 0, 0, 169, 170, 5, 116, 0, 0, 170, 171, 5, 111, 0, 0, 171, 172, 5, 112, 0, 0, 172, 173, 5, 112, 0, 0, 173, 174, 5, 105, 0, 0, 174, 175, 5, 110, 0, 0, 175, 176, 5, 103, 0, 0, 176, 178, 1, 0, 0, 0, 177, 179, 3, 13, 6, 0, 178, 177, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, 181, 5, 58, 0, 0, 181, 38, 1, 0, 0, 0, 182, 183, 5, 60, 0, 0, 183, 184, 5, 45, 0, 0, 184, 40, 1, 0, 0, 0, 185, 186, 5, 45, 0, 0, 186, 187, 5, 62, 0, 0, 187, 42, 1, 0, 0, 0, 188, 189, 5, 45, 0, 0, 189, 190, 5, 62, 0, 0, 190, 191, 5, 45, 0, 0, 191, 192, 5, 62, 0, 0, 192, 44, 1, 0, 0, 0, 193, 195, 7, 4, 0, 0, 194, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 194, 1, 0, 0, 0, 196, 197, 1, 0, 0, 0, 197, 46, 1, 0, 0, 0, 14, 0, 62, 65, 68, 75, 82, 84, 98, 109, 122, 136, 155, 178, 196, 0]
\ No newline at end of file
diff --git a/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens b/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens
index 1211459..0fc8b1c 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens
+++ b/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens
@@ -21,10 +21,10 @@ THREAD_ARROW=20
DIVERT_ARROW=21
TUNNEL_ARROW=22
IDENTIFIER=23
-'.'=1
-'('=2
-','=3
-')'=4
+'('=1
+','=2
+')'=3
+'.'=4
'-'=5
'|'=6
'{'=11
diff --git a/InkBlot/Generated/InkBlotAntlrGrammarListener.cs b/InkBlot/Generated/InkBlotAntlrGrammarListener.cs
index d73bde4..372b00a 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarListener.cs
+++ b/InkBlot/Generated/InkBlotAntlrGrammarListener.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
+// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
// Unreachable code detected
#pragma warning disable 0162
@@ -151,6 +151,78 @@ public interface IInkBlotAntlrGrammarListener : IParseTreeListener {
/// The parse tree.
void ExitMultiDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertContext context);
///
+ /// Enter a parse tree produced by the MultiDivertThread
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void EnterMultiDivertThread([NotNull] InkBlotAntlrGrammarParser.MultiDivertThreadContext context);
+ ///
+ /// Exit a parse tree produced by the MultiDivertThread
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void ExitMultiDivertThread([NotNull] InkBlotAntlrGrammarParser.MultiDivertThreadContext context);
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void EnterMultiDivertArrows([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrowsContext context);
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void ExitMultiDivertArrows([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrowsContext context);
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailDefaultChoice
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void EnterMultiDivertArrows_tailDefaultChoice([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDefaultChoiceContext context);
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailDefaultChoice
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void ExitMultiDivertArrows_tailDefaultChoice([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDefaultChoiceContext context);
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailDivert
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void EnterMultiDivertArrows_tailDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDivertContext context);
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailDivert
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void ExitMultiDivertArrows_tailDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDivertContext context);
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailTunnelWithReplacement
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void EnterMultiDivertArrows_tailTunnelWithReplacement([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelWithReplacementContext context);
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailTunnelWithReplacement
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void ExitMultiDivertArrows_tailTunnelWithReplacement([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelWithReplacementContext context);
+ ///
+ /// Enter a parse tree produced by the MultiDivertArrows_tailTunnel
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void EnterMultiDivertArrows_tailTunnel([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelContext context);
+ ///
+ /// Exit a parse tree produced by the MultiDivertArrows_tailTunnel
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ void ExitMultiDivertArrows_tailTunnel([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelContext context);
+ ///
/// Enter a parse tree produced by .
///
/// The parse tree.
@@ -161,6 +233,26 @@ public interface IInkBlotAntlrGrammarListener : IParseTreeListener {
/// The parse tree.
void ExitDivertIdentifierWithArguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArgumentsContext context);
///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterDivertIdentifierWithArguments_name([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitDivertIdentifierWithArguments_name([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext context);
+ ///
+ /// Enter a parse tree produced by .
+ ///
+ /// The parse tree.
+ void EnterDivertIdentifierWithArguments_arguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_argumentsContext context);
+ ///
+ /// Exit a parse tree produced by .
+ ///
+ /// The parse tree.
+ void ExitDivertIdentifierWithArguments_arguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_argumentsContext context);
+ ///
/// Enter a parse tree produced by .
///
/// The parse tree.
diff --git a/InkBlot/Generated/InkBlotAntlrGrammarParser.cs b/InkBlot/Generated/InkBlotAntlrGrammarParser.cs
index d524565..872e4ba 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarParser.cs
+++ b/InkBlot/Generated/InkBlotAntlrGrammarParser.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
+// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
// Unreachable code detected
#pragma warning disable 0162
@@ -45,21 +45,24 @@ public partial class InkBlotAntlrGrammarParser : Parser {
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;
+ RULE_inlineLogic = 9, RULE_innerLogic = 10, RULE_multiDivert = 11, RULE_multiDivert_withoutWS = 12,
+ RULE_multiDivertArrows_tail = 13, RULE_divertIdentifierWithArguments = 14,
+ RULE_divertIdentifierWithArguments_name = 15, RULE_divertIdentifierWithArguments_arguments = 16,
+ RULE_identifier = 17, RULE_expression = 18, RULE_sequenceTypeAnnotation = 19,
+ RULE_innerSequenceObjects = 20, RULE_innerMultilineSequenceObjects = 21,
+ RULE_singleMultilineSequenceElement = 22, RULE_innerInlineSequenceObjects = 23;
public static readonly string[] ruleNames = {
"story", "topLevelStatements", "topLevelStatement", "knotLevelStatements",
"stitchLevelStatements", "innerBlockLevelStatements", "contentText", "mixedTextAndLogic",
"inlineLogicOrGlueOrTagStart", "inlineLogic", "innerLogic", "multiDivert",
- "divertIdentifierWithArguments", "identifier", "expression", "sequenceTypeAnnotation",
- "innerSequenceObjects", "innerMultilineSequenceObjects", "singleMultilineSequenceElement",
- "innerInlineSequenceObjects"
+ "multiDivert_withoutWS", "multiDivertArrows_tail", "divertIdentifierWithArguments",
+ "divertIdentifierWithArguments_name", "divertIdentifierWithArguments_arguments",
+ "identifier", "expression", "sequenceTypeAnnotation", "innerSequenceObjects",
+ "innerMultilineSequenceObjects", "singleMultilineSequenceElement", "innerInlineSequenceObjects"
};
private static readonly string[] _LiteralNames = {
- null, "'.'", "'('", "','", "')'", "'-'", "'|'", null, null, null, null,
+ null, "'('", "','", "')'", "'.'", "'-'", "'|'", null, null, null, null,
"'{'", "'}'", null, null, null, null, null, null, null, "'<-'", "'->'",
"'->->'"
};
@@ -136,7 +139,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 40;
+ State = 48;
topLevelStatements();
}
}
@@ -189,17 +192,17 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 43;
+ State = 51;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
do {
{
{
- State = 42;
+ State = 50;
topLevelStatement();
}
}
- State = 45;
+ State = 53;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) );
@@ -217,12 +220,12 @@ public partial class InkBlotAntlrGrammarParser : Parser {
}
public partial class TopLevelStatementContext : ParserRuleContext {
- [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText() {
- return GetRuleContext(0);
- }
[System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert() {
return GetRuleContext(0);
}
+ [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText() {
+ return GetRuleContext(0);
+ }
public TopLevelStatementContext(ParserRuleContext parent, int invokingState)
: base(parent, invokingState)
{
@@ -251,24 +254,24 @@ public partial class InkBlotAntlrGrammarParser : Parser {
TopLevelStatementContext _localctx = new TopLevelStatementContext(Context, State);
EnterRule(_localctx, 4, RULE_topLevelStatement);
try {
- State = 49;
+ State = 57;
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, 1);
+ {
+ State = 55;
+ multiDivert();
+ }
+ break;
+ case CONTENT_TEXT_NO_ESCAPE_SIMPLE:
EnterOuterAlt(_localctx, 2);
{
- State = 48;
- multiDivert();
+ State = 56;
+ contentText();
}
break;
default:
@@ -330,17 +333,17 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 53;
+ State = 61;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
do {
{
- State = 53;
+ State = 61;
ErrorHandler.Sync(this);
switch (TokenStream.LA(1)) {
case CONTENT_TEXT_NO_ESCAPE_SIMPLE:
{
- State = 51;
+ State = 59;
contentText();
}
break;
@@ -349,7 +352,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
case DIVERT_ARROW:
case TUNNEL_ARROW:
{
- State = 52;
+ State = 60;
multiDivert();
}
break;
@@ -357,7 +360,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
throw new NoViableAltException(this);
}
}
- State = 55;
+ State = 63;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) );
@@ -418,17 +421,17 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 59;
+ State = 67;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
do {
{
- State = 59;
+ State = 67;
ErrorHandler.Sync(this);
switch (TokenStream.LA(1)) {
case CONTENT_TEXT_NO_ESCAPE_SIMPLE:
{
- State = 57;
+ State = 65;
contentText();
}
break;
@@ -437,7 +440,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
case DIVERT_ARROW:
case TUNNEL_ARROW:
{
- State = 58;
+ State = 66;
multiDivert();
}
break;
@@ -445,7 +448,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
throw new NoViableAltException(this);
}
}
- State = 61;
+ State = 69;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
} while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) );
@@ -506,19 +509,19 @@ public partial class InkBlotAntlrGrammarParser : Parser {
int _alt;
EnterOuterAlt(_localctx, 1);
{
- State = 65;
+ State = 73;
ErrorHandler.Sync(this);
_alt = 1;
do {
switch (_alt) {
case 1:
{
- State = 65;
+ State = 73;
ErrorHandler.Sync(this);
switch (TokenStream.LA(1)) {
case CONTENT_TEXT_NO_ESCAPE_SIMPLE:
{
- State = 63;
+ State = 71;
contentText();
}
break;
@@ -527,7 +530,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
case DIVERT_ARROW:
case TUNNEL_ARROW:
{
- State = 64;
+ State = 72;
multiDivert();
}
break;
@@ -539,7 +542,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
default:
throw new NoViableAltException(this);
}
- State = 67;
+ State = 75;
ErrorHandler.Sync(this);
_alt = Interpreter.AdaptivePredict(TokenStream,7,Context);
} while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER );
@@ -588,7 +591,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 69;
+ State = 77;
Match(CONTENT_TEXT_NO_ESCAPE_SIMPLE);
}
}
@@ -650,50 +653,50 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 72;
+ State = 80;
ErrorHandler.Sync(this);
switch ( Interpreter.AdaptivePredict(TokenStream,8,Context) ) {
case 1:
{
- State = 71;
+ State = 79;
contentText();
}
break;
}
- State = 82;
+ State = 90;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
do {
{
- State = 82;
+ State = 90;
ErrorHandler.Sync(this);
switch ( Interpreter.AdaptivePredict(TokenStream,11,Context) ) {
case 1:
{
- State = 75;
+ State = 83;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==INLINE_LOGIC_START) {
{
- State = 74;
+ State = 82;
inlineLogicOrGlueOrTagStart();
}
}
- State = 77;
+ State = 85;
contentText();
}
break;
case 2:
{
- State = 78;
+ State = 86;
inlineLogicOrGlueOrTagStart();
- State = 80;
+ State = 88;
ErrorHandler.Sync(this);
switch ( Interpreter.AdaptivePredict(TokenStream,10,Context) ) {
case 1:
{
- State = 79;
+ State = 87;
contentText();
}
break;
@@ -702,11 +705,11 @@ public partial class InkBlotAntlrGrammarParser : Parser {
break;
}
}
- State = 84;
+ State = 92;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
} while ( _la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START );
- State = 86;
+ State = 94;
multiDivert();
}
}
@@ -755,7 +758,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 88;
+ State = 96;
inlineLogic();
}
}
@@ -811,31 +814,31 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 90;
+ State = 98;
Match(INLINE_LOGIC_START);
- State = 92;
+ State = 100;
ErrorHandler.Sync(this);
switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) {
case 1:
{
- State = 91;
+ State = 99;
Match(WS);
}
break;
}
- State = 94;
+ State = 102;
innerLogic();
- State = 96;
+ State = 104;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==WS) {
{
- State = 95;
+ State = 103;
Match(WS);
}
}
- State = 98;
+ State = 106;
Match(INLINE_LOGIC_END);
}
}
@@ -889,19 +892,19 @@ public partial class InkBlotAntlrGrammarParser : Parser {
try {
EnterOuterAlt(_localctx, 1);
{
- State = 101;
+ State = 109;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==WS) {
{
- State = 100;
+ State = 108;
Match(WS);
}
}
- State = 103;
+ State = 111;
sequenceTypeAnnotation();
- State = 104;
+ State = 112;
innerSequenceObjects();
}
}
@@ -917,17 +920,8 @@ public partial class InkBlotAntlrGrammarParser : Parser {
}
public partial class MultiDivertContext : ParserRuleContext {
- [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode THREAD_ARROW() { return GetToken(InkBlotAntlrGrammarParser.THREAD_ARROW, 0); }
- [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArgumentsContext[] divertIdentifierWithArguments() {
- return GetRuleContexts();
- }
- [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments(int i) {
- return GetRuleContext(i);
- }
- [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TUNNEL_ARROW() { return GetToken(InkBlotAntlrGrammarParser.TUNNEL_ARROW, 0); }
- [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] DIVERT_ARROW() { return GetTokens(InkBlotAntlrGrammarParser.DIVERT_ARROW); }
- [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DIVERT_ARROW(int i) {
- return GetToken(InkBlotAntlrGrammarParser.DIVERT_ARROW, i);
+ [System.Diagnostics.DebuggerNonUserCode] public MultiDivert_withoutWSContext multiDivert_withoutWS() {
+ return GetRuleContext(0);
}
[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS() { return GetToken(InkBlotAntlrGrammarParser.WS, 0); }
public MultiDivertContext(ParserRuleContext parent, int invokingState)
@@ -959,117 +953,305 @@ public partial class InkBlotAntlrGrammarParser : Parser {
EnterRule(_localctx, 22, RULE_multiDivert);
int _la;
try {
- int _alt;
EnterOuterAlt(_localctx, 1);
{
- State = 107;
+ State = 115;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==WS) {
{
- State = 106;
+ State = 114;
Match(WS);
}
}
- State = 138;
+ State = 117;
+ multiDivert_withoutWS();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class MultiDivert_withoutWSContext : ParserRuleContext {
+ public MultiDivert_withoutWSContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_multiDivert_withoutWS; } }
+
+ public MultiDivert_withoutWSContext() { }
+ public virtual void CopyFrom(MultiDivert_withoutWSContext context) {
+ base.CopyFrom(context);
+ }
+ }
+ public partial class MultiDivertArrowsContext : MultiDivert_withoutWSContext {
+ [System.Diagnostics.DebuggerNonUserCode] public MultiDivertArrows_tailContext multiDivertArrows_tail() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] DIVERT_ARROW() { return GetTokens(InkBlotAntlrGrammarParser.DIVERT_ARROW); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DIVERT_ARROW(int i) {
+ return GetToken(InkBlotAntlrGrammarParser.DIVERT_ARROW, i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArgumentsContext[] divertIdentifierWithArguments() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments(int i) {
+ return GetRuleContext(i);
+ }
+ public MultiDivertArrowsContext(MultiDivert_withoutWSContext context) { CopyFrom(context); }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterMultiDivertArrows(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitMultiDivertArrows(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMultiDivertArrows(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+ public partial class MultiDivertThreadContext : MultiDivert_withoutWSContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode THREAD_ARROW() { return GetToken(InkBlotAntlrGrammarParser.THREAD_ARROW, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments() {
+ return GetRuleContext(0);
+ }
+ public MultiDivertThreadContext(MultiDivert_withoutWSContext context) { CopyFrom(context); }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterMultiDivertThread(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitMultiDivertThread(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMultiDivertThread(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public MultiDivert_withoutWSContext multiDivert_withoutWS() {
+ MultiDivert_withoutWSContext _localctx = new MultiDivert_withoutWSContext(Context, State);
+ EnterRule(_localctx, 24, RULE_multiDivert_withoutWS);
+ try {
+ int _alt;
+ State = 129;
ErrorHandler.Sync(this);
- switch ( Interpreter.AdaptivePredict(TokenStream,20,Context) ) {
- case 1:
+ switch (TokenStream.LA(1)) {
+ case THREAD_ARROW:
+ _localctx = new MultiDivertThreadContext(_localctx);
+ EnterOuterAlt(_localctx, 1);
{
- State = 109;
+ State = 119;
Match(THREAD_ARROW);
- State = 110;
+ State = 120;
divertIdentifierWithArguments();
}
break;
- case 2:
+ case DIVERT_ARROW:
+ case TUNNEL_ARROW:
+ _localctx = new MultiDivertArrowsContext(_localctx);
+ EnterOuterAlt(_localctx, 2);
{
- State = 113;
+ State = 125;
ErrorHandler.Sync(this);
- _la = TokenStream.LA(1);
- do {
- {
- {
- State = 111;
- Match(DIVERT_ARROW);
- State = 112;
- divertIdentifierWithArguments();
+ _alt = Interpreter.AdaptivePredict(TokenStream,17,Context);
+ while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ State = 121;
+ Match(DIVERT_ARROW);
+ State = 122;
+ divertIdentifierWithArguments();
+ }
+ }
}
- }
- State = 115;
+ State = 127;
ErrorHandler.Sync(this);
- _la = TokenStream.LA(1);
- } while ( _la==DIVERT_ARROW );
- State = 117;
- Match(TUNNEL_ARROW);
- State = 118;
+ _alt = Interpreter.AdaptivePredict(TokenStream,17,Context);
+ }
+ State = 128;
+ multiDivertArrows_tail();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class MultiDivertArrows_tailContext : ParserRuleContext {
+ public MultiDivertArrows_tailContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_multiDivertArrows_tail; } }
+
+ public MultiDivertArrows_tailContext() { }
+ public virtual void CopyFrom(MultiDivertArrows_tailContext context) {
+ base.CopyFrom(context);
+ }
+ }
+ public partial class MultiDivertArrows_tailTunnelWithReplacementContext : MultiDivertArrows_tailContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TUNNEL_ARROW() { return GetToken(InkBlotAntlrGrammarParser.TUNNEL_ARROW, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments() {
+ return GetRuleContext(0);
+ }
+ public MultiDivertArrows_tailTunnelWithReplacementContext(MultiDivertArrows_tailContext context) { CopyFrom(context); }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterMultiDivertArrows_tailTunnelWithReplacement(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitMultiDivertArrows_tailTunnelWithReplacement(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMultiDivertArrows_tailTunnelWithReplacement(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+ public partial class MultiDivertArrows_tailDivertContext : MultiDivertArrows_tailContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DIVERT_ARROW() { return GetToken(InkBlotAntlrGrammarParser.DIVERT_ARROW, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments() {
+ return GetRuleContext(0);
+ }
+ public MultiDivertArrows_tailDivertContext(MultiDivertArrows_tailContext context) { CopyFrom(context); }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterMultiDivertArrows_tailDivert(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitMultiDivertArrows_tailDivert(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMultiDivertArrows_tailDivert(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+ public partial class MultiDivertArrows_tailTunnelContext : MultiDivertArrows_tailContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TUNNEL_ARROW() { return GetToken(InkBlotAntlrGrammarParser.TUNNEL_ARROW, 0); }
+ public MultiDivertArrows_tailTunnelContext(MultiDivertArrows_tailContext context) { CopyFrom(context); }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterMultiDivertArrows_tailTunnel(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitMultiDivertArrows_tailTunnel(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMultiDivertArrows_tailTunnel(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+ public partial class MultiDivertArrows_tailDefaultChoiceContext : MultiDivertArrows_tailContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DIVERT_ARROW() { return GetToken(InkBlotAntlrGrammarParser.DIVERT_ARROW, 0); }
+ public MultiDivertArrows_tailDefaultChoiceContext(MultiDivertArrows_tailContext context) { CopyFrom(context); }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterMultiDivertArrows_tailDefaultChoice(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitMultiDivertArrows_tailDefaultChoice(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMultiDivertArrows_tailDefaultChoice(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public MultiDivertArrows_tailContext multiDivertArrows_tail() {
+ MultiDivertArrows_tailContext _localctx = new MultiDivertArrows_tailContext(Context, State);
+ EnterRule(_localctx, 26, RULE_multiDivertArrows_tail);
+ try {
+ State = 137;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,19,Context) ) {
+ case 1:
+ _localctx = new MultiDivertArrows_tailDefaultChoiceContext(_localctx);
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 131;
+ Match(DIVERT_ARROW);
+ }
+ break;
+ case 2:
+ _localctx = new MultiDivertArrows_tailDivertContext(_localctx);
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 132;
+ Match(DIVERT_ARROW);
+ State = 133;
divertIdentifierWithArguments();
}
break;
case 3:
+ _localctx = new MultiDivertArrows_tailTunnelWithReplacementContext(_localctx);
+ EnterOuterAlt(_localctx, 3);
{
- State = 122;
- ErrorHandler.Sync(this);
- _la = TokenStream.LA(1);
- do {
- {
- {
- State = 120;
- Match(DIVERT_ARROW);
- State = 121;
- divertIdentifierWithArguments();
- }
- }
- State = 124;
- ErrorHandler.Sync(this);
- _la = TokenStream.LA(1);
- } while ( _la==DIVERT_ARROW );
- State = 126;
+ State = 134;
Match(TUNNEL_ARROW);
+ State = 135;
+ divertIdentifierWithArguments();
}
break;
case 4:
- {
- State = 130;
- ErrorHandler.Sync(this);
- _alt = 1;
- do {
- switch (_alt) {
- case 1:
- {
- {
- State = 128;
- Match(DIVERT_ARROW);
- State = 129;
- divertIdentifierWithArguments();
- }
- }
- break;
- default:
- throw new NoViableAltException(this);
- }
- State = 132;
- ErrorHandler.Sync(this);
- _alt = Interpreter.AdaptivePredict(TokenStream,19,Context);
- } while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER );
- State = 134;
- Match(DIVERT_ARROW);
- }
- break;
- case 5:
+ _localctx = new MultiDivertArrows_tailTunnelContext(_localctx);
+ EnterOuterAlt(_localctx, 4);
{
State = 136;
Match(TUNNEL_ARROW);
}
break;
- case 6:
- {
- State = 137;
- Match(DIVERT_ARROW);
- }
- break;
- }
}
}
catch (RecognitionException re) {
@@ -1084,11 +1266,8 @@ public partial class InkBlotAntlrGrammarParser : Parser {
}
public partial class DivertIdentifierWithArgumentsContext : ParserRuleContext {
- [System.Diagnostics.DebuggerNonUserCode] public IdentifierContext[] identifier() {
- return GetRuleContexts();
- }
- [System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier(int i) {
- return GetRuleContext(i);
+ [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArguments_nameContext divertIdentifierWithArguments_name() {
+ return GetRuleContext(0);
}
[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] WS() { return GetTokens(InkBlotAntlrGrammarParser.WS); }
[System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS(int i) {
@@ -1126,119 +1305,283 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments() {
DivertIdentifierWithArgumentsContext _localctx = new DivertIdentifierWithArgumentsContext(Context, State);
- EnterRule(_localctx, 24, RULE_divertIdentifierWithArguments);
+ EnterRule(_localctx, 28, RULE_divertIdentifierWithArguments);
int _la;
try {
EnterOuterAlt(_localctx, 1);
{
- State = 141;
+ State = 140;
ErrorHandler.Sync(this);
- _la = TokenStream.LA(1);
- if (_la==WS) {
- {
- State = 140;
- Match(WS);
- }
- }
-
- State = 143;
- identifier();
- State = 145;
- ErrorHandler.Sync(this);
- switch ( Interpreter.AdaptivePredict(TokenStream,22,Context) ) {
+ switch ( Interpreter.AdaptivePredict(TokenStream,20,Context) ) {
case 1:
{
- State = 144;
+ State = 139;
Match(WS);
}
break;
}
- State = 157;
+ State = 142;
+ divertIdentifierWithArguments_name();
+ State = 144;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,21,Context) ) {
+ case 1:
+ {
+ State = 143;
+ Match(WS);
+ }
+ break;
+ }
+ State = 160;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
- while (_la==T__0) {
+ if (_la==T__0) {
{
- {
- State = 147;
+ State = 146;
Match(T__0);
- State = 149;
+ State = 147;
+ expression();
+ State = 155;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==T__1) {
+ {
+ {
+ State = 148;
+ Match(T__1);
+ State = 150;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==WS) {
+ {
+ State = 149;
+ Match(WS);
+ }
+ }
+
+ State = 152;
+ expression();
+ }
+ }
+ State = 157;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ State = 158;
+ Match(T__2);
+ }
+ }
+
+ State = 163;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,25,Context) ) {
+ case 1:
+ {
+ State = 162;
+ Match(WS);
+ }
+ break;
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class DivertIdentifierWithArguments_nameContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public IdentifierContext[] identifier() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public IdentifierContext identifier(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] WS() { return GetTokens(InkBlotAntlrGrammarParser.WS); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS(int i) {
+ return GetToken(InkBlotAntlrGrammarParser.WS, i);
+ }
+ public DivertIdentifierWithArguments_nameContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_divertIdentifierWithArguments_name; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterDivertIdentifierWithArguments_name(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitDivertIdentifierWithArguments_name(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitDivertIdentifierWithArguments_name(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public DivertIdentifierWithArguments_nameContext divertIdentifierWithArguments_name() {
+ DivertIdentifierWithArguments_nameContext _localctx = new DivertIdentifierWithArguments_nameContext(Context, State);
+ EnterRule(_localctx, 30, RULE_divertIdentifierWithArguments_name);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 166;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==WS) {
+ {
+ State = 165;
+ Match(WS);
+ }
+ }
+
+ State = 168;
+ identifier();
+ State = 170;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,27,Context) ) {
+ case 1:
+ {
+ State = 169;
+ Match(WS);
+ }
+ break;
+ }
+ State = 182;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==T__3) {
+ {
+ {
+ State = 172;
+ Match(T__3);
+ State = 174;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==WS) {
{
- State = 148;
+ State = 173;
Match(WS);
}
}
- State = 151;
+ State = 176;
identifier();
- State = 153;
+ State = 178;
ErrorHandler.Sync(this);
- switch ( Interpreter.AdaptivePredict(TokenStream,24,Context) ) {
+ switch ( Interpreter.AdaptivePredict(TokenStream,29,Context) ) {
case 1:
{
- State = 152;
+ State = 177;
Match(WS);
}
break;
}
}
}
- State = 159;
+ State = 184;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
}
- State = 161;
- ErrorHandler.Sync(this);
- switch ( Interpreter.AdaptivePredict(TokenStream,26,Context) ) {
- case 1:
- {
- State = 160;
- Match(WS);
- }
- break;
}
- State = 174;
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class DivertIdentifierWithArguments_argumentsContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] WS() { return GetTokens(InkBlotAntlrGrammarParser.WS); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS(int i) {
+ return GetToken(InkBlotAntlrGrammarParser.WS, i);
+ }
+ public DivertIdentifierWithArguments_argumentsContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_divertIdentifierWithArguments_arguments; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void EnterRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.EnterDivertIdentifierWithArguments_arguments(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override void ExitRule(IParseTreeListener listener) {
+ IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
+ if (typedListener != null) typedListener.ExitDivertIdentifierWithArguments_arguments(this);
+ }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitDivertIdentifierWithArguments_arguments(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public DivertIdentifierWithArguments_argumentsContext divertIdentifierWithArguments_arguments() {
+ DivertIdentifierWithArguments_argumentsContext _localctx = new DivertIdentifierWithArguments_argumentsContext(Context, State);
+ EnterRule(_localctx, 32, RULE_divertIdentifierWithArguments_arguments);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 185;
+ Match(T__0);
+ State = 186;
+ expression();
+ State = 194;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
- if (_la==T__1) {
+ while (_la==T__1) {
{
- State = 163;
+ {
+ State = 187;
Match(T__1);
- State = 164;
- expression();
- State = 169;
+ State = 189;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
- while (_la==T__2) {
+ if (_la==WS) {
{
- {
- State = 165;
- Match(T__2);
- State = 166;
- expression();
+ State = 188;
+ Match(WS);
}
- }
- State = 171;
- ErrorHandler.Sync(this);
- _la = TokenStream.LA(1);
}
- State = 172;
- Match(T__3);
- }
- }
- State = 177;
- ErrorHandler.Sync(this);
- switch ( Interpreter.AdaptivePredict(TokenStream,29,Context) ) {
- case 1:
- {
- State = 176;
- Match(WS);
+ State = 191;
+ expression();
}
- break;
+ }
+ State = 196;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
}
+ State = 197;
+ Match(T__2);
}
}
catch (RecognitionException re) {
@@ -1280,11 +1623,11 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public IdentifierContext identifier() {
IdentifierContext _localctx = new IdentifierContext(Context, State);
- EnterRule(_localctx, 26, RULE_identifier);
+ EnterRule(_localctx, 34, RULE_identifier);
try {
EnterOuterAlt(_localctx, 1);
{
- State = 179;
+ State = 199;
Match(IDENTIFIER);
}
}
@@ -1327,11 +1670,11 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public ExpressionContext expression() {
ExpressionContext _localctx = new ExpressionContext(Context, State);
- EnterRule(_localctx, 28, RULE_expression);
+ EnterRule(_localctx, 36, RULE_expression);
try {
EnterOuterAlt(_localctx, 1);
{
- State = 181;
+ State = 201;
Match(IDENTIFIER);
}
}
@@ -1381,57 +1724,57 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public SequenceTypeAnnotationContext sequenceTypeAnnotation() {
SequenceTypeAnnotationContext _localctx = new SequenceTypeAnnotationContext(Context, State);
- EnterRule(_localctx, 30, RULE_sequenceTypeAnnotation);
+ EnterRule(_localctx, 38, RULE_sequenceTypeAnnotation);
try {
- State = 190;
+ State = 210;
ErrorHandler.Sync(this);
switch (TokenStream.LA(1)) {
case SEQUENCE_TYPE_SYMBOL_ANNOTATION:
EnterOuterAlt(_localctx, 1);
{
- State = 183;
+ State = 203;
_localctx.op = Match(SEQUENCE_TYPE_SYMBOL_ANNOTATION);
}
break;
case ONCE:
EnterOuterAlt(_localctx, 2);
{
- State = 184;
+ State = 204;
Match(ONCE);
}
break;
case CYCLE:
EnterOuterAlt(_localctx, 3);
{
- State = 185;
+ State = 205;
Match(CYCLE);
}
break;
case SHUFFLE:
EnterOuterAlt(_localctx, 4);
{
- State = 186;
+ State = 206;
Match(SHUFFLE);
}
break;
case STOPPING:
EnterOuterAlt(_localctx, 5);
{
- State = 187;
+ State = 207;
Match(STOPPING);
}
break;
case SHUFFLE_ONCE:
EnterOuterAlt(_localctx, 6);
{
- State = 188;
+ State = 208;
Match(SHUFFLE_ONCE);
}
break;
case SHUFFLE_STOPPING:
EnterOuterAlt(_localctx, 7);
{
- State = 189;
+ State = 209;
Match(SHUFFLE_STOPPING);
}
break;
@@ -1484,17 +1827,17 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public InnerSequenceObjectsContext innerSequenceObjects() {
InnerSequenceObjectsContext _localctx = new InnerSequenceObjectsContext(Context, State);
- EnterRule(_localctx, 32, RULE_innerSequenceObjects);
+ EnterRule(_localctx, 40, RULE_innerSequenceObjects);
try {
- State = 195;
+ State = 215;
ErrorHandler.Sync(this);
switch (TokenStream.LA(1)) {
case NL:
EnterOuterAlt(_localctx, 1);
{
- State = 192;
+ State = 212;
Match(NL);
- State = 193;
+ State = 213;
innerMultilineSequenceObjects();
}
break;
@@ -1503,7 +1846,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
case INLINE_LOGIC_START:
EnterOuterAlt(_localctx, 2);
{
- State = 194;
+ State = 214;
innerInlineSequenceObjects();
}
break;
@@ -1555,12 +1898,12 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public InnerMultilineSequenceObjectsContext innerMultilineSequenceObjects() {
InnerMultilineSequenceObjectsContext _localctx = new InnerMultilineSequenceObjectsContext(Context, State);
- EnterRule(_localctx, 34, RULE_innerMultilineSequenceObjects);
+ EnterRule(_localctx, 42, RULE_innerMultilineSequenceObjects);
try {
int _alt;
EnterOuterAlt(_localctx, 1);
{
- State = 198;
+ State = 218;
ErrorHandler.Sync(this);
_alt = 1;
do {
@@ -1568,7 +1911,7 @@ public partial class InkBlotAntlrGrammarParser : Parser {
case 1:
{
{
- State = 197;
+ State = 217;
singleMultilineSequenceElement();
}
}
@@ -1576,9 +1919,9 @@ public partial class InkBlotAntlrGrammarParser : Parser {
default:
throw new NoViableAltException(this);
}
- State = 200;
+ State = 220;
ErrorHandler.Sync(this);
- _alt = Interpreter.AdaptivePredict(TokenStream,32,Context);
+ _alt = Interpreter.AdaptivePredict(TokenStream,35,Context);
} while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER );
}
}
@@ -1628,34 +1971,34 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public SingleMultilineSequenceElementContext singleMultilineSequenceElement() {
SingleMultilineSequenceElementContext _localctx = new SingleMultilineSequenceElementContext(Context, State);
- EnterRule(_localctx, 36, RULE_singleMultilineSequenceElement);
+ EnterRule(_localctx, 44, RULE_singleMultilineSequenceElement);
int _la;
try {
EnterOuterAlt(_localctx, 1);
{
- State = 203;
+ State = 223;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==WS) {
{
- State = 202;
+ State = 222;
Match(WS);
}
}
- State = 205;
+ State = 225;
Match(T__4);
- State = 207;
+ State = 227;
ErrorHandler.Sync(this);
- switch ( Interpreter.AdaptivePredict(TokenStream,34,Context) ) {
+ switch ( Interpreter.AdaptivePredict(TokenStream,37,Context) ) {
case 1:
{
- State = 206;
+ State = 226;
Match(WS);
}
break;
}
- State = 211;
+ State = 231;
ErrorHandler.Sync(this);
switch (TokenStream.LA(1)) {
case WS:
@@ -1664,13 +2007,13 @@ public partial class InkBlotAntlrGrammarParser : Parser {
case DIVERT_ARROW:
case TUNNEL_ARROW:
{
- State = 209;
+ State = 229;
innerBlockLevelStatements();
}
break;
case MULTILINE_WS:
{
- State = 210;
+ State = 230;
Match(MULTILINE_WS);
}
break;
@@ -1723,10 +2066,10 @@ public partial class InkBlotAntlrGrammarParser : Parser {
[RuleVersion(0)]
public InnerInlineSequenceObjectsContext innerInlineSequenceObjects() {
InnerInlineSequenceObjectsContext _localctx = new InnerInlineSequenceObjectsContext(Context, State);
- EnterRule(_localctx, 38, RULE_innerInlineSequenceObjects);
+ EnterRule(_localctx, 46, RULE_innerInlineSequenceObjects);
int _la;
try {
- State = 231;
+ State = 251;
ErrorHandler.Sync(this);
switch (TokenStream.LA(1)) {
case CONTENT_TEXT_NO_ESCAPE_SIMPLE:
@@ -1734,29 +2077,29 @@ public partial class InkBlotAntlrGrammarParser : Parser {
EnterOuterAlt(_localctx, 1);
{
{
- State = 213;
+ State = 233;
mixedTextAndLogic();
- State = 220;
+ State = 240;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
while (_la==T__5) {
{
{
- State = 214;
+ State = 234;
Match(T__5);
- State = 216;
+ State = 236;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START) {
{
- State = 215;
+ State = 235;
mixedTextAndLogic();
}
}
}
}
- State = 222;
+ State = 242;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
}
@@ -1766,27 +2109,27 @@ public partial class InkBlotAntlrGrammarParser : Parser {
case T__5:
EnterOuterAlt(_localctx, 2);
{
- State = 227;
+ State = 247;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
do {
{
{
- State = 223;
+ State = 243;
Match(T__5);
- State = 225;
+ State = 245;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
if (_la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START) {
{
- State = 224;
+ State = 244;
mixedTextAndLogic();
}
}
}
}
- State = 229;
+ State = 249;
ErrorHandler.Sync(this);
_la = TokenStream.LA(1);
} while ( _la==T__5 );
@@ -1808,86 +2151,92 @@ public partial class InkBlotAntlrGrammarParser : Parser {
}
private static int[] _serializedATN = {
- 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,
+ 4,1,23,254,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
+ 2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,
+ 2,22,7,22,2,23,7,23,1,0,1,0,1,1,4,1,52,8,1,11,1,12,1,53,1,2,1,2,3,2,58,
+ 8,2,1,3,1,3,4,3,62,8,3,11,3,12,3,63,1,4,1,4,4,4,68,8,4,11,4,12,4,69,1,
+ 5,1,5,4,5,74,8,5,11,5,12,5,75,1,6,1,6,1,7,3,7,81,8,7,1,7,3,7,84,8,7,1,
+ 7,1,7,1,7,3,7,89,8,7,4,7,91,8,7,11,7,12,7,92,1,7,1,7,1,8,1,8,1,9,1,9,3,
+ 9,101,8,9,1,9,1,9,3,9,105,8,9,1,9,1,9,1,10,3,10,110,8,10,1,10,1,10,1,10,
+ 1,11,3,11,116,8,11,1,11,1,11,1,12,1,12,1,12,1,12,5,12,124,8,12,10,12,12,
+ 12,127,9,12,1,12,3,12,130,8,12,1,13,1,13,1,13,1,13,1,13,1,13,3,13,138,
+ 8,13,1,14,3,14,141,8,14,1,14,1,14,3,14,145,8,14,1,14,1,14,1,14,1,14,3,
+ 14,151,8,14,1,14,5,14,154,8,14,10,14,12,14,157,9,14,1,14,1,14,3,14,161,
+ 8,14,1,14,3,14,164,8,14,1,15,3,15,167,8,15,1,15,1,15,3,15,171,8,15,1,15,
+ 1,15,3,15,175,8,15,1,15,1,15,3,15,179,8,15,5,15,181,8,15,10,15,12,15,184,
+ 9,15,1,16,1,16,1,16,1,16,3,16,190,8,16,1,16,5,16,193,8,16,10,16,12,16,
+ 196,9,16,1,16,1,16,1,17,1,17,1,18,1,18,1,19,1,19,1,19,1,19,1,19,1,19,1,
+ 19,3,19,211,8,19,1,20,1,20,1,20,3,20,216,8,20,1,21,4,21,219,8,21,11,21,
+ 12,21,220,1,22,3,22,224,8,22,1,22,1,22,3,22,228,8,22,1,22,1,22,3,22,232,
+ 8,22,1,23,1,23,1,23,3,23,237,8,23,5,23,239,8,23,10,23,12,23,242,9,23,1,
+ 23,1,23,3,23,246,8,23,4,23,248,8,23,11,23,12,23,249,3,23,252,8,23,1,23,
+ 0,0,24,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,
+ 46,0,0,280,0,48,1,0,0,0,2,51,1,0,0,0,4,57,1,0,0,0,6,61,1,0,0,0,8,67,1,
+ 0,0,0,10,73,1,0,0,0,12,77,1,0,0,0,14,80,1,0,0,0,16,96,1,0,0,0,18,98,1,
+ 0,0,0,20,109,1,0,0,0,22,115,1,0,0,0,24,129,1,0,0,0,26,137,1,0,0,0,28,140,
+ 1,0,0,0,30,166,1,0,0,0,32,185,1,0,0,0,34,199,1,0,0,0,36,201,1,0,0,0,38,
+ 210,1,0,0,0,40,215,1,0,0,0,42,218,1,0,0,0,44,223,1,0,0,0,46,251,1,0,0,
+ 0,48,49,3,2,1,0,49,1,1,0,0,0,50,52,3,4,2,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,3,1,0,0,0,55,58,3,22,11,0,56,58,3,12,6,
+ 0,57,55,1,0,0,0,57,56,1,0,0,0,58,5,1,0,0,0,59,62,3,12,6,0,60,62,3,22,11,
+ 0,61,59,1,0,0,0,61,60,1,0,0,0,62,63,1,0,0,0,63,61,1,0,0,0,63,64,1,0,0,
+ 0,64,7,1,0,0,0,65,68,3,12,6,0,66,68,3,22,11,0,67,65,1,0,0,0,67,66,1,0,
+ 0,0,68,69,1,0,0,0,69,67,1,0,0,0,69,70,1,0,0,0,70,9,1,0,0,0,71,74,3,12,
+ 6,0,72,74,3,22,11,0,73,71,1,0,0,0,73,72,1,0,0,0,74,75,1,0,0,0,75,73,1,
+ 0,0,0,75,76,1,0,0,0,76,11,1,0,0,0,77,78,5,10,0,0,78,13,1,0,0,0,79,81,3,
+ 12,6,0,80,79,1,0,0,0,80,81,1,0,0,0,81,90,1,0,0,0,82,84,3,16,8,0,83,82,
+ 1,0,0,0,83,84,1,0,0,0,84,85,1,0,0,0,85,91,3,12,6,0,86,88,3,16,8,0,87,89,
+ 3,12,6,0,88,87,1,0,0,0,88,89,1,0,0,0,89,91,1,0,0,0,90,83,1,0,0,0,90,86,
+ 1,0,0,0,91,92,1,0,0,0,92,90,1,0,0,0,92,93,1,0,0,0,93,94,1,0,0,0,94,95,
+ 3,22,11,0,95,15,1,0,0,0,96,97,3,18,9,0,97,17,1,0,0,0,98,100,5,11,0,0,99,
+ 101,5,7,0,0,100,99,1,0,0,0,100,101,1,0,0,0,101,102,1,0,0,0,102,104,3,20,
+ 10,0,103,105,5,7,0,0,104,103,1,0,0,0,104,105,1,0,0,0,105,106,1,0,0,0,106,
+ 107,5,12,0,0,107,19,1,0,0,0,108,110,5,7,0,0,109,108,1,0,0,0,109,110,1,
+ 0,0,0,110,111,1,0,0,0,111,112,3,38,19,0,112,113,3,40,20,0,113,21,1,0,0,
+ 0,114,116,5,7,0,0,115,114,1,0,0,0,115,116,1,0,0,0,116,117,1,0,0,0,117,
+ 118,3,24,12,0,118,23,1,0,0,0,119,120,5,20,0,0,120,130,3,28,14,0,121,122,
+ 5,21,0,0,122,124,3,28,14,0,123,121,1,0,0,0,124,127,1,0,0,0,125,123,1,0,
+ 0,0,125,126,1,0,0,0,126,128,1,0,0,0,127,125,1,0,0,0,128,130,3,26,13,0,
+ 129,119,1,0,0,0,129,125,1,0,0,0,130,25,1,0,0,0,131,138,5,21,0,0,132,133,
+ 5,21,0,0,133,138,3,28,14,0,134,135,5,22,0,0,135,138,3,28,14,0,136,138,
+ 5,22,0,0,137,131,1,0,0,0,137,132,1,0,0,0,137,134,1,0,0,0,137,136,1,0,0,
+ 0,138,27,1,0,0,0,139,141,5,7,0,0,140,139,1,0,0,0,140,141,1,0,0,0,141,142,
+ 1,0,0,0,142,144,3,30,15,0,143,145,5,7,0,0,144,143,1,0,0,0,144,145,1,0,
+ 0,0,145,160,1,0,0,0,146,147,5,1,0,0,147,155,3,36,18,0,148,150,5,2,0,0,
+ 149,151,5,7,0,0,150,149,1,0,0,0,150,151,1,0,0,0,151,152,1,0,0,0,152,154,
+ 3,36,18,0,153,148,1,0,0,0,154,157,1,0,0,0,155,153,1,0,0,0,155,156,1,0,
+ 0,0,156,158,1,0,0,0,157,155,1,0,0,0,158,159,5,3,0,0,159,161,1,0,0,0,160,
+ 146,1,0,0,0,160,161,1,0,0,0,161,163,1,0,0,0,162,164,5,7,0,0,163,162,1,
+ 0,0,0,163,164,1,0,0,0,164,29,1,0,0,0,165,167,5,7,0,0,166,165,1,0,0,0,166,
+ 167,1,0,0,0,167,168,1,0,0,0,168,170,3,34,17,0,169,171,5,7,0,0,170,169,
+ 1,0,0,0,170,171,1,0,0,0,171,182,1,0,0,0,172,174,5,4,0,0,173,175,5,7,0,
+ 0,174,173,1,0,0,0,174,175,1,0,0,0,175,176,1,0,0,0,176,178,3,34,17,0,177,
+ 179,5,7,0,0,178,177,1,0,0,0,178,179,1,0,0,0,179,181,1,0,0,0,180,172,1,
+ 0,0,0,181,184,1,0,0,0,182,180,1,0,0,0,182,183,1,0,0,0,183,31,1,0,0,0,184,
+ 182,1,0,0,0,185,186,5,1,0,0,186,194,3,36,18,0,187,189,5,2,0,0,188,190,
+ 5,7,0,0,189,188,1,0,0,0,189,190,1,0,0,0,190,191,1,0,0,0,191,193,3,36,18,
+ 0,192,187,1,0,0,0,193,196,1,0,0,0,194,192,1,0,0,0,194,195,1,0,0,0,195,
+ 197,1,0,0,0,196,194,1,0,0,0,197,198,5,3,0,0,198,33,1,0,0,0,199,200,5,23,
+ 0,0,200,35,1,0,0,0,201,202,5,23,0,0,202,37,1,0,0,0,203,211,5,13,0,0,204,
+ 211,5,14,0,0,205,211,5,15,0,0,206,211,5,16,0,0,207,211,5,17,0,0,208,211,
+ 5,18,0,0,209,211,5,19,0,0,210,203,1,0,0,0,210,204,1,0,0,0,210,205,1,0,
+ 0,0,210,206,1,0,0,0,210,207,1,0,0,0,210,208,1,0,0,0,210,209,1,0,0,0,211,
+ 39,1,0,0,0,212,213,5,8,0,0,213,216,3,42,21,0,214,216,3,46,23,0,215,212,
+ 1,0,0,0,215,214,1,0,0,0,216,41,1,0,0,0,217,219,3,44,22,0,218,217,1,0,0,
+ 0,219,220,1,0,0,0,220,218,1,0,0,0,220,221,1,0,0,0,221,43,1,0,0,0,222,224,
+ 5,7,0,0,223,222,1,0,0,0,223,224,1,0,0,0,224,225,1,0,0,0,225,227,5,5,0,
+ 0,226,228,5,7,0,0,227,226,1,0,0,0,227,228,1,0,0,0,228,231,1,0,0,0,229,
+ 232,3,10,5,0,230,232,5,9,0,0,231,229,1,0,0,0,231,230,1,0,0,0,232,45,1,
+ 0,0,0,233,240,3,14,7,0,234,236,5,6,0,0,235,237,3,14,7,0,236,235,1,0,0,
+ 0,236,237,1,0,0,0,237,239,1,0,0,0,238,234,1,0,0,0,239,242,1,0,0,0,240,
+ 238,1,0,0,0,240,241,1,0,0,0,241,252,1,0,0,0,242,240,1,0,0,0,243,245,5,
+ 6,0,0,244,246,3,14,7,0,245,244,1,0,0,0,245,246,1,0,0,0,246,248,1,0,0,0,
+ 247,243,1,0,0,0,248,249,1,0,0,0,249,247,1,0,0,0,249,250,1,0,0,0,250,252,
+ 1,0,0,0,251,233,1,0,0,0,251,247,1,0,0,0,252,47,1,0,0,0,44,53,57,61,63,
+ 67,69,73,75,80,83,88,90,92,100,104,109,115,125,129,137,140,144,150,155,
+ 160,163,166,170,174,178,182,189,194,210,215,220,223,227,231,236,240,245,
+ 249,251
};
public static readonly ATN _ATN =
diff --git a/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs b/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs
index 7e4b7be..fce10ec 100644
--- a/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs
+++ b/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
+// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
// Unreachable code detected
#pragma warning disable 0162
@@ -104,12 +104,66 @@ public interface IInkBlotAntlrGrammarVisitor : IParseTreeVisitor
/// The visitor result.
Result VisitMultiDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertContext context);
///
+ /// Visit a parse tree produced by the MultiDivertThread
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitMultiDivertThread([NotNull] InkBlotAntlrGrammarParser.MultiDivertThreadContext context);
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitMultiDivertArrows([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrowsContext context);
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailDefaultChoice
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitMultiDivertArrows_tailDefaultChoice([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDefaultChoiceContext context);
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailDivert
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitMultiDivertArrows_tailDivert([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailDivertContext context);
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailTunnelWithReplacement
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitMultiDivertArrows_tailTunnelWithReplacement([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelWithReplacementContext context);
+ ///
+ /// Visit a parse tree produced by the MultiDivertArrows_tailTunnel
+ /// labeled alternative in .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitMultiDivertArrows_tailTunnel([NotNull] InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelContext context);
+ ///
/// Visit a parse tree produced by .
///
/// The parse tree.
/// The visitor result.
Result VisitDivertIdentifierWithArguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArgumentsContext context);
///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitDivertIdentifierWithArguments_name([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext context);
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ Result VisitDivertIdentifierWithArguments_arguments([NotNull] InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_argumentsContext context);
+ ///
/// Visit a parse tree produced by .
///
/// The parse tree.
diff --git a/InkBlot/Helpers.cs b/InkBlot/Helpers.cs
new file mode 100644
index 0000000..62a7e9a
--- /dev/null
+++ b/InkBlot/Helpers.cs
@@ -0,0 +1,18 @@
+using System.Diagnostics;
+
+namespace InkBlot;
+
+public static class Helpers
+{
+ public static T AsNotNull(this T? value) where T : struct
+ {
+ Debug.Assert(value.HasValue);
+ return value.Value;
+ }
+
+ public static T AsNotNull(this T? value) where T : class
+ {
+ Debug.Assert(value != null);
+ return value;
+ }
+}
\ No newline at end of file
diff --git a/InkBlot/InkBlot.csproj b/InkBlot/InkBlot.csproj
index 994ed32..84b0cd1 100644
--- a/InkBlot/InkBlot.csproj
+++ b/InkBlot/InkBlot.csproj
@@ -8,6 +8,9 @@
+
+
+
diff --git a/InkBlot/InkBlotAntlrGrammar.g4 b/InkBlot/InkBlotAntlrGrammar.g4
index 66d0871..d05863c 100644
--- a/InkBlot/InkBlotAntlrGrammar.g4
+++ b/InkBlot/InkBlotAntlrGrammar.g4
@@ -17,8 +17,8 @@ topLevelStatements:
;
topLevelStatement:
- contentText
- | multiDivert
+ multiDivert
+ | contentText
;
knotLevelStatements:
@@ -63,7 +63,7 @@ inlineLogic:
INLINE_LOGIC_START
WS?
innerLogic
- // TODO: += and -= are disabled here (don't know why)
+ // TODO: += and -= are disabled here (don't know why, maybe because they're statements?)
WS?
INLINE_LOGIC_END
// TODO: tags ftw
@@ -77,28 +77,47 @@ innerLogic:
multiDivert:
WS?
- (
- THREAD_ARROW divertIdentifierWithArguments
- // here be dragons: trying to express the various "Possible patterns" of InkParser_Divert => MultiDivert
- | (DIVERT_ARROW divertIdentifierWithArguments)+ TUNNEL_ARROW divertIdentifierWithArguments
- | (DIVERT_ARROW divertIdentifierWithArguments)+ TUNNEL_ARROW
- | (DIVERT_ARROW divertIdentifierWithArguments)+ DIVERT_ARROW
- | TUNNEL_ARROW
- | DIVERT_ARROW // TODO: this is only valid in default choices ( https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#fallback-choices )
- )
+ multiDivert_withoutWS
;
+multiDivert_withoutWS:
+ THREAD_ARROW divertIdentifierWithArguments # MultiDivertThread
+ // here be dragons: trying to express the various "Possible patterns" of InkParser_Divert => MultiDivert
+ // syntax in the original ink parser is overly concessive: https://discord.com/channels/329929050866843648/329929390358265857/1342130940981284945
+ | (DIVERT_ARROW divertIdentifierWithArguments)* multiDivertArrows_tail # MultiDivertArrows
+ // TODO: a single DIVERT_ARROW above is only valid in default choices ( https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#fallback-choices )
+ // TODO: tags ftw
+ ;
+
+multiDivertArrows_tail:
+ DIVERT_ARROW # MultiDivertArrows_tailDefaultChoice
+ | DIVERT_ARROW divertIdentifierWithArguments # MultiDivertArrows_tailDivert
+ | TUNNEL_ARROW divertIdentifierWithArguments # MultiDivertArrows_tailTunnelWithReplacement
+ | TUNNEL_ARROW # MultiDivertArrows_tailTunnel
+ ;
+
divertIdentifierWithArguments:
- WS? identifier WS? ('.' WS? identifier WS? )*
+ WS?
+ divertIdentifierWithArguments_name
WS?
(
'('
- expression (',' expression)*
+ expression (',' WS? expression)*
')'
)?
WS?
;
+divertIdentifierWithArguments_name:
+ WS? identifier WS? ('.' WS? identifier WS? )*
+ ;
+
+divertIdentifierWithArguments_arguments:
+ '('
+ expression (',' WS? expression)*
+ ')'
+ ;
+
identifier:
// TODO: reject numbers-only identifier - see InkParser_Logic => Identifier
IDENTIFIER
diff --git a/InkBlot/InkBlotAntlrLexer.g4 b/InkBlot/InkBlotAntlrLexer.g4
index 3bfc3be..529bf83 100644
--- a/InkBlot/InkBlotAntlrLexer.g4
+++ b/InkBlot/InkBlotAntlrLexer.g4
@@ -17,13 +17,13 @@ CONTENT_TEXT_NO_ESCAPE_SIMPLE:
// - \n\r ==> a new line of content
// - # ==> a tag
// - \, < and - with exceptions (see below)
- ~[{}|\n\r\\#-<]
+ ~[{}|\n\r\\#-< ]
// any character can be escaped
| '\\' [\u0000-\uFFFF] // TODO: is there a better way to say "any character"?
// accept a - only if not followed by a > (->, a divert)
| '-' { InputStream.LA(1) != '>' }?
// same for threads (<-) and glue (<>)
- | '<' { InputStream.LA(1) != '-' && InputStream.LA(1) != '>' }?
+// | '<' { InputStream.LA(1) != '-' && InputStream.LA(1) != '>' }?
)+ ;
INLINE_LOGIC_START: '{' ;
diff --git a/InkBlot/InkBlotParser.cs b/InkBlot/InkBlotParser.cs
index 2465120..3f4bfd7 100644
--- a/InkBlot/InkBlotParser.cs
+++ b/InkBlot/InkBlotParser.cs
@@ -3,20 +3,17 @@ using Antlr4.Runtime.Atn;
using Antlr4.Runtime.Tree;
using InkBlot.ParseHierarchy;
using InkBlot.Visitor;
+using Microsoft.Extensions.Logging;
namespace InkBlot;
public class InkBlotParser
{
- public (Story, IEnumerable) Parse(IFileReader fileReader, string mainFileName)
+ public static (Story, IEnumerable) Parse(IFileReader fileReader, ILoggerFactory loggerFactory,
+ string mainFileName)
{
- var stream = fileReader.GetContents(mainFileName);
- var inputStream = new AntlrInputStream(stream);
- var lexer = new InkBlotAntlrGrammarLexer(inputStream);
- var lexerErrorListener = new LexerErrorListener();
- lexer.RemoveErrorListeners();
- lexer.AddErrorListener(lexerErrorListener);
- var tokens = new CommonTokenStream(lexer);
+ var tokens = GetTokenStream(fileReader, mainFileName, out var lexerErrorListener);
+
var parser = new InkBlotAntlrGrammarParser(tokens);
var parserErrorListener = new ParserErrorListener();
parser.RemoveErrorListeners();
@@ -26,9 +23,27 @@ public class InkBlotParser
parser.Interpreter.PredictionMode = PredictionMode.LL_EXACT_AMBIG_DETECTION;
#endif
var tree = parser.story();
- var listener = new Listener();
+ var listener = new Listener(loggerFactory.CreateLogger());
var walker = new ParseTreeWalker();
walker.Walk(listener, tree);
return (listener.Story, lexerErrorListener.Diagnostics.Concat(parserErrorListener.Diagnostics));
}
+
+ private static CommonTokenStream GetTokenStream(IFileReader fileReader, string mainFileName,
+ out LexerErrorListener lexerErrorListener)
+ {
+ var stream = fileReader.GetContents(mainFileName);
+ var inputStream = new AntlrInputStream(stream);
+ var lexer = new InkBlotAntlrGrammarLexer(inputStream);
+ lexerErrorListener = new LexerErrorListener();
+ lexer.RemoveErrorListeners();
+ lexer.AddErrorListener(lexerErrorListener);
+ var tokens = new CommonTokenStream(lexer);
+ return tokens;
+ }
+
+ public static CommonTokenStream GetTokenStream(IFileReader fileReader, string mainFileName)
+ {
+ return GetTokenStream(fileReader, mainFileName, out _);
+ }
}
\ No newline at end of file
diff --git a/InkBlot/ParseHierarchy/Content.cs b/InkBlot/ParseHierarchy/Content.cs
index 7b13474..f0adbed 100644
--- a/InkBlot/ParseHierarchy/Content.cs
+++ b/InkBlot/ParseHierarchy/Content.cs
@@ -1,3 +1,3 @@
namespace InkBlot.ParseHierarchy;
-public record Content(string Text) : StoryNode;
\ No newline at end of file
+public record Content(string Text) : IStoryNode;
\ No newline at end of file
diff --git a/InkBlot/ParseHierarchy/StoryNode.cs b/InkBlot/ParseHierarchy/IStoryNode.cs
similarity index 78%
rename from InkBlot/ParseHierarchy/StoryNode.cs
rename to InkBlot/ParseHierarchy/IStoryNode.cs
index 100aec2..a9468fa 100644
--- a/InkBlot/ParseHierarchy/StoryNode.cs
+++ b/InkBlot/ParseHierarchy/IStoryNode.cs
@@ -3,4 +3,4 @@
///
/// Any node in the parsed story
///
-public record StoryNode;
\ No newline at end of file
+public interface IStoryNode;
\ No newline at end of file
diff --git a/InkBlot/ParseHierarchy/MultiDivert.cs b/InkBlot/ParseHierarchy/MultiDivert.cs
index 0711c25..fc96d1f 100644
--- a/InkBlot/ParseHierarchy/MultiDivert.cs
+++ b/InkBlot/ParseHierarchy/MultiDivert.cs
@@ -1,3 +1,27 @@
-namespace InkBlot.ParseHierarchy;
+using OneOf;
-public record MultiDivert : StoryNode;
\ No newline at end of file
+namespace InkBlot.ParseHierarchy;
+
+[GenerateOneOf]
+public partial class
+ MultiDivert : OneOfBase,
+ IStoryNode
+{
+}
+
+public record Identifier(string[] Elements /* TODO: expressions */);
+
+// <- thread_name
+public record ThreadDivert(Identifier Identifier) : IStoryNode;
+
+// -> ... ->-> // return from tunnel
+// or
+// -> ... ->-> tunnelReplacement // return from tunnel, but replace destination
+public record DivertsListWithReturnFromTunnel(Identifier[] Identifiers, Identifier? TunnelReplacement)
+ : IStoryNode;
+
+// -> ... -> div // not a tunnel
+// or
+// -> ... -> div -> // is tunnel
+public record DivertsListWithoutReturnFromTunnel(Identifier[] Identifiers, bool IsTunnel)
+ : IStoryNode;
\ No newline at end of file
diff --git a/InkBlot/ParseHierarchy/Story.cs b/InkBlot/ParseHierarchy/Story.cs
index 1aa5c61..acde0b5 100644
--- a/InkBlot/ParseHierarchy/Story.cs
+++ b/InkBlot/ParseHierarchy/Story.cs
@@ -1,3 +1,3 @@
namespace InkBlot.ParseHierarchy;
-public record Story(IEnumerable StoryNodes) : StoryNode;
\ No newline at end of file
+public record Story(IEnumerable StoryNodes) : IStoryNode;
\ No newline at end of file
diff --git a/InkBlot/Visitor/Listener.cs b/InkBlot/Visitor/Listener.cs
index 802836e..d64d105 100644
--- a/InkBlot/Visitor/Listener.cs
+++ b/InkBlot/Visitor/Listener.cs
@@ -1,5 +1,7 @@
-namespace InkBlot.Visitor;
+using Microsoft.Extensions.Logging;
-public partial class Listener : InkBlotAntlrGrammarBaseListener
+namespace InkBlot.Visitor;
+
+public partial class Listener(ILogger Logger) : InkBlotAntlrGrammarBaseListener
{
}
\ No newline at end of file
diff --git a/InkBlot/Visitor/ListenerContentText.cs b/InkBlot/Visitor/ListenerContentText.cs
index 89fa0f1..a838935 100644
--- a/InkBlot/Visitor/ListenerContentText.cs
+++ b/InkBlot/Visitor/ListenerContentText.cs
@@ -1,23 +1,15 @@
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 Regex _escapeRegex = MyRegex();
[GeneratedRegex(@"\\(.)")]
private static partial Regex MyRegex();
- private Content GetContentText(InkBlotAntlrGrammarParser.ContentTextContext context)
- {
- return _contentTextValue.Get(context);
- }
-
public override void ExitContentText(InkBlotAntlrGrammarParser.ContentTextContext context)
{
// escape sequences are captured by this node, but not interpreted
@@ -30,6 +22,6 @@ public partial class Listener
var content = _escapeRegex.Replace(contentWithEscapes, match => match.Groups[1].Value);
// save the result
- _contentTextValue.Put(context, new Content(content));
+ PutStoryNode(context, new Content(content));
}
}
\ No newline at end of file
diff --git a/InkBlot/Visitor/ListenerMultiDivert.cs b/InkBlot/Visitor/ListenerMultiDivert.cs
index 6f6b1e2..71a4a07 100644
--- a/InkBlot/Visitor/ListenerMultiDivert.cs
+++ b/InkBlot/Visitor/ListenerMultiDivert.cs
@@ -1,19 +1,97 @@
using Antlr4.Runtime.Tree;
using InkBlot.ParseHierarchy;
+using Microsoft.Extensions.Logging;
namespace InkBlot.Visitor;
+internal record MultiDivertArrowsTail(bool LastArrowIsDivert, Identifier? Identifier);
+
public partial class Listener
{
- private readonly ParseTreeProperty _multiDivertValues = new();
+ private readonly ParseTreeProperty _multiDiverts = new();
- private MultiDivert GetMultiDivert(InkBlotAntlrGrammarParser.MultiDivertContext context)
+ private readonly ParseTreeProperty _multiDivertsArrowsTail = new();
+
+ public override void ExitMultiDivertThread(InkBlotAntlrGrammarParser.MultiDivertThreadContext context)
{
- return _multiDivertValues.Get(context);
+ var threadDivert = new ThreadDivert(
+ _divertIdentifiers.Get(context.divertIdentifierWithArguments()));
+ _multiDiverts.Put(context.Parent, threadDivert);
}
- public override void ExitMultiDivert(InkBlotAntlrGrammarParser.MultiDivertContext context)
+ public override void ExitMultiDivertArrows(InkBlotAntlrGrammarParser.MultiDivertArrowsContext context)
{
- _multiDivertValues.Put(context, new MultiDivert());
+ var divertIdentifiers = context
+ .divertIdentifierWithArguments()
+ .Select(a => _divertIdentifiers.Get(a));
+ var tail = _multiDivertsArrowsTail.Get(context.multiDivertArrows_tail());
+ _multiDiverts.Put(context,
+ tail.LastArrowIsDivert
+ ? new DivertsListWithoutReturnFromTunnel(
+ (tail.Identifier != null ? divertIdentifiers.Append(tail.Identifier) : divertIdentifiers).ToArray(),
+ tail.LastArrowIsDivert)
+ : new DivertsListWithReturnFromTunnel(
+ divertIdentifiers.ToArray(),
+ tail.Identifier
+ ));
}
+
+ public override void ExitMultiDivertArrows_tailDefaultChoice(
+ InkBlotAntlrGrammarParser.MultiDivertArrows_tailDefaultChoiceContext context)
+ {
+ _multiDivertsArrowsTail.Put(context.Parent, new MultiDivertArrowsTail(true, null));
+ }
+
+ public override void ExitMultiDivertArrows_tailDivert(
+ InkBlotAntlrGrammarParser.MultiDivertArrows_tailDivertContext context)
+ {
+ _multiDivertsArrowsTail.Put(context.Parent, new MultiDivertArrowsTail(true,
+ _divertIdentifiers.Get(context.divertIdentifierWithArguments())));
+ }
+
+ public override void ExitMultiDivertArrows_tailTunnelWithReplacement(
+ InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelWithReplacementContext context)
+ {
+ _multiDivertsArrowsTail.Put(context.Parent, new MultiDivertArrowsTail(false,
+ _divertIdentifiers.Get(context.divertIdentifierWithArguments())));
+ }
+
+ public override void ExitMultiDivertArrows_tailTunnel(
+ InkBlotAntlrGrammarParser.MultiDivertArrows_tailTunnelContext context)
+ {
+ _multiDivertsArrowsTail.Put(context.Parent, new MultiDivertArrowsTail(false, null));
+ }
+
+ #region divertIdentifierWithArguments_name
+
+ private readonly ParseTreeProperty _divertIdentifierNames = new();
+
+ public override void ExitDivertIdentifierWithArguments_name(
+ InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext context)
+ {
+ var name = context.identifier().Select(identifier => identifier.ToString().AsNotNull()).ToArray();
+ _divertIdentifierNames.Put(context.Parent, name);
+ }
+
+ #endregion
+
+ #region divertIdentifierWithArguments
+
+ private readonly ParseTreeProperty _divertIdentifiers = new();
+
+ public override void ExitDivertIdentifierWithArguments(
+ InkBlotAntlrGrammarParser.DivertIdentifierWithArgumentsContext context)
+ {
+ var c = context.divertIdentifierWithArguments_name();
+ if (c == null)
+ {
+ Logger.LogWarning("found ExitDivertIdentifierWithArguments without name");
+ return;
+ }
+
+ var name = _divertIdentifierNames.Get(c);
+ _divertIdentifiers.Put(context, new Identifier(name));
+ }
+
+ #endregion
}
\ No newline at end of file
diff --git a/InkBlot/Visitor/ListenerStory.cs b/InkBlot/Visitor/ListenerStory.cs
index 80feda6..1f1f38b 100644
--- a/InkBlot/Visitor/ListenerStory.cs
+++ b/InkBlot/Visitor/ListenerStory.cs
@@ -13,15 +13,7 @@ public partial class Listener
var storyNodes = context
.topLevelStatements()
.topLevelStatement()
- .Select(topLevelStatement =>
- topLevelStatement.children.Single() switch
- {
- InkBlotAntlrGrammarParser.ContentTextContext contentTextContext =>
- (StoryNode)GetContentText(contentTextContext),
- InkBlotAntlrGrammarParser.MultiDivertContext multiDivertContext =>
- GetMultiDivert(multiDivertContext),
- _ => throw new InvalidOperationException()
- });
+ .Select(topLevelStatement => GetStoryNode(topLevelStatement.children.Single()));
_story = new Story(storyNodes);
}
}
\ No newline at end of file
diff --git a/InkBlot/Visitor/ListenerStoryNode.cs b/InkBlot/Visitor/ListenerStoryNode.cs
new file mode 100644
index 0000000..98a75ca
--- /dev/null
+++ b/InkBlot/Visitor/ListenerStoryNode.cs
@@ -0,0 +1,19 @@
+using Antlr4.Runtime.Tree;
+using InkBlot.ParseHierarchy;
+
+namespace InkBlot.Visitor;
+
+public partial class Listener
+{
+ private readonly ParseTreeProperty _storyNodeValue = new();
+
+ private void PutStoryNode(IParseTree tree, IStoryNode storyNode)
+ {
+ _storyNodeValue.Put(tree, storyNode);
+ }
+
+ private IStoryNode GetStoryNode(IParseTree tree)
+ {
+ return _storyNodeValue.Get(tree);
+ }
+}
\ No newline at end of file
diff --git a/InkBlotTestConsoleApp/InkBlotTestConsoleApp.csproj b/InkBlotTestConsoleApp/InkBlotTestConsoleApp.csproj
index 030eedb..f37bfcf 100644
--- a/InkBlotTestConsoleApp/InkBlotTestConsoleApp.csproj
+++ b/InkBlotTestConsoleApp/InkBlotTestConsoleApp.csproj
@@ -11,4 +11,8 @@
+
+
+
+
diff --git a/InkBlotTestConsoleApp/Program.cs b/InkBlotTestConsoleApp/Program.cs
index e654633..f1b06b3 100644
--- a/InkBlotTestConsoleApp/Program.cs
+++ b/InkBlotTestConsoleApp/Program.cs
@@ -2,12 +2,15 @@
using System.Text;
using InkBlot;
+using Microsoft.Extensions.Logging;
+
+var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
var parser = new InkBlotParser();
-parser.Parse(new PreMadeFileReader(new Dictionary
+InkBlotParser.Parse(new PreMadeFileReader(new Dictionary
{
{ "main.ink", "Hel-\\lo!" }
-}), "main.ink");
+}), loggerFactory, "main.ink");
internal class PreMadeFileReader(Dictionary filesToContents) : IFileReader