From 6ee8051004dc2f1f61e41947fc4605f49f7b9518 Mon Sep 17 00:00:00 2001 From: mattia Date: Sat, 1 Mar 2025 17:06:56 +0100 Subject: [PATCH] feat: finally able to overcome the base of the base of this f*cked up mess --- InkBlot.Tests/ContentTextTest.cs | 9 +- InkBlot.Tests/LexerTest.cs | 70 +- InkBlot/Generated/InkBlotAntlrGrammar.interp | 51 +- InkBlot/Generated/InkBlotAntlrGrammar.tokens | 43 +- .../InkBlotAntlrGrammarBaseListener.cs | 158 +- .../InkBlotAntlrGrammarBaseVisitor.cs | 132 +- InkBlot/Generated/InkBlotAntlrGrammarLexer.cs | 123 +- .../Generated/InkBlotAntlrGrammarLexer.interp | 55 +- .../Generated/InkBlotAntlrGrammarLexer.tokens | 43 +- .../Generated/InkBlotAntlrGrammarListener.cs | 132 +- .../Generated/InkBlotAntlrGrammarParser.cs | 1523 ++--------------- .../Generated/InkBlotAntlrGrammarVisitor.cs | 80 +- InkBlot/InkBlotAntlrGrammar.g4 | 209 ++- InkBlot/InkBlotAntlrLexer.g4 | 87 +- InkBlot/ParseHierarchy/MultiDivert.cs | 34 +- InkBlot/ParserErrorListener.cs | 21 +- ...ContentText.cs => ListenerContentText.cs_} | 2 +- InkBlot/Visitor/ListenerMultiDivert.cs | 18 +- InkBlot/Visitor/ListenerStory.cs | 15 +- InkBlot/Visitor/ListenerStoryNode.cs | 19 - 20 files changed, 518 insertions(+), 2306 deletions(-) rename InkBlot/Visitor/{ListenerContentText.cs => ListenerContentText.cs_} (90%) delete mode 100644 InkBlot/Visitor/ListenerStoryNode.cs diff --git a/InkBlot.Tests/ContentTextTest.cs b/InkBlot.Tests/ContentTextTest.cs index 14aee36..d4a72af 100644 --- a/InkBlot.Tests/ContentTextTest.cs +++ b/InkBlot.Tests/ContentTextTest.cs @@ -20,12 +20,15 @@ public class ContentTextTest var fileReader = new InMemoryFileReader([ ("main.ink", inkInput) ]); - var parser = new InkBlotParser(); using var loggerFactory = Helpers.GetLoggerFactory(); - var (story, diagnostics) = InkBlotParser.Parse(fileReader, loggerFactory, "main.ink"); + var (story, diagnosticsEnumerable) = InkBlotParser.Parse(fileReader, loggerFactory, "main.ink"); + var diagnostics = diagnosticsEnumerable.ToArray(); // check the diagnostic counts match - diagnostics.Count().ShouldBe(numErrors); + if (numErrors == 0) + diagnostics.ShouldBe([]); + else + diagnostics.Count().ShouldBe(numErrors); // check the contents match (only if there was no diagnostic) if (numErrors != 0) return; diff --git a/InkBlot.Tests/LexerTest.cs b/InkBlot.Tests/LexerTest.cs index dd86065..448aea0 100644 --- a/InkBlot.Tests/LexerTest.cs +++ b/InkBlot.Tests/LexerTest.cs @@ -5,23 +5,36 @@ namespace InkBlot.Tests; public class LexerTest { + private readonly TokenEqualityComparer _tokenEqualityComparer = new(); + + private IToken T(string text, int type) + { + return new SimpleToken(text, type); + } + + [Fact] + public void TestSimpleTokens() + { + var tokens = GetTokens("testTest15"); + tokens.ShouldBe([ + T("testTest15", InkBlotAntlrGrammarLexer.IDENTIFIER), + T("", InkBlotAntlrGrammarLexer.Eof) + ], _tokenEqualityComparer); + } + [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) - ); + divertTokens.ShouldBe([ + T("<-", InkBlotAntlrGrammarLexer.THREAD_ARROW), + T(" ", InkBlotAntlrGrammarLexer.WS), + T("threadName", InkBlotAntlrGrammarLexer.IDENTIFIER), + T("", InkBlotAntlrGrammarLexer.Eof) + ], _tokenEqualityComparer); } - private IList GetTokens(string text) + private static IList GetTokens(string text) { var fileReader = new InMemoryFileReader([ ("main.ink", text) @@ -31,4 +44,39 @@ public class LexerTest var tokens = tokensStream.GetTokens(); return tokens; } + + private class TokenEqualityComparer : IEqualityComparer + { + public bool Equals(IToken? x, IToken? y) + { + if (ReferenceEquals(x, y)) return true; + if (x is null) return false; + if (y is null) return false; + return x.Text == y.Text && x.Type == y.Type; + } + + public int GetHashCode(IToken obj) + { + return HashCode.Combine(obj.Text, obj.Type); + } + } + + private class SimpleToken(string text, int type) : IToken + { + public string Text { get; } = text; + public int Type { get; } = type; + public int Line => 0; + public int Column => 0; + public int Channel => 0; + public int TokenIndex => 0; + public int StartIndex => 0; + public int StopIndex => 0; + public ITokenSource TokenSource => null!; + public ICharStream InputStream => null!; + + public override string ToString() + { + return $"['{Text}',<{Type}>]"; + } + } } \ No newline at end of file diff --git a/InkBlot/Generated/InkBlotAntlrGrammar.interp b/InkBlot/Generated/InkBlotAntlrGrammar.interp index 2f3ffa4..f3a956e 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammar.interp +++ b/InkBlot/Generated/InkBlotAntlrGrammar.interp @@ -1,28 +1,15 @@ token literal names: null +'.' '(' ',' ')' -'.' -'-' -'|' -null -null -null -null -'{' -'}' -null -null -null -null -null -null -null '<-' '->' '->->' null +null +null token symbolic names: null @@ -30,38 +17,17 @@ null null null null -null -null -WS -NL -MULTILINE_WS -CONTENT_TEXT_NO_ESCAPE_SIMPLE -INLINE_LOGIC_START -INLINE_LOGIC_END -SEQUENCE_TYPE_SYMBOL_ANNOTATION -ONCE -CYCLE -SHUFFLE -STOPPING -SHUFFLE_ONCE -SHUFFLE_STOPPING THREAD_ARROW DIVERT_ARROW TUNNEL_ARROW IDENTIFIER +WS +NL rule names: story topLevelStatements topLevelStatement -knotLevelStatements -stitchLevelStatements -innerBlockLevelStatements -contentText -mixedTextAndLogic -inlineLogicOrGlueOrTagStart -inlineLogic -innerLogic multiDivert multiDivert_withoutWS multiDivertArrows_tail @@ -70,12 +36,7 @@ divertIdentifierWithArguments_name divertIdentifierWithArguments_arguments identifier expression -sequenceTypeAnnotation -innerSequenceObjects -innerMultilineSequenceObjects -singleMultilineSequenceElement -innerInlineSequenceObjects atn: -[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 +[4, 1, 10, 118, 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, 1, 0, 1, 0, 1, 1, 1, 1, 4, 1, 27, 8, 1, 11, 1, 12, 1, 28, 1, 1, 5, 1, 32, 8, 1, 10, 1, 12, 1, 35, 9, 1, 1, 1, 5, 1, 38, 8, 1, 10, 1, 12, 1, 41, 9, 1, 1, 2, 1, 2, 1, 3, 3, 3, 46, 8, 3, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 5, 4, 54, 8, 4, 10, 4, 12, 4, 57, 9, 4, 1, 4, 3, 4, 60, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 3, 5, 68, 8, 5, 1, 6, 1, 6, 3, 6, 72, 8, 6, 1, 6, 3, 6, 75, 8, 6, 1, 6, 3, 6, 78, 8, 6, 1, 7, 3, 7, 81, 8, 7, 1, 7, 1, 7, 3, 7, 85, 8, 7, 1, 7, 1, 7, 3, 7, 89, 8, 7, 1, 7, 1, 7, 3, 7, 93, 8, 7, 5, 7, 95, 8, 7, 10, 7, 12, 7, 98, 9, 7, 1, 8, 1, 8, 1, 8, 1, 8, 3, 8, 104, 8, 8, 1, 8, 5, 8, 107, 8, 8, 10, 8, 12, 8, 110, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 0, 0, 11, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 0, 0, 125, 0, 22, 1, 0, 0, 0, 2, 24, 1, 0, 0, 0, 4, 42, 1, 0, 0, 0, 6, 45, 1, 0, 0, 0, 8, 59, 1, 0, 0, 0, 10, 67, 1, 0, 0, 0, 12, 69, 1, 0, 0, 0, 14, 80, 1, 0, 0, 0, 16, 99, 1, 0, 0, 0, 18, 113, 1, 0, 0, 0, 20, 115, 1, 0, 0, 0, 22, 23, 3, 2, 1, 0, 23, 1, 1, 0, 0, 0, 24, 33, 3, 4, 2, 0, 25, 27, 5, 10, 0, 0, 26, 25, 1, 0, 0, 0, 27, 28, 1, 0, 0, 0, 28, 26, 1, 0, 0, 0, 28, 29, 1, 0, 0, 0, 29, 30, 1, 0, 0, 0, 30, 32, 3, 4, 2, 0, 31, 26, 1, 0, 0, 0, 32, 35, 1, 0, 0, 0, 33, 31, 1, 0, 0, 0, 33, 34, 1, 0, 0, 0, 34, 39, 1, 0, 0, 0, 35, 33, 1, 0, 0, 0, 36, 38, 5, 10, 0, 0, 37, 36, 1, 0, 0, 0, 38, 41, 1, 0, 0, 0, 39, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 3, 1, 0, 0, 0, 41, 39, 1, 0, 0, 0, 42, 43, 3, 6, 3, 0, 43, 5, 1, 0, 0, 0, 44, 46, 5, 9, 0, 0, 45, 44, 1, 0, 0, 0, 45, 46, 1, 0, 0, 0, 46, 47, 1, 0, 0, 0, 47, 48, 3, 8, 4, 0, 48, 7, 1, 0, 0, 0, 49, 50, 5, 5, 0, 0, 50, 60, 3, 12, 6, 0, 51, 52, 5, 6, 0, 0, 52, 54, 3, 12, 6, 0, 53, 51, 1, 0, 0, 0, 54, 57, 1, 0, 0, 0, 55, 53, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 58, 1, 0, 0, 0, 57, 55, 1, 0, 0, 0, 58, 60, 3, 10, 5, 0, 59, 49, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 60, 9, 1, 0, 0, 0, 61, 68, 5, 6, 0, 0, 62, 63, 5, 6, 0, 0, 63, 68, 3, 12, 6, 0, 64, 65, 5, 7, 0, 0, 65, 68, 3, 12, 6, 0, 66, 68, 5, 7, 0, 0, 67, 61, 1, 0, 0, 0, 67, 62, 1, 0, 0, 0, 67, 64, 1, 0, 0, 0, 67, 66, 1, 0, 0, 0, 68, 11, 1, 0, 0, 0, 69, 71, 3, 14, 7, 0, 70, 72, 5, 9, 0, 0, 71, 70, 1, 0, 0, 0, 71, 72, 1, 0, 0, 0, 72, 74, 1, 0, 0, 0, 73, 75, 3, 16, 8, 0, 74, 73, 1, 0, 0, 0, 74, 75, 1, 0, 0, 0, 75, 77, 1, 0, 0, 0, 76, 78, 5, 9, 0, 0, 77, 76, 1, 0, 0, 0, 77, 78, 1, 0, 0, 0, 78, 13, 1, 0, 0, 0, 79, 81, 5, 9, 0, 0, 80, 79, 1, 0, 0, 0, 80, 81, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 84, 3, 18, 9, 0, 83, 85, 5, 9, 0, 0, 84, 83, 1, 0, 0, 0, 84, 85, 1, 0, 0, 0, 85, 96, 1, 0, 0, 0, 86, 88, 5, 1, 0, 0, 87, 89, 5, 9, 0, 0, 88, 87, 1, 0, 0, 0, 88, 89, 1, 0, 0, 0, 89, 90, 1, 0, 0, 0, 90, 92, 3, 18, 9, 0, 91, 93, 5, 9, 0, 0, 92, 91, 1, 0, 0, 0, 92, 93, 1, 0, 0, 0, 93, 95, 1, 0, 0, 0, 94, 86, 1, 0, 0, 0, 95, 98, 1, 0, 0, 0, 96, 94, 1, 0, 0, 0, 96, 97, 1, 0, 0, 0, 97, 15, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 99, 100, 5, 2, 0, 0, 100, 108, 3, 20, 10, 0, 101, 103, 5, 3, 0, 0, 102, 104, 5, 9, 0, 0, 103, 102, 1, 0, 0, 0, 103, 104, 1, 0, 0, 0, 104, 105, 1, 0, 0, 0, 105, 107, 3, 20, 10, 0, 106, 101, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 111, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 112, 5, 4, 0, 0, 112, 17, 1, 0, 0, 0, 113, 114, 5, 8, 0, 0, 114, 19, 1, 0, 0, 0, 115, 116, 5, 8, 0, 0, 116, 21, 1, 0, 0, 0, 17, 28, 33, 39, 45, 55, 59, 67, 71, 74, 77, 80, 84, 88, 92, 96, 103, 108] \ No newline at end of file diff --git a/InkBlot/Generated/InkBlotAntlrGrammar.tokens b/InkBlot/Generated/InkBlotAntlrGrammar.tokens index 0fc8b1c..3f00bde 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammar.tokens +++ b/InkBlot/Generated/InkBlotAntlrGrammar.tokens @@ -2,33 +2,16 @@ T__0=1 T__1=2 T__2=3 T__3=4 -T__4=5 -T__5=6 -WS=7 -NL=8 -MULTILINE_WS=9 -CONTENT_TEXT_NO_ESCAPE_SIMPLE=10 -INLINE_LOGIC_START=11 -INLINE_LOGIC_END=12 -SEQUENCE_TYPE_SYMBOL_ANNOTATION=13 -ONCE=14 -CYCLE=15 -SHUFFLE=16 -STOPPING=17 -SHUFFLE_ONCE=18 -SHUFFLE_STOPPING=19 -THREAD_ARROW=20 -DIVERT_ARROW=21 -TUNNEL_ARROW=22 -IDENTIFIER=23 -'('=1 -','=2 -')'=3 -'.'=4 -'-'=5 -'|'=6 -'{'=11 -'}'=12 -'<-'=20 -'->'=21 -'->->'=22 +THREAD_ARROW=5 +DIVERT_ARROW=6 +TUNNEL_ARROW=7 +IDENTIFIER=8 +WS=9 +NL=10 +'.'=1 +'('=2 +','=3 +')'=4 +'<-'=5 +'->'=6 +'->->'=7 diff --git a/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs b/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs index 874c6b8..31987a3 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarBaseListener.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 +// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 // Unreachable code detected #pragma warning disable 0162 @@ -72,102 +72,6 @@ public partial class InkBlotAntlrGrammarBaseListener : IInkBlotAntlrGrammarListe /// The parse tree. public virtual void ExitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context) { } /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterKnotLevelStatements([NotNull] InkBlotAntlrGrammarParser.KnotLevelStatementsContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitKnotLevelStatements([NotNull] InkBlotAntlrGrammarParser.KnotLevelStatementsContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterStitchLevelStatements([NotNull] InkBlotAntlrGrammarParser.StitchLevelStatementsContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitStitchLevelStatements([NotNull] InkBlotAntlrGrammarParser.StitchLevelStatementsContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterInnerBlockLevelStatements([NotNull] InkBlotAntlrGrammarParser.InnerBlockLevelStatementsContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitInnerBlockLevelStatements([NotNull] InkBlotAntlrGrammarParser.InnerBlockLevelStatementsContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterContentText([NotNull] InkBlotAntlrGrammarParser.ContentTextContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitContentText([NotNull] InkBlotAntlrGrammarParser.ContentTextContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterMixedTextAndLogic([NotNull] InkBlotAntlrGrammarParser.MixedTextAndLogicContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitMixedTextAndLogic([NotNull] InkBlotAntlrGrammarParser.MixedTextAndLogicContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterInlineLogicOrGlueOrTagStart([NotNull] InkBlotAntlrGrammarParser.InlineLogicOrGlueOrTagStartContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitInlineLogicOrGlueOrTagStart([NotNull] InkBlotAntlrGrammarParser.InlineLogicOrGlueOrTagStartContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterInlineLogic([NotNull] InkBlotAntlrGrammarParser.InlineLogicContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitInlineLogic([NotNull] InkBlotAntlrGrammarParser.InlineLogicContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterInnerLogic([NotNull] InkBlotAntlrGrammarParser.InnerLogicContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitInnerLogic([NotNull] InkBlotAntlrGrammarParser.InnerLogicContext context) { } - /// /// Enter a parse tree produced by . /// The default implementation does nothing. /// @@ -323,66 +227,6 @@ public partial class InkBlotAntlrGrammarBaseListener : IInkBlotAntlrGrammarListe /// /// The parse tree. public virtual void ExitExpression([NotNull] InkBlotAntlrGrammarParser.ExpressionContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterSequenceTypeAnnotation([NotNull] InkBlotAntlrGrammarParser.SequenceTypeAnnotationContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitSequenceTypeAnnotation([NotNull] InkBlotAntlrGrammarParser.SequenceTypeAnnotationContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterInnerSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerSequenceObjectsContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitInnerSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerSequenceObjectsContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterInnerMultilineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerMultilineSequenceObjectsContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitInnerMultilineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerMultilineSequenceObjectsContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterSingleMultilineSequenceElement([NotNull] InkBlotAntlrGrammarParser.SingleMultilineSequenceElementContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitSingleMultilineSequenceElement([NotNull] InkBlotAntlrGrammarParser.SingleMultilineSequenceElementContext context) { } - /// - /// Enter a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void EnterInnerInlineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerInlineSequenceObjectsContext context) { } - /// - /// Exit a parse tree produced by . - /// The default implementation does nothing. - /// - /// The parse tree. - public virtual void ExitInnerInlineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerInlineSequenceObjectsContext context) { } /// /// The default implementation does nothing. diff --git a/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs b/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs index e4e48de..00d6873 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarBaseVisitor.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 +// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 // Unreachable code detected #pragma warning disable 0162 @@ -65,86 +65,6 @@ public partial class InkBlotAntlrGrammarBaseVisitor : AbstractParseTreeV /// The visitor result. public virtual Result VisitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by . - /// - /// The default implementation returns the result of calling - /// on . - /// - /// - /// The parse tree. - /// The visitor result. - public virtual Result VisitKnotLevelStatements([NotNull] InkBlotAntlrGrammarParser.KnotLevelStatementsContext 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 VisitStitchLevelStatements([NotNull] InkBlotAntlrGrammarParser.StitchLevelStatementsContext 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 VisitInnerBlockLevelStatements([NotNull] InkBlotAntlrGrammarParser.InnerBlockLevelStatementsContext 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 VisitContentText([NotNull] InkBlotAntlrGrammarParser.ContentTextContext 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 VisitMixedTextAndLogic([NotNull] InkBlotAntlrGrammarParser.MixedTextAndLogicContext 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 VisitInlineLogicOrGlueOrTagStart([NotNull] InkBlotAntlrGrammarParser.InlineLogicOrGlueOrTagStartContext 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 VisitInlineLogic([NotNull] InkBlotAntlrGrammarParser.InlineLogicContext 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 VisitInnerLogic([NotNull] InkBlotAntlrGrammarParser.InnerLogicContext context) { return VisitChildren(context); } - /// /// Visit a parse tree produced by . /// /// The default implementation returns the result of calling @@ -270,54 +190,4 @@ public partial class InkBlotAntlrGrammarBaseVisitor : AbstractParseTreeV /// The parse tree. /// The visitor result. public virtual Result VisitExpression([NotNull] InkBlotAntlrGrammarParser.ExpressionContext 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 VisitSequenceTypeAnnotation([NotNull] InkBlotAntlrGrammarParser.SequenceTypeAnnotationContext 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 VisitInnerSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerSequenceObjectsContext 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 VisitInnerMultilineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerMultilineSequenceObjectsContext 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 VisitSingleMultilineSequenceElement([NotNull] InkBlotAntlrGrammarParser.SingleMultilineSequenceElementContext 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 VisitInnerInlineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerInlineSequenceObjectsContext context) { return VisitChildren(context); } } diff --git a/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs b/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs index bff499f..eedc745 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarLexer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 +// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 // Unreachable code detected #pragma warning disable 0162 @@ -33,11 +33,8 @@ public partial class InkBlotAntlrGrammarLexer : Lexer { protected static DFA[] decisionToDFA; protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); public const int - T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, WS=7, NL=8, MULTILINE_WS=9, - CONTENT_TEXT_NO_ESCAPE_SIMPLE=10, INLINE_LOGIC_START=11, INLINE_LOGIC_END=12, - SEQUENCE_TYPE_SYMBOL_ANNOTATION=13, ONCE=14, CYCLE=15, SHUFFLE=16, STOPPING=17, - SHUFFLE_ONCE=18, SHUFFLE_STOPPING=19, THREAD_ARROW=20, DIVERT_ARROW=21, - TUNNEL_ARROW=22, IDENTIFIER=23; + T__0=1, T__1=2, T__2=3, T__3=4, THREAD_ARROW=5, DIVERT_ARROW=6, TUNNEL_ARROW=7, + IDENTIFIER=8, WS=9, NL=10; public static string[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -47,11 +44,8 @@ public partial class InkBlotAntlrGrammarLexer : Lexer { }; public static readonly string[] ruleNames = { - "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "WS", "NL", "MULTILINE_WS", - "CONTENT_TEXT_NO_ESCAPE_SIMPLE", "INLINE_LOGIC_START", "INLINE_LOGIC_END", - "SEQUENCE_TYPE_SYMBOL_ANNOTATION", "ONCE", "CYCLE", "SHUFFLE", "STOPPING", - "SHUFFLE_ONCE", "SHUFFLE_STOPPING", "THREAD_ARROW", "DIVERT_ARROW", "TUNNEL_ARROW", - "IDENTIFIER" + "T__0", "T__1", "T__2", "T__3", "THREAD_ARROW", "DIVERT_ARROW", "TUNNEL_ARROW", + "IDENTIFIER", "WS", "NL" }; @@ -65,16 +59,11 @@ public partial class InkBlotAntlrGrammarLexer : Lexer { } private static readonly string[] _LiteralNames = { - null, "'('", "','", "')'", "'.'", "'-'", "'|'", null, null, null, null, - "'{'", "'}'", null, null, null, null, null, null, null, "'<-'", "'->'", - "'->->'" + null, "'.'", "'('", "','", "')'", "'<-'", "'->'", "'->->'" }; private static readonly string[] _SymbolicNames = { - null, null, null, null, null, null, null, "WS", "NL", "MULTILINE_WS", - "CONTENT_TEXT_NO_ESCAPE_SIMPLE", "INLINE_LOGIC_START", "INLINE_LOGIC_END", - "SEQUENCE_TYPE_SYMBOL_ANNOTATION", "ONCE", "CYCLE", "SHUFFLE", "STOPPING", - "SHUFFLE_ONCE", "SHUFFLE_STOPPING", "THREAD_ARROW", "DIVERT_ARROW", "TUNNEL_ARROW", - "IDENTIFIER" + null, null, null, null, null, "THREAD_ARROW", "DIVERT_ARROW", "TUNNEL_ARROW", + "IDENTIFIER", "WS", "NL" }; public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); @@ -103,85 +92,25 @@ public partial class InkBlotAntlrGrammarLexer : Lexer { decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i); } } - public override bool Sempred(RuleContext _localctx, int ruleIndex, int predIndex) { - switch (ruleIndex) { - case 9 : return CONTENT_TEXT_NO_ESCAPE_SIMPLE_sempred(_localctx, predIndex); - } - return true; - } - private bool CONTENT_TEXT_NO_ESCAPE_SIMPLE_sempred(RuleContext _localctx, int predIndex) { - switch (predIndex) { - case 0: return InputStream.LA(1) != '>' ; - } - return true; - } - private static int[] _serializedATN = { - 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 + 4,0,10,58,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,1,0,1,0,1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,1,4,1, + 5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,7,4,7,42,8,7,11,7,12,7,43,1,8,4,8,47,8, + 8,11,8,12,8,48,1,9,3,9,52,8,9,1,9,3,9,55,8,9,1,9,1,9,0,0,10,1,1,3,2,5, + 3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,1,0,2,4,0,48,57,65,90,95,95,97,122, + 2,0,9,9,32,32,61,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, + 1,21,1,0,0,0,3,23,1,0,0,0,5,25,1,0,0,0,7,27,1,0,0,0,9,29,1,0,0,0,11,32, + 1,0,0,0,13,35,1,0,0,0,15,41,1,0,0,0,17,46,1,0,0,0,19,51,1,0,0,0,21,22, + 5,46,0,0,22,2,1,0,0,0,23,24,5,40,0,0,24,4,1,0,0,0,25,26,5,44,0,0,26,6, + 1,0,0,0,27,28,5,41,0,0,28,8,1,0,0,0,29,30,5,60,0,0,30,31,5,45,0,0,31,10, + 1,0,0,0,32,33,5,45,0,0,33,34,5,62,0,0,34,12,1,0,0,0,35,36,5,45,0,0,36, + 37,5,62,0,0,37,38,5,45,0,0,38,39,5,62,0,0,39,14,1,0,0,0,40,42,7,0,0,0, + 41,40,1,0,0,0,42,43,1,0,0,0,43,41,1,0,0,0,43,44,1,0,0,0,44,16,1,0,0,0, + 45,47,7,1,0,0,46,45,1,0,0,0,47,48,1,0,0,0,48,46,1,0,0,0,48,49,1,0,0,0, + 49,18,1,0,0,0,50,52,3,17,8,0,51,50,1,0,0,0,51,52,1,0,0,0,52,54,1,0,0,0, + 53,55,5,13,0,0,54,53,1,0,0,0,54,55,1,0,0,0,55,56,1,0,0,0,56,57,5,10,0, + 0,57,20,1,0,0,0,5,0,43,48,51,54,0 }; public static readonly ATN _ATN = diff --git a/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp b/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp index 75c2a98..e28d72e 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp +++ b/InkBlot/Generated/InkBlotAntlrGrammarLexer.interp @@ -1,28 +1,15 @@ token literal names: null +'.' '(' ',' ')' -'.' -'-' -'|' -null -null -null -null -'{' -'}' -null -null -null -null -null -null -null '<-' '->' '->->' null +null +null token symbolic names: null @@ -30,50 +17,24 @@ null null null null -null -null -WS -NL -MULTILINE_WS -CONTENT_TEXT_NO_ESCAPE_SIMPLE -INLINE_LOGIC_START -INLINE_LOGIC_END -SEQUENCE_TYPE_SYMBOL_ANNOTATION -ONCE -CYCLE -SHUFFLE -STOPPING -SHUFFLE_ONCE -SHUFFLE_STOPPING THREAD_ARROW DIVERT_ARROW TUNNEL_ARROW IDENTIFIER +WS +NL rule names: T__0 T__1 T__2 T__3 -T__4 -T__5 -WS -NL -MULTILINE_WS -CONTENT_TEXT_NO_ESCAPE_SIMPLE -INLINE_LOGIC_START -INLINE_LOGIC_END -SEQUENCE_TYPE_SYMBOL_ANNOTATION -ONCE -CYCLE -SHUFFLE -STOPPING -SHUFFLE_ONCE -SHUFFLE_STOPPING THREAD_ARROW DIVERT_ARROW TUNNEL_ARROW IDENTIFIER +WS +NL channel names: DEFAULT_TOKEN_CHANNEL @@ -83,4 +44,4 @@ mode names: DEFAULT_MODE atn: -[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 +[4, 0, 10, 58, 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, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 4, 7, 42, 8, 7, 11, 7, 12, 7, 43, 1, 8, 4, 8, 47, 8, 8, 11, 8, 12, 8, 48, 1, 9, 3, 9, 52, 8, 9, 1, 9, 3, 9, 55, 8, 9, 1, 9, 1, 9, 0, 0, 10, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 1, 0, 2, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 9, 9, 32, 32, 61, 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, 1, 21, 1, 0, 0, 0, 3, 23, 1, 0, 0, 0, 5, 25, 1, 0, 0, 0, 7, 27, 1, 0, 0, 0, 9, 29, 1, 0, 0, 0, 11, 32, 1, 0, 0, 0, 13, 35, 1, 0, 0, 0, 15, 41, 1, 0, 0, 0, 17, 46, 1, 0, 0, 0, 19, 51, 1, 0, 0, 0, 21, 22, 5, 46, 0, 0, 22, 2, 1, 0, 0, 0, 23, 24, 5, 40, 0, 0, 24, 4, 1, 0, 0, 0, 25, 26, 5, 44, 0, 0, 26, 6, 1, 0, 0, 0, 27, 28, 5, 41, 0, 0, 28, 8, 1, 0, 0, 0, 29, 30, 5, 60, 0, 0, 30, 31, 5, 45, 0, 0, 31, 10, 1, 0, 0, 0, 32, 33, 5, 45, 0, 0, 33, 34, 5, 62, 0, 0, 34, 12, 1, 0, 0, 0, 35, 36, 5, 45, 0, 0, 36, 37, 5, 62, 0, 0, 37, 38, 5, 45, 0, 0, 38, 39, 5, 62, 0, 0, 39, 14, 1, 0, 0, 0, 40, 42, 7, 0, 0, 0, 41, 40, 1, 0, 0, 0, 42, 43, 1, 0, 0, 0, 43, 41, 1, 0, 0, 0, 43, 44, 1, 0, 0, 0, 44, 16, 1, 0, 0, 0, 45, 47, 7, 1, 0, 0, 46, 45, 1, 0, 0, 0, 47, 48, 1, 0, 0, 0, 48, 46, 1, 0, 0, 0, 48, 49, 1, 0, 0, 0, 49, 18, 1, 0, 0, 0, 50, 52, 3, 17, 8, 0, 51, 50, 1, 0, 0, 0, 51, 52, 1, 0, 0, 0, 52, 54, 1, 0, 0, 0, 53, 55, 5, 13, 0, 0, 54, 53, 1, 0, 0, 0, 54, 55, 1, 0, 0, 0, 55, 56, 1, 0, 0, 0, 56, 57, 5, 10, 0, 0, 57, 20, 1, 0, 0, 0, 5, 0, 43, 48, 51, 54, 0] \ No newline at end of file diff --git a/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens b/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens index 0fc8b1c..3f00bde 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens +++ b/InkBlot/Generated/InkBlotAntlrGrammarLexer.tokens @@ -2,33 +2,16 @@ T__0=1 T__1=2 T__2=3 T__3=4 -T__4=5 -T__5=6 -WS=7 -NL=8 -MULTILINE_WS=9 -CONTENT_TEXT_NO_ESCAPE_SIMPLE=10 -INLINE_LOGIC_START=11 -INLINE_LOGIC_END=12 -SEQUENCE_TYPE_SYMBOL_ANNOTATION=13 -ONCE=14 -CYCLE=15 -SHUFFLE=16 -STOPPING=17 -SHUFFLE_ONCE=18 -SHUFFLE_STOPPING=19 -THREAD_ARROW=20 -DIVERT_ARROW=21 -TUNNEL_ARROW=22 -IDENTIFIER=23 -'('=1 -','=2 -')'=3 -'.'=4 -'-'=5 -'|'=6 -'{'=11 -'}'=12 -'<-'=20 -'->'=21 -'->->'=22 +THREAD_ARROW=5 +DIVERT_ARROW=6 +TUNNEL_ARROW=7 +IDENTIFIER=8 +WS=9 +NL=10 +'.'=1 +'('=2 +','=3 +')'=4 +'<-'=5 +'->'=6 +'->->'=7 diff --git a/InkBlot/Generated/InkBlotAntlrGrammarListener.cs b/InkBlot/Generated/InkBlotAntlrGrammarListener.cs index 372b00a..62d74d8 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarListener.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarListener.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 +// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 // Unreachable code detected #pragma warning disable 0162 @@ -61,86 +61,6 @@ public interface IInkBlotAntlrGrammarListener : IParseTreeListener { /// The parse tree. void ExitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context); /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterKnotLevelStatements([NotNull] InkBlotAntlrGrammarParser.KnotLevelStatementsContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitKnotLevelStatements([NotNull] InkBlotAntlrGrammarParser.KnotLevelStatementsContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterStitchLevelStatements([NotNull] InkBlotAntlrGrammarParser.StitchLevelStatementsContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitStitchLevelStatements([NotNull] InkBlotAntlrGrammarParser.StitchLevelStatementsContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterInnerBlockLevelStatements([NotNull] InkBlotAntlrGrammarParser.InnerBlockLevelStatementsContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitInnerBlockLevelStatements([NotNull] InkBlotAntlrGrammarParser.InnerBlockLevelStatementsContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterContentText([NotNull] InkBlotAntlrGrammarParser.ContentTextContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitContentText([NotNull] InkBlotAntlrGrammarParser.ContentTextContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterMixedTextAndLogic([NotNull] InkBlotAntlrGrammarParser.MixedTextAndLogicContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitMixedTextAndLogic([NotNull] InkBlotAntlrGrammarParser.MixedTextAndLogicContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterInlineLogicOrGlueOrTagStart([NotNull] InkBlotAntlrGrammarParser.InlineLogicOrGlueOrTagStartContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitInlineLogicOrGlueOrTagStart([NotNull] InkBlotAntlrGrammarParser.InlineLogicOrGlueOrTagStartContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterInlineLogic([NotNull] InkBlotAntlrGrammarParser.InlineLogicContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitInlineLogic([NotNull] InkBlotAntlrGrammarParser.InlineLogicContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterInnerLogic([NotNull] InkBlotAntlrGrammarParser.InnerLogicContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitInnerLogic([NotNull] InkBlotAntlrGrammarParser.InnerLogicContext context); - /// /// Enter a parse tree produced by . /// /// The parse tree. @@ -272,54 +192,4 @@ public interface IInkBlotAntlrGrammarListener : IParseTreeListener { /// /// The parse tree. void ExitExpression([NotNull] InkBlotAntlrGrammarParser.ExpressionContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterSequenceTypeAnnotation([NotNull] InkBlotAntlrGrammarParser.SequenceTypeAnnotationContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitSequenceTypeAnnotation([NotNull] InkBlotAntlrGrammarParser.SequenceTypeAnnotationContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterInnerSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerSequenceObjectsContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitInnerSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerSequenceObjectsContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterInnerMultilineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerMultilineSequenceObjectsContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitInnerMultilineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerMultilineSequenceObjectsContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterSingleMultilineSequenceElement([NotNull] InkBlotAntlrGrammarParser.SingleMultilineSequenceElementContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitSingleMultilineSequenceElement([NotNull] InkBlotAntlrGrammarParser.SingleMultilineSequenceElementContext context); - /// - /// Enter a parse tree produced by . - /// - /// The parse tree. - void EnterInnerInlineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerInlineSequenceObjectsContext context); - /// - /// Exit a parse tree produced by . - /// - /// The parse tree. - void ExitInnerInlineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerInlineSequenceObjectsContext context); } diff --git a/InkBlot/Generated/InkBlotAntlrGrammarParser.cs b/InkBlot/Generated/InkBlotAntlrGrammarParser.cs index 872e4ba..810c4a7 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarParser.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarParser.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 +// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 // Unreachable code detected #pragma warning disable 0162 @@ -36,42 +36,26 @@ public partial class InkBlotAntlrGrammarParser : Parser { protected static DFA[] decisionToDFA; protected static PredictionContextCache sharedContextCache = new PredictionContextCache(); public const int - T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, WS=7, NL=8, MULTILINE_WS=9, - CONTENT_TEXT_NO_ESCAPE_SIMPLE=10, INLINE_LOGIC_START=11, INLINE_LOGIC_END=12, - SEQUENCE_TYPE_SYMBOL_ANNOTATION=13, ONCE=14, CYCLE=15, SHUFFLE=16, STOPPING=17, - SHUFFLE_ONCE=18, SHUFFLE_STOPPING=19, THREAD_ARROW=20, DIVERT_ARROW=21, - TUNNEL_ARROW=22, IDENTIFIER=23; + T__0=1, T__1=2, T__2=3, T__3=4, THREAD_ARROW=5, DIVERT_ARROW=6, TUNNEL_ARROW=7, + IDENTIFIER=8, WS=9, NL=10; public const int 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_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; + RULE_multiDivert = 3, RULE_multiDivert_withoutWS = 4, RULE_multiDivertArrows_tail = 5, + RULE_divertIdentifierWithArguments = 6, RULE_divertIdentifierWithArguments_name = 7, + RULE_divertIdentifierWithArguments_arguments = 8, RULE_identifier = 9, + RULE_expression = 10; public static readonly string[] ruleNames = { - "story", "topLevelStatements", "topLevelStatement", "knotLevelStatements", - "stitchLevelStatements", "innerBlockLevelStatements", "contentText", "mixedTextAndLogic", - "inlineLogicOrGlueOrTagStart", "inlineLogic", "innerLogic", "multiDivert", - "multiDivert_withoutWS", "multiDivertArrows_tail", "divertIdentifierWithArguments", - "divertIdentifierWithArguments_name", "divertIdentifierWithArguments_arguments", - "identifier", "expression", "sequenceTypeAnnotation", "innerSequenceObjects", - "innerMultilineSequenceObjects", "singleMultilineSequenceElement", "innerInlineSequenceObjects" + "story", "topLevelStatements", "topLevelStatement", "multiDivert", "multiDivert_withoutWS", + "multiDivertArrows_tail", "divertIdentifierWithArguments", "divertIdentifierWithArguments_name", + "divertIdentifierWithArguments_arguments", "identifier", "expression" }; private static readonly string[] _LiteralNames = { - null, "'('", "','", "')'", "'.'", "'-'", "'|'", null, null, null, null, - "'{'", "'}'", null, null, null, null, null, null, null, "'<-'", "'->'", - "'->->'" + null, "'.'", "'('", "','", "')'", "'<-'", "'->'", "'->->'" }; private static readonly string[] _SymbolicNames = { - null, null, null, null, null, null, null, "WS", "NL", "MULTILINE_WS", - "CONTENT_TEXT_NO_ESCAPE_SIMPLE", "INLINE_LOGIC_START", "INLINE_LOGIC_END", - "SEQUENCE_TYPE_SYMBOL_ANNOTATION", "ONCE", "CYCLE", "SHUFFLE", "STOPPING", - "SHUFFLE_ONCE", "SHUFFLE_STOPPING", "THREAD_ARROW", "DIVERT_ARROW", "TUNNEL_ARROW", - "IDENTIFIER" + null, null, null, null, null, "THREAD_ARROW", "DIVERT_ARROW", "TUNNEL_ARROW", + "IDENTIFIER", "WS", "NL" }; public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); @@ -139,7 +123,7 @@ public partial class InkBlotAntlrGrammarParser : Parser { try { EnterOuterAlt(_localctx, 1); { - State = 48; + State = 22; topLevelStatements(); } } @@ -161,6 +145,10 @@ public partial class InkBlotAntlrGrammarParser : Parser { [System.Diagnostics.DebuggerNonUserCode] public TopLevelStatementContext topLevelStatement(int i) { return GetRuleContext(i); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] NL() { return GetTokens(InkBlotAntlrGrammarParser.NL); } + [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NL(int i) { + return GetToken(InkBlotAntlrGrammarParser.NL, i); + } public TopLevelStatementsContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { @@ -190,22 +178,55 @@ public partial class InkBlotAntlrGrammarParser : Parser { EnterRule(_localctx, 2, RULE_topLevelStatements); int _la; try { + int _alt; EnterOuterAlt(_localctx, 1); { - State = 51; + State = 24; + topLevelStatement(); + State = 33; + ErrorHandler.Sync(this); + _alt = Interpreter.AdaptivePredict(TokenStream,1,Context); + while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { + if ( _alt==1 ) { + { + { + State = 26; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + do { + { + { + State = 25; + Match(NL); + } + } + State = 28; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + } while ( _la==NL ); + State = 30; + topLevelStatement(); + } + } + } + State = 35; + ErrorHandler.Sync(this); + _alt = Interpreter.AdaptivePredict(TokenStream,1,Context); + } + State = 39; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - do { + while (_la==NL) { { { - State = 50; - topLevelStatement(); + State = 36; + Match(NL); } } - State = 53; + State = 41; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) ); + } } } catch (RecognitionException re) { @@ -223,9 +244,6 @@ public partial class InkBlotAntlrGrammarParser : Parser { [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) { @@ -253,463 +271,10 @@ public partial class InkBlotAntlrGrammarParser : Parser { public TopLevelStatementContext topLevelStatement() { TopLevelStatementContext _localctx = new TopLevelStatementContext(Context, State); EnterRule(_localctx, 4, RULE_topLevelStatement); - try { - State = 57; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - 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 = 56; - contentText(); - } - 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 KnotLevelStatementsContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext[] contentText() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { - return GetRuleContext(i); - } - [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext[] multiDivert() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert(int i) { - return GetRuleContext(i); - } - public KnotLevelStatementsContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_knotLevelStatements; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterKnotLevelStatements(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitKnotLevelStatements(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitKnotLevelStatements(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public KnotLevelStatementsContext knotLevelStatements() { - KnotLevelStatementsContext _localctx = new KnotLevelStatementsContext(Context, State); - EnterRule(_localctx, 6, RULE_knotLevelStatements); - int _la; try { EnterOuterAlt(_localctx, 1); { - State = 61; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - do { - { - State = 61; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - case CONTENT_TEXT_NO_ESCAPE_SIMPLE: - { - State = 59; - contentText(); - } - break; - case WS: - case THREAD_ARROW: - case DIVERT_ARROW: - case TUNNEL_ARROW: - { - State = 60; - multiDivert(); - } - break; - default: - throw new NoViableAltException(this); - } - } - State = 63; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) ); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - - public partial class StitchLevelStatementsContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext[] contentText() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { - return GetRuleContext(i); - } - [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext[] multiDivert() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert(int i) { - return GetRuleContext(i); - } - public StitchLevelStatementsContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_stitchLevelStatements; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterStitchLevelStatements(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitStitchLevelStatements(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitStitchLevelStatements(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public StitchLevelStatementsContext stitchLevelStatements() { - StitchLevelStatementsContext _localctx = new StitchLevelStatementsContext(Context, State); - EnterRule(_localctx, 8, RULE_stitchLevelStatements); - int _la; - try { - EnterOuterAlt(_localctx, 1); - { - State = 67; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - do { - { - State = 67; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - case CONTENT_TEXT_NO_ESCAPE_SIMPLE: - { - State = 65; - contentText(); - } - break; - case WS: - case THREAD_ARROW: - case DIVERT_ARROW: - case TUNNEL_ARROW: - { - State = 66; - multiDivert(); - } - break; - default: - throw new NoViableAltException(this); - } - } - State = 69; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & 7341184L) != 0) ); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - - public partial class InnerBlockLevelStatementsContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext[] contentText() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { - return GetRuleContext(i); - } - [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext[] multiDivert() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert(int i) { - return GetRuleContext(i); - } - public InnerBlockLevelStatementsContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_innerBlockLevelStatements; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterInnerBlockLevelStatements(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitInnerBlockLevelStatements(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitInnerBlockLevelStatements(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public InnerBlockLevelStatementsContext innerBlockLevelStatements() { - InnerBlockLevelStatementsContext _localctx = new InnerBlockLevelStatementsContext(Context, State); - EnterRule(_localctx, 10, RULE_innerBlockLevelStatements); - try { - int _alt; - EnterOuterAlt(_localctx, 1); - { - State = 73; - ErrorHandler.Sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - State = 73; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - case CONTENT_TEXT_NO_ESCAPE_SIMPLE: - { - State = 71; - contentText(); - } - break; - case WS: - case THREAD_ARROW: - case DIVERT_ARROW: - case TUNNEL_ARROW: - { - State = 72; - multiDivert(); - } - break; - default: - throw new NoViableAltException(this); - } - } - break; - default: - throw new NoViableAltException(this); - } - State = 75; - ErrorHandler.Sync(this); - _alt = Interpreter.AdaptivePredict(TokenStream,7,Context); - } while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - - public partial class ContentTextContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CONTENT_TEXT_NO_ESCAPE_SIMPLE() { return GetToken(InkBlotAntlrGrammarParser.CONTENT_TEXT_NO_ESCAPE_SIMPLE, 0); } - public ContentTextContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_contentText; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterContentText(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitContentText(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitContentText(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public ContentTextContext contentText() { - ContentTextContext _localctx = new ContentTextContext(Context, State); - EnterRule(_localctx, 12, RULE_contentText); - try { - EnterOuterAlt(_localctx, 1); - { - State = 77; - Match(CONTENT_TEXT_NO_ESCAPE_SIMPLE); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - - public partial class MixedTextAndLogicContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public MultiDivertContext multiDivert() { - return GetRuleContext(0); - } - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext[] contentText() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) { - return GetRuleContext(i); - } - [System.Diagnostics.DebuggerNonUserCode] public InlineLogicOrGlueOrTagStartContext[] inlineLogicOrGlueOrTagStart() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public InlineLogicOrGlueOrTagStartContext inlineLogicOrGlueOrTagStart(int i) { - return GetRuleContext(i); - } - public MixedTextAndLogicContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_mixedTextAndLogic; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterMixedTextAndLogic(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitMixedTextAndLogic(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitMixedTextAndLogic(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public MixedTextAndLogicContext mixedTextAndLogic() { - MixedTextAndLogicContext _localctx = new MixedTextAndLogicContext(Context, State); - EnterRule(_localctx, 14, RULE_mixedTextAndLogic); - int _la; - try { - EnterOuterAlt(_localctx, 1); - { - State = 80; - ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,8,Context) ) { - case 1: - { - State = 79; - contentText(); - } - break; - } - State = 90; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - do { - { - State = 90; - ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,11,Context) ) { - case 1: - { - State = 83; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==INLINE_LOGIC_START) { - { - State = 82; - inlineLogicOrGlueOrTagStart(); - } - } - - State = 85; - contentText(); - } - break; - case 2: - { - State = 86; - inlineLogicOrGlueOrTagStart(); - State = 88; - ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,10,Context) ) { - case 1: - { - State = 87; - contentText(); - } - break; - } - } - break; - } - } - State = 92; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - } while ( _la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START ); - State = 94; + State = 42; multiDivert(); } } @@ -724,201 +289,6 @@ public partial class InkBlotAntlrGrammarParser : Parser { return _localctx; } - public partial class InlineLogicOrGlueOrTagStartContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public InlineLogicContext inlineLogic() { - return GetRuleContext(0); - } - public InlineLogicOrGlueOrTagStartContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_inlineLogicOrGlueOrTagStart; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterInlineLogicOrGlueOrTagStart(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitInlineLogicOrGlueOrTagStart(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitInlineLogicOrGlueOrTagStart(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public InlineLogicOrGlueOrTagStartContext inlineLogicOrGlueOrTagStart() { - InlineLogicOrGlueOrTagStartContext _localctx = new InlineLogicOrGlueOrTagStartContext(Context, State); - EnterRule(_localctx, 16, RULE_inlineLogicOrGlueOrTagStart); - try { - EnterOuterAlt(_localctx, 1); - { - State = 96; - inlineLogic(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - - public partial class InlineLogicContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INLINE_LOGIC_START() { return GetToken(InkBlotAntlrGrammarParser.INLINE_LOGIC_START, 0); } - [System.Diagnostics.DebuggerNonUserCode] public InnerLogicContext innerLogic() { - return GetRuleContext(0); - } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INLINE_LOGIC_END() { return GetToken(InkBlotAntlrGrammarParser.INLINE_LOGIC_END, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] WS() { return GetTokens(InkBlotAntlrGrammarParser.WS); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS(int i) { - return GetToken(InkBlotAntlrGrammarParser.WS, i); - } - public InlineLogicContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_inlineLogic; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterInlineLogic(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitInlineLogic(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitInlineLogic(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public InlineLogicContext inlineLogic() { - InlineLogicContext _localctx = new InlineLogicContext(Context, State); - EnterRule(_localctx, 18, RULE_inlineLogic); - int _la; - try { - EnterOuterAlt(_localctx, 1); - { - State = 98; - Match(INLINE_LOGIC_START); - State = 100; - ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) { - case 1: - { - State = 99; - Match(WS); - } - break; - } - State = 102; - innerLogic(); - State = 104; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==WS) { - { - State = 103; - Match(WS); - } - } - - State = 106; - Match(INLINE_LOGIC_END); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - - public partial class InnerLogicContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public SequenceTypeAnnotationContext sequenceTypeAnnotation() { - return GetRuleContext(0); - } - [System.Diagnostics.DebuggerNonUserCode] public InnerSequenceObjectsContext innerSequenceObjects() { - return GetRuleContext(0); - } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS() { return GetToken(InkBlotAntlrGrammarParser.WS, 0); } - public InnerLogicContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_innerLogic; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterInnerLogic(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitInnerLogic(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitInnerLogic(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public InnerLogicContext innerLogic() { - InnerLogicContext _localctx = new InnerLogicContext(Context, State); - EnterRule(_localctx, 20, RULE_innerLogic); - int _la; - try { - EnterOuterAlt(_localctx, 1); - { - State = 109; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==WS) { - { - State = 108; - Match(WS); - } - } - - State = 111; - sequenceTypeAnnotation(); - State = 112; - innerSequenceObjects(); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - public partial class MultiDivertContext : ParserRuleContext { [System.Diagnostics.DebuggerNonUserCode] public MultiDivert_withoutWSContext multiDivert_withoutWS() { return GetRuleContext(0); @@ -950,22 +320,22 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public MultiDivertContext multiDivert() { MultiDivertContext _localctx = new MultiDivertContext(Context, State); - EnterRule(_localctx, 22, RULE_multiDivert); + EnterRule(_localctx, 6, RULE_multiDivert); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 115; + State = 45; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 114; + State = 44; Match(WS); } } - State = 117; + State = 47; multiDivert_withoutWS(); } } @@ -1051,19 +421,19 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public MultiDivert_withoutWSContext multiDivert_withoutWS() { MultiDivert_withoutWSContext _localctx = new MultiDivert_withoutWSContext(Context, State); - EnterRule(_localctx, 24, RULE_multiDivert_withoutWS); + EnterRule(_localctx, 8, RULE_multiDivert_withoutWS); try { int _alt; - State = 129; + State = 59; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case THREAD_ARROW: _localctx = new MultiDivertThreadContext(_localctx); EnterOuterAlt(_localctx, 1); { - State = 119; + State = 49; Match(THREAD_ARROW); - State = 120; + State = 50; divertIdentifierWithArguments(); } break; @@ -1072,25 +442,25 @@ public partial class InkBlotAntlrGrammarParser : Parser { _localctx = new MultiDivertArrowsContext(_localctx); EnterOuterAlt(_localctx, 2); { - State = 125; + State = 55; ErrorHandler.Sync(this); - _alt = Interpreter.AdaptivePredict(TokenStream,17,Context); + _alt = Interpreter.AdaptivePredict(TokenStream,4,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - State = 121; + State = 51; Match(DIVERT_ARROW); - State = 122; + State = 52; divertIdentifierWithArguments(); } } } - State = 127; + State = 57; ErrorHandler.Sync(this); - _alt = Interpreter.AdaptivePredict(TokenStream,17,Context); + _alt = Interpreter.AdaptivePredict(TokenStream,4,Context); } - State = 128; + State = 58; multiDivertArrows_tail(); } break; @@ -1211,16 +581,16 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public MultiDivertArrows_tailContext multiDivertArrows_tail() { MultiDivertArrows_tailContext _localctx = new MultiDivertArrows_tailContext(Context, State); - EnterRule(_localctx, 26, RULE_multiDivertArrows_tail); + EnterRule(_localctx, 10, RULE_multiDivertArrows_tail); try { - State = 137; + State = 67; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,19,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,6,Context) ) { case 1: _localctx = new MultiDivertArrows_tailDefaultChoiceContext(_localctx); EnterOuterAlt(_localctx, 1); { - State = 131; + State = 61; Match(DIVERT_ARROW); } break; @@ -1228,9 +598,9 @@ public partial class InkBlotAntlrGrammarParser : Parser { _localctx = new MultiDivertArrows_tailDivertContext(_localctx); EnterOuterAlt(_localctx, 2); { - State = 132; + State = 62; Match(DIVERT_ARROW); - State = 133; + State = 63; divertIdentifierWithArguments(); } break; @@ -1238,9 +608,9 @@ public partial class InkBlotAntlrGrammarParser : Parser { _localctx = new MultiDivertArrows_tailTunnelWithReplacementContext(_localctx); EnterOuterAlt(_localctx, 3); { - State = 134; + State = 64; Match(TUNNEL_ARROW); - State = 135; + State = 65; divertIdentifierWithArguments(); } break; @@ -1248,7 +618,7 @@ public partial class InkBlotAntlrGrammarParser : Parser { _localctx = new MultiDivertArrows_tailTunnelContext(_localctx); EnterOuterAlt(_localctx, 4); { - State = 136; + State = 66; Match(TUNNEL_ARROW); } break; @@ -1273,11 +643,8 @@ public partial class InkBlotAntlrGrammarParser : Parser { [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS(int i) { return GetToken(InkBlotAntlrGrammarParser.WS, i); } - [System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) { - return GetRuleContext(i); + [System.Diagnostics.DebuggerNonUserCode] public DivertIdentifierWithArguments_argumentsContext divertIdentifierWithArguments_arguments() { + return GetRuleContext(0); } public DivertIdentifierWithArgumentsContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) @@ -1305,83 +672,43 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public DivertIdentifierWithArgumentsContext divertIdentifierWithArguments() { DivertIdentifierWithArgumentsContext _localctx = new DivertIdentifierWithArgumentsContext(Context, State); - EnterRule(_localctx, 28, RULE_divertIdentifierWithArguments); + EnterRule(_localctx, 12, RULE_divertIdentifierWithArguments); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 140; - ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,20,Context) ) { - case 1: - { - State = 139; - Match(WS); - } - break; - } - State = 142; + State = 69; divertIdentifierWithArguments_name(); - State = 144; + State = 71; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,21,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,7,Context) ) { case 1: { - State = 143; + State = 70; Match(WS); } break; } - State = 160; + State = 74; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if (_la==T__0) { + if (_la==T__1) { { - State = 146; - Match(T__0); - 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 = 73; + divertIdentifierWithArguments_arguments(); } } - State = 163; + State = 77; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,25,Context) ) { - case 1: + _la = TokenStream.LA(1); + if (_la==WS) { { - State = 162; + State = 76; Match(WS); } - break; } + } } catch (RecognitionException re) { @@ -1432,66 +759,66 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public DivertIdentifierWithArguments_nameContext divertIdentifierWithArguments_name() { DivertIdentifierWithArguments_nameContext _localctx = new DivertIdentifierWithArguments_nameContext(Context, State); - EnterRule(_localctx, 30, RULE_divertIdentifierWithArguments_name); + EnterRule(_localctx, 14, RULE_divertIdentifierWithArguments_name); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 166; + State = 80; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 165; + State = 79; Match(WS); } } - State = 168; + State = 82; identifier(); - State = 170; + State = 84; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,27,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,11,Context) ) { case 1: { - State = 169; + State = 83; Match(WS); } break; } - State = 182; + State = 96; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - while (_la==T__3) { + while (_la==T__0) { { { - State = 172; - Match(T__3); - State = 174; + State = 86; + Match(T__0); + State = 88; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 173; + State = 87; Match(WS); } } - State = 176; + State = 90; identifier(); - State = 178; + State = 92; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,29,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,13,Context) ) { case 1: { - State = 177; + State = 91; Match(WS); } break; } } } - State = 184; + State = 98; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -1545,43 +872,43 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public DivertIdentifierWithArguments_argumentsContext divertIdentifierWithArguments_arguments() { DivertIdentifierWithArguments_argumentsContext _localctx = new DivertIdentifierWithArguments_argumentsContext(Context, State); - EnterRule(_localctx, 32, RULE_divertIdentifierWithArguments_arguments); + EnterRule(_localctx, 16, RULE_divertIdentifierWithArguments_arguments); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 185; - Match(T__0); - State = 186; + State = 99; + Match(T__1); + State = 100; expression(); - State = 194; + State = 108; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - while (_la==T__1) { + while (_la==T__2) { { { - State = 187; - Match(T__1); - State = 189; + State = 101; + Match(T__2); + State = 103; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==WS) { { - State = 188; + State = 102; Match(WS); } } - State = 191; + State = 105; expression(); } } - State = 196; + State = 110; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } - State = 197; - Match(T__2); + State = 111; + Match(T__3); } } catch (RecognitionException re) { @@ -1623,11 +950,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public IdentifierContext identifier() { IdentifierContext _localctx = new IdentifierContext(Context, State); - EnterRule(_localctx, 34, RULE_identifier); + EnterRule(_localctx, 18, RULE_identifier); try { EnterOuterAlt(_localctx, 1); { - State = 199; + State = 113; Match(IDENTIFIER); } } @@ -1670,11 +997,11 @@ public partial class InkBlotAntlrGrammarParser : Parser { [RuleVersion(0)] public ExpressionContext expression() { ExpressionContext _localctx = new ExpressionContext(Context, State); - EnterRule(_localctx, 36, RULE_expression); + EnterRule(_localctx, 20, RULE_expression); try { EnterOuterAlt(_localctx, 1); { - State = 201; + State = 115; Match(IDENTIFIER); } } @@ -1689,554 +1016,42 @@ public partial class InkBlotAntlrGrammarParser : Parser { return _localctx; } - public partial class SequenceTypeAnnotationContext : ParserRuleContext { - public IToken op; - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SEQUENCE_TYPE_SYMBOL_ANNOTATION() { return GetToken(InkBlotAntlrGrammarParser.SEQUENCE_TYPE_SYMBOL_ANNOTATION, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ONCE() { return GetToken(InkBlotAntlrGrammarParser.ONCE, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CYCLE() { return GetToken(InkBlotAntlrGrammarParser.CYCLE, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SHUFFLE() { return GetToken(InkBlotAntlrGrammarParser.SHUFFLE, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STOPPING() { return GetToken(InkBlotAntlrGrammarParser.STOPPING, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SHUFFLE_ONCE() { return GetToken(InkBlotAntlrGrammarParser.SHUFFLE_ONCE, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SHUFFLE_STOPPING() { return GetToken(InkBlotAntlrGrammarParser.SHUFFLE_STOPPING, 0); } - public SequenceTypeAnnotationContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_sequenceTypeAnnotation; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterSequenceTypeAnnotation(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitSequenceTypeAnnotation(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitSequenceTypeAnnotation(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public SequenceTypeAnnotationContext sequenceTypeAnnotation() { - SequenceTypeAnnotationContext _localctx = new SequenceTypeAnnotationContext(Context, State); - EnterRule(_localctx, 38, RULE_sequenceTypeAnnotation); - try { - State = 210; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - case SEQUENCE_TYPE_SYMBOL_ANNOTATION: - EnterOuterAlt(_localctx, 1); - { - State = 203; - _localctx.op = Match(SEQUENCE_TYPE_SYMBOL_ANNOTATION); - } - break; - case ONCE: - EnterOuterAlt(_localctx, 2); - { - State = 204; - Match(ONCE); - } - break; - case CYCLE: - EnterOuterAlt(_localctx, 3); - { - State = 205; - Match(CYCLE); - } - break; - case SHUFFLE: - EnterOuterAlt(_localctx, 4); - { - State = 206; - Match(SHUFFLE); - } - break; - case STOPPING: - EnterOuterAlt(_localctx, 5); - { - State = 207; - Match(STOPPING); - } - break; - case SHUFFLE_ONCE: - EnterOuterAlt(_localctx, 6); - { - State = 208; - Match(SHUFFLE_ONCE); - } - break; - case SHUFFLE_STOPPING: - EnterOuterAlt(_localctx, 7); - { - State = 209; - Match(SHUFFLE_STOPPING); - } - 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 InnerSequenceObjectsContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NL() { return GetToken(InkBlotAntlrGrammarParser.NL, 0); } - [System.Diagnostics.DebuggerNonUserCode] public InnerMultilineSequenceObjectsContext innerMultilineSequenceObjects() { - return GetRuleContext(0); - } - [System.Diagnostics.DebuggerNonUserCode] public InnerInlineSequenceObjectsContext innerInlineSequenceObjects() { - return GetRuleContext(0); - } - public InnerSequenceObjectsContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_innerSequenceObjects; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterInnerSequenceObjects(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitInnerSequenceObjects(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitInnerSequenceObjects(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public InnerSequenceObjectsContext innerSequenceObjects() { - InnerSequenceObjectsContext _localctx = new InnerSequenceObjectsContext(Context, State); - EnterRule(_localctx, 40, RULE_innerSequenceObjects); - try { - State = 215; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - case NL: - EnterOuterAlt(_localctx, 1); - { - State = 212; - Match(NL); - State = 213; - innerMultilineSequenceObjects(); - } - break; - case T__5: - case CONTENT_TEXT_NO_ESCAPE_SIMPLE: - case INLINE_LOGIC_START: - EnterOuterAlt(_localctx, 2); - { - State = 214; - innerInlineSequenceObjects(); - } - 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 InnerMultilineSequenceObjectsContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public SingleMultilineSequenceElementContext[] singleMultilineSequenceElement() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public SingleMultilineSequenceElementContext singleMultilineSequenceElement(int i) { - return GetRuleContext(i); - } - public InnerMultilineSequenceObjectsContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_innerMultilineSequenceObjects; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterInnerMultilineSequenceObjects(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitInnerMultilineSequenceObjects(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitInnerMultilineSequenceObjects(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public InnerMultilineSequenceObjectsContext innerMultilineSequenceObjects() { - InnerMultilineSequenceObjectsContext _localctx = new InnerMultilineSequenceObjectsContext(Context, State); - EnterRule(_localctx, 42, RULE_innerMultilineSequenceObjects); - try { - int _alt; - EnterOuterAlt(_localctx, 1); - { - State = 218; - ErrorHandler.Sync(this); - _alt = 1; - do { - switch (_alt) { - case 1: - { - { - State = 217; - singleMultilineSequenceElement(); - } - } - break; - default: - throw new NoViableAltException(this); - } - State = 220; - ErrorHandler.Sync(this); - _alt = Interpreter.AdaptivePredict(TokenStream,35,Context); - } while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - - public partial class SingleMultilineSequenceElementContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public InnerBlockLevelStatementsContext innerBlockLevelStatements() { - return GetRuleContext(0); - } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MULTILINE_WS() { return GetToken(InkBlotAntlrGrammarParser.MULTILINE_WS, 0); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] WS() { return GetTokens(InkBlotAntlrGrammarParser.WS); } - [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode WS(int i) { - return GetToken(InkBlotAntlrGrammarParser.WS, i); - } - public SingleMultilineSequenceElementContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_singleMultilineSequenceElement; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterSingleMultilineSequenceElement(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitSingleMultilineSequenceElement(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitSingleMultilineSequenceElement(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public SingleMultilineSequenceElementContext singleMultilineSequenceElement() { - SingleMultilineSequenceElementContext _localctx = new SingleMultilineSequenceElementContext(Context, State); - EnterRule(_localctx, 44, RULE_singleMultilineSequenceElement); - int _la; - try { - EnterOuterAlt(_localctx, 1); - { - State = 223; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==WS) { - { - State = 222; - Match(WS); - } - } - - State = 225; - Match(T__4); - State = 227; - ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,37,Context) ) { - case 1: - { - State = 226; - Match(WS); - } - break; - } - State = 231; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - case WS: - case CONTENT_TEXT_NO_ESCAPE_SIMPLE: - case THREAD_ARROW: - case DIVERT_ARROW: - case TUNNEL_ARROW: - { - State = 229; - innerBlockLevelStatements(); - } - break; - case MULTILINE_WS: - { - State = 230; - Match(MULTILINE_WS); - } - 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 InnerInlineSequenceObjectsContext : ParserRuleContext { - [System.Diagnostics.DebuggerNonUserCode] public MixedTextAndLogicContext[] mixedTextAndLogic() { - return GetRuleContexts(); - } - [System.Diagnostics.DebuggerNonUserCode] public MixedTextAndLogicContext mixedTextAndLogic(int i) { - return GetRuleContext(i); - } - public InnerInlineSequenceObjectsContext(ParserRuleContext parent, int invokingState) - : base(parent, invokingState) - { - } - public override int RuleIndex { get { return RULE_innerInlineSequenceObjects; } } - [System.Diagnostics.DebuggerNonUserCode] - public override void EnterRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.EnterInnerInlineSequenceObjects(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override void ExitRule(IParseTreeListener listener) { - IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener; - if (typedListener != null) typedListener.ExitInnerInlineSequenceObjects(this); - } - [System.Diagnostics.DebuggerNonUserCode] - public override TResult Accept(IParseTreeVisitor visitor) { - IInkBlotAntlrGrammarVisitor typedVisitor = visitor as IInkBlotAntlrGrammarVisitor; - if (typedVisitor != null) return typedVisitor.VisitInnerInlineSequenceObjects(this); - else return visitor.VisitChildren(this); - } - } - - [RuleVersion(0)] - public InnerInlineSequenceObjectsContext innerInlineSequenceObjects() { - InnerInlineSequenceObjectsContext _localctx = new InnerInlineSequenceObjectsContext(Context, State); - EnterRule(_localctx, 46, RULE_innerInlineSequenceObjects); - int _la; - try { - State = 251; - ErrorHandler.Sync(this); - switch (TokenStream.LA(1)) { - case CONTENT_TEXT_NO_ESCAPE_SIMPLE: - case INLINE_LOGIC_START: - EnterOuterAlt(_localctx, 1); - { - { - State = 233; - mixedTextAndLogic(); - State = 240; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - while (_la==T__5) { - { - { - State = 234; - Match(T__5); - State = 236; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START) { - { - State = 235; - mixedTextAndLogic(); - } - } - - } - } - State = 242; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - } - } - } - break; - case T__5: - EnterOuterAlt(_localctx, 2); - { - State = 247; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - do { - { - { - State = 243; - Match(T__5); - State = 245; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==CONTENT_TEXT_NO_ESCAPE_SIMPLE || _la==INLINE_LOGIC_START) { - { - State = 244; - mixedTextAndLogic(); - } - } - - } - } - State = 249; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - } while ( _la==T__5 ); - } - break; - default: - throw new NoViableAltException(this); - } - } - catch (RecognitionException re) { - _localctx.exception = re; - ErrorHandler.ReportError(this, re); - ErrorHandler.Recover(this, re); - } - finally { - ExitRule(); - } - return _localctx; - } - private static int[] _serializedATN = { - 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 + 4,1,10,118,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,1,0,1,0,1,1,1,1,4,1,27,8,1,11,1,12,1,28, + 1,1,5,1,32,8,1,10,1,12,1,35,9,1,1,1,5,1,38,8,1,10,1,12,1,41,9,1,1,2,1, + 2,1,3,3,3,46,8,3,1,3,1,3,1,4,1,4,1,4,1,4,5,4,54,8,4,10,4,12,4,57,9,4,1, + 4,3,4,60,8,4,1,5,1,5,1,5,1,5,1,5,1,5,3,5,68,8,5,1,6,1,6,3,6,72,8,6,1,6, + 3,6,75,8,6,1,6,3,6,78,8,6,1,7,3,7,81,8,7,1,7,1,7,3,7,85,8,7,1,7,1,7,3, + 7,89,8,7,1,7,1,7,3,7,93,8,7,5,7,95,8,7,10,7,12,7,98,9,7,1,8,1,8,1,8,1, + 8,3,8,104,8,8,1,8,5,8,107,8,8,10,8,12,8,110,9,8,1,8,1,8,1,9,1,9,1,10,1, + 10,1,10,0,0,11,0,2,4,6,8,10,12,14,16,18,20,0,0,125,0,22,1,0,0,0,2,24,1, + 0,0,0,4,42,1,0,0,0,6,45,1,0,0,0,8,59,1,0,0,0,10,67,1,0,0,0,12,69,1,0,0, + 0,14,80,1,0,0,0,16,99,1,0,0,0,18,113,1,0,0,0,20,115,1,0,0,0,22,23,3,2, + 1,0,23,1,1,0,0,0,24,33,3,4,2,0,25,27,5,10,0,0,26,25,1,0,0,0,27,28,1,0, + 0,0,28,26,1,0,0,0,28,29,1,0,0,0,29,30,1,0,0,0,30,32,3,4,2,0,31,26,1,0, + 0,0,32,35,1,0,0,0,33,31,1,0,0,0,33,34,1,0,0,0,34,39,1,0,0,0,35,33,1,0, + 0,0,36,38,5,10,0,0,37,36,1,0,0,0,38,41,1,0,0,0,39,37,1,0,0,0,39,40,1,0, + 0,0,40,3,1,0,0,0,41,39,1,0,0,0,42,43,3,6,3,0,43,5,1,0,0,0,44,46,5,9,0, + 0,45,44,1,0,0,0,45,46,1,0,0,0,46,47,1,0,0,0,47,48,3,8,4,0,48,7,1,0,0,0, + 49,50,5,5,0,0,50,60,3,12,6,0,51,52,5,6,0,0,52,54,3,12,6,0,53,51,1,0,0, + 0,54,57,1,0,0,0,55,53,1,0,0,0,55,56,1,0,0,0,56,58,1,0,0,0,57,55,1,0,0, + 0,58,60,3,10,5,0,59,49,1,0,0,0,59,55,1,0,0,0,60,9,1,0,0,0,61,68,5,6,0, + 0,62,63,5,6,0,0,63,68,3,12,6,0,64,65,5,7,0,0,65,68,3,12,6,0,66,68,5,7, + 0,0,67,61,1,0,0,0,67,62,1,0,0,0,67,64,1,0,0,0,67,66,1,0,0,0,68,11,1,0, + 0,0,69,71,3,14,7,0,70,72,5,9,0,0,71,70,1,0,0,0,71,72,1,0,0,0,72,74,1,0, + 0,0,73,75,3,16,8,0,74,73,1,0,0,0,74,75,1,0,0,0,75,77,1,0,0,0,76,78,5,9, + 0,0,77,76,1,0,0,0,77,78,1,0,0,0,78,13,1,0,0,0,79,81,5,9,0,0,80,79,1,0, + 0,0,80,81,1,0,0,0,81,82,1,0,0,0,82,84,3,18,9,0,83,85,5,9,0,0,84,83,1,0, + 0,0,84,85,1,0,0,0,85,96,1,0,0,0,86,88,5,1,0,0,87,89,5,9,0,0,88,87,1,0, + 0,0,88,89,1,0,0,0,89,90,1,0,0,0,90,92,3,18,9,0,91,93,5,9,0,0,92,91,1,0, + 0,0,92,93,1,0,0,0,93,95,1,0,0,0,94,86,1,0,0,0,95,98,1,0,0,0,96,94,1,0, + 0,0,96,97,1,0,0,0,97,15,1,0,0,0,98,96,1,0,0,0,99,100,5,2,0,0,100,108,3, + 20,10,0,101,103,5,3,0,0,102,104,5,9,0,0,103,102,1,0,0,0,103,104,1,0,0, + 0,104,105,1,0,0,0,105,107,3,20,10,0,106,101,1,0,0,0,107,110,1,0,0,0,108, + 106,1,0,0,0,108,109,1,0,0,0,109,111,1,0,0,0,110,108,1,0,0,0,111,112,5, + 4,0,0,112,17,1,0,0,0,113,114,5,8,0,0,114,19,1,0,0,0,115,116,5,8,0,0,116, + 21,1,0,0,0,17,28,33,39,45,55,59,67,71,74,77,80,84,88,92,96,103,108 }; public static readonly ATN _ATN = diff --git a/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs b/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs index fce10ec..a751101 100644 --- a/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs +++ b/InkBlot/Generated/InkBlotAntlrGrammarVisitor.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -// Generated from C:/Users/mbelletti/RiderProjects/inkblot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 +// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2 // Unreachable code detected #pragma warning disable 0162 @@ -50,54 +50,6 @@ public interface IInkBlotAntlrGrammarVisitor : IParseTreeVisitor /// The visitor result. Result VisitTopLevelStatement([NotNull] InkBlotAntlrGrammarParser.TopLevelStatementContext context); /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitKnotLevelStatements([NotNull] InkBlotAntlrGrammarParser.KnotLevelStatementsContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitStitchLevelStatements([NotNull] InkBlotAntlrGrammarParser.StitchLevelStatementsContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitInnerBlockLevelStatements([NotNull] InkBlotAntlrGrammarParser.InnerBlockLevelStatementsContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitContentText([NotNull] InkBlotAntlrGrammarParser.ContentTextContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitMixedTextAndLogic([NotNull] InkBlotAntlrGrammarParser.MixedTextAndLogicContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitInlineLogicOrGlueOrTagStart([NotNull] InkBlotAntlrGrammarParser.InlineLogicOrGlueOrTagStartContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitInlineLogic([NotNull] InkBlotAntlrGrammarParser.InlineLogicContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitInnerLogic([NotNull] InkBlotAntlrGrammarParser.InnerLogicContext context); - /// /// Visit a parse tree produced by . /// /// The parse tree. @@ -175,34 +127,4 @@ public interface IInkBlotAntlrGrammarVisitor : IParseTreeVisitor /// The parse tree. /// The visitor result. Result VisitExpression([NotNull] InkBlotAntlrGrammarParser.ExpressionContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitSequenceTypeAnnotation([NotNull] InkBlotAntlrGrammarParser.SequenceTypeAnnotationContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitInnerSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerSequenceObjectsContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitInnerMultilineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerMultilineSequenceObjectsContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitSingleMultilineSequenceElement([NotNull] InkBlotAntlrGrammarParser.SingleMultilineSequenceElementContext context); - /// - /// Visit a parse tree produced by . - /// - /// The parse tree. - /// The visitor result. - Result VisitInnerInlineSequenceObjects([NotNull] InkBlotAntlrGrammarParser.InnerInlineSequenceObjectsContext context); } diff --git a/InkBlot/InkBlotAntlrGrammar.g4 b/InkBlot/InkBlotAntlrGrammar.g4 index d05863c..3495b75 100644 --- a/InkBlot/InkBlotAntlrGrammar.g4 +++ b/InkBlot/InkBlotAntlrGrammar.g4 @@ -13,68 +13,72 @@ story: topLevelStatements ; */ topLevelStatements: - topLevelStatement+ + topLevelStatement (NL+ topLevelStatement)* NL* ; topLevelStatement: multiDivert - | contentText - ; - - knotLevelStatements: - (contentText - | multiDivert - )+ - ; - - stitchLevelStatements: - (contentText - | multiDivert - )+ - ; - - innerBlockLevelStatements: - (contentText - | multiDivert - )+ - ; - -/* - * STATEMENTS - */ - -contentText: CONTENT_TEXT_NO_ESCAPE_SIMPLE ; - -mixedTextAndLogic: - // TODO: ~ is not allowed as first symbol of this (see InkParser_Content => MixedTextAndLog), let's implement it in the C# side? - // like in innerInlineSequenceObjects, a bit of a chaos to avoid having completely empty entries - contentText? (inlineLogicOrGlueOrTagStart? contentText | inlineLogicOrGlueOrTagStart contentText?)+ - // TODO: this is valid only when not parsing a choice, see above for the code where this logic is implemented - multiDivert - // TODO: management of tag ftw O_O - ; - -inlineLogicOrGlueOrTagStart: - inlineLogic - // TODO: glue, tag start - ; - -inlineLogic: - INLINE_LOGIC_START - WS? - innerLogic - // TODO: += and -= are disabled here (don't know why, maybe because they're statements?) - WS? - INLINE_LOGIC_END - // TODO: tags ftw - ; - -innerLogic: - WS? - sequenceTypeAnnotation innerSequenceObjects - // TODO: the rest of InkParser_Logic => InnerLogic ; +//topLevelStatement: +// multiDivert +// | contentText +// ; +// +// knotLevelStatements: +// (contentText +// | multiDivert +// )+ +// ; +// +// stitchLevelStatements: +// (contentText +// | multiDivert +// )+ +// ; +// +// innerBlockLevelStatements: +// (contentText +// | multiDivert +// )+ +// ; +// +///* +// * STATEMENTS +// */ +// +//contentText: (CONTENT_TEXT_NO_ESCAPE_NO_IDENT_SIMPLE | IDENTIFIER | WS | SEQUENCE_TYPE_SYMBOL_ANNOTATION | '&' | '$' | '!')+ ; +// +//mixedTextAndLogic: +// // TODO: ~ is not allowed as first symbol of this (see InkParser_Content => MixedTextAndLog), let's implement it in the C# side? +// // like in innerInlineSequenceObjects, a bit of a chaos to avoid having completely empty entries +// contentText? (inlineLogicOrGlueOrTagStart? contentText | inlineLogicOrGlueOrTagStart contentText?)+ +// // TODO: this is valid only when not parsing a choice, see above for the code where this logic is implemented +// multiDivert +// // TODO: management of tag ftw O_O +// ; +// +//inlineLogicOrGlueOrTagStart: +// inlineLogic +// // TODO: glue, tag start +// ; +// +//inlineLogic: +// INLINE_LOGIC_START +// WS? +// innerLogic +// // TODO: += and -= are disabled here (don't know why, maybe because they're statements?) +// WS? +// INLINE_LOGIC_END +// // TODO: tags ftw +// ; +// +//innerLogic: +// WS? +// sequenceTypeAnnotation innerSequenceObjects +// // TODO: the rest of InkParser_Logic => InnerLogic +// ; +// multiDivert: WS? multiDivert_withoutWS @@ -97,21 +101,16 @@ multiDivertArrows_tail: ; divertIdentifierWithArguments: - WS? divertIdentifierWithArguments_name WS? - ( - '(' - expression (',' WS? expression)* - ')' - )? + divertIdentifierWithArguments_arguments? WS? ; divertIdentifierWithArguments_name: WS? identifier WS? ('.' WS? identifier WS? )* ; - + divertIdentifierWithArguments_arguments: '(' expression (',' WS? expression)* @@ -128,45 +127,45 @@ expression: IDENTIFIER ; -// all possible symbols or word(s) for sequencing -sequenceTypeAnnotation: - op=SEQUENCE_TYPE_SYMBOL_ANNOTATION - | ONCE - | CYCLE - | SHUFFLE - | STOPPING - | SHUFFLE_ONCE - | SHUFFLE_STOPPING - ; - -/* a list of sequence objects, either compressed in a single line (e.g.: {a|b|c}) or expanded in multiple lines (e.g.: -{\n- a\n- b\n- c} -*/ -innerSequenceObjects: - NL innerMultilineSequenceObjects - | innerInlineSequenceObjects - ; - -innerMultilineSequenceObjects: - singleMultilineSequenceElement+ - ; - -singleMultilineSequenceElement: - WS? - /* TODO: how to express this? and why is it here? InkParser_Sequences => SingleMultilineSequenceElement - if (ParseString ("->") != null) - return null; - */ - '-' - WS? - ( - innerBlockLevelStatements - | MULTILINE_WS - ) - ; - -innerInlineSequenceObjects: - // it's a bit chaotic, in order to allow for empty mixedTextAndLogic, but always require at least one entry - (mixedTextAndLogic ('|' mixedTextAndLogic?)*) - | ('|' mixedTextAndLogic?)+ - ; \ No newline at end of file +//// all possible symbols or word(s) for sequencing +//sequenceTypeAnnotation: +// op=SEQUENCE_TYPE_SYMBOL_ANNOTATION +// | 'once' WS? ':' +// | 'cycle' WS? ':' +// | 'shuffle' WS? ':' +// | 'stopping' WS? ':' +// | 'shuffle' WS 'once' WS? ':' +// | 'shuffle' WS 'stopping' WS? ':' +// ; +// +///* a list of sequence objects, either compressed in a single line (e.g.: {a|b|c}) or expanded in multiple lines (e.g.: +//{\n- a\n- b\n- c} +//*/ +//innerSequenceObjects: +// NL innerMultilineSequenceObjects +// | innerInlineSequenceObjects +// ; +// +//innerMultilineSequenceObjects: +// singleMultilineSequenceElement+ +// ; +// +//singleMultilineSequenceElement: +// WS? +// /* TODO: how to express this? and why is it here? InkParser_Sequences => SingleMultilineSequenceElement +// if (ParseString ("->") != null) +// return null; +// */ +// '-' +// WS? +// ( +// innerBlockLevelStatements +// | MULTILINE_WS +// ) +// ; +// +//innerInlineSequenceObjects: +// // it's a bit chaotic, in order to allow for empty mixedTextAndLogic, but always require at least one entry +// (mixedTextAndLogic ('|' mixedTextAndLogic?)*) +// | ('|' mixedTextAndLogic?)+ +// ; \ No newline at end of file diff --git a/InkBlot/InkBlotAntlrLexer.g4 b/InkBlot/InkBlotAntlrLexer.g4 index 529bf83..847a609 100644 --- a/InkBlot/InkBlotAntlrLexer.g4 +++ b/InkBlot/InkBlotAntlrLexer.g4 @@ -1,47 +1,52 @@ lexer grammar InkBlotAntlrLexer; -// classic "white space" and "new line" - ink's new line also allows for some whitespace at start -WS: [ \t]+ ; -NL: WS? '\r'? '\n' ; - -// one or more (potential whitespace followed by) newline(s); used e.g. for block sequencing -MULTILINE_WS: NL+ ; - -// see InkParser_Content.cs, ContentTextNoEscape and ContentTextAllowingEcapeChar for the escape case -// this works for the base case where we're not parsing a string, nor a choice -CONTENT_TEXT_NO_ESCAPE_SIMPLE: - ( - // any character is valid, except for: - // - {} ==> identifies embedded logic - // - | ==> text alternatives, is forbidden even in non-logic text for some reason - // - \n\r ==> a new line of content - // - # ==> a tag - // - \, < and - with exceptions (see below) - ~[{}|\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) != '>' }? - )+ ; - -INLINE_LOGIC_START: '{' ; -INLINE_LOGIC_END: '}' ; - -// All symbols for sequencing: either using the short-hand symbols (https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#types-of-alternatives) -// or using the multiline blocks (https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#multiline-blocks) -SEQUENCE_TYPE_SYMBOL_ANNOTATION: [!&~$ ] ; -ONCE: 'once' WS? ':' ; -CYCLE: 'cycle' WS? ':' ; -SHUFFLE: 'shuffle' WS? ':' ; -STOPPING: 'stopping' WS? ':' ; -SHUFFLE_ONCE: 'shuffle' WS 'once' WS? ':' ; -SHUFFLE_STOPPING: 'shuffle' WS 'stopping' WS? ':' ; - THREAD_ARROW: '<-' ; DIVERT_ARROW: '->' ; TUNNEL_ARROW: '->->' ; -// TODO: add all extra character ranges from InkParser_CharacterRanges (LatinBasic, LatinExtendedA, ...) -IDENTIFIER: [A-Za-z0-9_]+; \ No newline at end of file +IDENTIFIER: [a-zA-Z0-9_]+; + +//// classic "white space" and "new line" - ink's new line also allows for some whitespace at start +WS: [ \t]+ ; +NL: WS? '\r'? '\n' ; +// +//// one or more (potential whitespace followed by) newline(s); used e.g. for block sequencing +//MULTILINE_WS: NL+ ; +// +//// see InkParser_Content.cs, ContentTextNoEscape and ContentTextAllowingEcapeChar for the escape case +//// this works for the base case where we're not parsing a string, nor a choice +//// We ALSO have to remove all other tokens from here, otherwise this will gobble them all up, since it will become +//// the longest-matching token +//CONTENT_TEXT_NO_ESCAPE_NO_IDENT_SIMPLE: +// ( +// // any character is valid, except for: +// // - {} ==> identifies embedded logic +// // - | ==> text alternatives, is forbidden even in non-logic text for some reason +// // - \n\r ==> a new line of content +// // - # ==> a tag +// // - \, < and - with exceptions (see below) +// // - space and \t ==> these are used to parse spaces +// // a-z, A-Z, 0-9 and _ ==> these are used to parse identifiers TODO: add missing characters +// // !&$ ==> these are used by as sequence type symbol annotation; "~" too but that is special +// ~[{}|\n\r\\#\-< \ta-zA-Z0-9_!&$] +// // 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) != '>' }? +// )+ ; +// +//INLINE_LOGIC_START: '{' ; +//INLINE_LOGIC_END: '}' ; +// +//// All symbols for sequencing: either using the short-hand symbols (https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#types-of-alternatives) +//// or using the multiline blocks (https://github.com/inkle/ink/blob/master/Documentation/WritingWithInk.md#multiline-blocks) +//SEQUENCE_TYPE_SYMBOL_ANNOTATION: [!&~$ ] ; +// +//THREAD_ARROW: '<-' ; +//DIVERT_ARROW: '->' ; +//TUNNEL_ARROW: '->->' ; +// +//// TODO: add all extra character ranges from InkParser_CharacterRanges (LatinBasic, LatinExtendedA, ...), and also remove them from CONTENT_TEXT_NO_ESCAPE_SIMPLE +//IDENTIFIER: [a-zA-Z0-9_]+; \ No newline at end of file diff --git a/InkBlot/ParseHierarchy/MultiDivert.cs b/InkBlot/ParseHierarchy/MultiDivert.cs index fc96d1f..ecf5eb3 100644 --- a/InkBlot/ParseHierarchy/MultiDivert.cs +++ b/InkBlot/ParseHierarchy/MultiDivert.cs @@ -7,12 +7,42 @@ public partial class MultiDivert : OneOfBase, IStoryNode { + public override bool Equals(object? obj) + { + if (obj is OneOfBase divert) + Console.WriteLine("it actually is fuck"); + + var rv = base.Equals(obj); + return rv; + } } -public record Identifier(string[] Elements /* TODO: expressions */); +public record Identifier(string[] Elements /* TODO: expressions */) +{ + public virtual bool Equals(Identifier? other) + { + return other is not null && Elements.SequenceEqual(other.Elements); + } + + public override string ToString() + { + return "Identifier(" + string.Join('.', Elements) + ")"; + } + + public override int GetHashCode() + { + return Elements.GetHashCode(); + } +} // <- thread_name -public record ThreadDivert(Identifier Identifier) : IStoryNode; +public record ThreadDivert(Identifier Identifier) : IStoryNode +{ + public override string ToString() + { + return $"ThreadDivert({Identifier})"; + } +} // -> ... ->-> // return from tunnel // or diff --git a/InkBlot/ParserErrorListener.cs b/InkBlot/ParserErrorListener.cs index 53073b3..958595d 100644 --- a/InkBlot/ParserErrorListener.cs +++ b/InkBlot/ParserErrorListener.cs @@ -1,8 +1,5 @@ using System.Text; using Antlr4.Runtime; -using Antlr4.Runtime.Atn; -using Antlr4.Runtime.Dfa; -using Antlr4.Runtime.Sharpen; namespace InkBlot; @@ -59,13 +56,13 @@ internal sealed class ParserErrorListener : BaseErrorListener Diagnostics.Add(diagnostic); } - // TODO: better to use a "if test" of some kind? -#if DEBUG - public override void ReportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, bool exact, - BitSet ambigAlts, - ATNConfigSet configs) - { - throw new InvalidOperationException("found ambiguity"); - } -#endif +// // TODO: better to use a "if test" of some kind? +// #if DEBUG +// public override void ReportAmbiguity(Parser recognizer, DFA dfa, int startIndex, int stopIndex, bool exact, +// BitSet ambigAlts, +// ATNConfigSet configs) +// { +// throw new InvalidOperationException("found ambiguity"); +// } +// #endif } \ No newline at end of file diff --git a/InkBlot/Visitor/ListenerContentText.cs b/InkBlot/Visitor/ListenerContentText.cs_ similarity index 90% rename from InkBlot/Visitor/ListenerContentText.cs rename to InkBlot/Visitor/ListenerContentText.cs_ index a838935..3af1ec1 100644 --- a/InkBlot/Visitor/ListenerContentText.cs +++ b/InkBlot/Visitor/ListenerContentText.cs_ @@ -13,7 +13,7 @@ public partial class Listener public override void ExitContentText(InkBlotAntlrGrammarParser.ContentTextContext context) { // escape sequences are captured by this node, but not interpreted - var contentWithEscapes = context.CONTENT_TEXT_NO_ESCAPE_SIMPLE().ToString(); + var contentWithEscapes = context.ToString(); if (contentWithEscapes == null) // when does this happen? :? throw new InvalidOperationException(); diff --git a/InkBlot/Visitor/ListenerMultiDivert.cs b/InkBlot/Visitor/ListenerMultiDivert.cs index 71a4a07..6937d38 100644 --- a/InkBlot/Visitor/ListenerMultiDivert.cs +++ b/InkBlot/Visitor/ListenerMultiDivert.cs @@ -1,6 +1,5 @@ using Antlr4.Runtime.Tree; using InkBlot.ParseHierarchy; -using Microsoft.Extensions.Logging; namespace InkBlot.Visitor; @@ -12,6 +11,11 @@ public partial class Listener private readonly ParseTreeProperty _multiDivertsArrowsTail = new(); + public override void ExitMultiDivert(InkBlotAntlrGrammarParser.MultiDivertContext context) + { + PutStoryNode(context, _multiDiverts.Get(context)); + } + public override void ExitMultiDivertThread(InkBlotAntlrGrammarParser.MultiDivertThreadContext context) { var threadDivert = new ThreadDivert( @@ -69,7 +73,7 @@ public partial class Listener public override void ExitDivertIdentifierWithArguments_name( InkBlotAntlrGrammarParser.DivertIdentifierWithArguments_nameContext context) { - var name = context.identifier().Select(identifier => identifier.ToString().AsNotNull()).ToArray(); + var name = context.identifier().Select(identifier => identifier.IDENTIFIER().ToString().AsNotNull()).ToArray(); _divertIdentifierNames.Put(context.Parent, name); } @@ -82,14 +86,8 @@ public partial class Listener 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); + var name = _divertIdentifierNames.Get(context); + if (name == null) throw new InvalidOperationException("parsing logic error"); _divertIdentifiers.Put(context, new Identifier(name)); } diff --git a/InkBlot/Visitor/ListenerStory.cs b/InkBlot/Visitor/ListenerStory.cs index 1f1f38b..869d9bb 100644 --- a/InkBlot/Visitor/ListenerStory.cs +++ b/InkBlot/Visitor/ListenerStory.cs @@ -1,13 +1,26 @@ -using InkBlot.ParseHierarchy; +using Antlr4.Runtime.Tree; +using InkBlot.ParseHierarchy; namespace InkBlot.Visitor; public partial class Listener { + private readonly ParseTreeProperty _storyNodeValue = new(); private Story? _story; public Story Story => _story ?? throw new InvalidOperationException("No story found yet."); + private void PutStoryNode(IParseTree tree, IStoryNode storyNode) + { + _storyNodeValue.Put(tree, storyNode); + } + + private IStoryNode GetStoryNode(IParseTree tree) + { + return _storyNodeValue.Get(tree); + } + + public override void ExitStory(InkBlotAntlrGrammarParser.StoryContext context) { var storyNodes = context diff --git a/InkBlot/Visitor/ListenerStoryNode.cs b/InkBlot/Visitor/ListenerStoryNode.cs deleted file mode 100644 index 98a75ca..0000000 --- a/InkBlot/Visitor/ListenerStoryNode.cs +++ /dev/null @@ -1,19 +0,0 @@ -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