206 lines
6.7 KiB
C#
206 lines
6.7 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// ANTLR Version: 4.13.2
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
// Generated from E:/ProgettiUnity/InkAntlr/InkBlot/InkBlot/InkBlotAntlrGrammar.g4 by ANTLR 4.13.2
|
|
|
|
// Unreachable code detected
|
|
#pragma warning disable 0162
|
|
// The variable '...' is assigned but its value is never used
|
|
#pragma warning disable 0219
|
|
// Missing XML comment for publicly visible type or member '...'
|
|
#pragma warning disable 1591
|
|
// Ambiguous reference in cref attribute
|
|
#pragma warning disable 419
|
|
|
|
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Diagnostics;
|
|
using System.Collections.Generic;
|
|
using Antlr4.Runtime;
|
|
using Antlr4.Runtime.Atn;
|
|
using Antlr4.Runtime.Misc;
|
|
using Antlr4.Runtime.Tree;
|
|
using DFA = Antlr4.Runtime.Dfa.DFA;
|
|
|
|
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.2")]
|
|
[System.CLSCompliant(false)]
|
|
public partial class InkBlotAntlrGrammarParser : Parser {
|
|
protected static DFA[] decisionToDFA;
|
|
protected static PredictionContextCache sharedContextCache = new PredictionContextCache();
|
|
public const int
|
|
Whitespace=1, CONTENT_TEXT_NO_ESCAPE_SIMPLE=2;
|
|
public const int
|
|
RULE_story = 0, RULE_contentText = 1;
|
|
public static readonly string[] ruleNames = {
|
|
"story", "contentText"
|
|
};
|
|
|
|
private static readonly string[] _LiteralNames = {
|
|
};
|
|
private static readonly string[] _SymbolicNames = {
|
|
null, "Whitespace", "CONTENT_TEXT_NO_ESCAPE_SIMPLE"
|
|
};
|
|
public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
|
|
|
|
[NotNull]
|
|
public override IVocabulary Vocabulary
|
|
{
|
|
get
|
|
{
|
|
return DefaultVocabulary;
|
|
}
|
|
}
|
|
|
|
public override string GrammarFileName { get { return "InkBlotAntlrGrammar.g4"; } }
|
|
|
|
public override string[] RuleNames { get { return ruleNames; } }
|
|
|
|
public override int[] SerializedAtn { get { return _serializedATN; } }
|
|
|
|
static InkBlotAntlrGrammarParser() {
|
|
decisionToDFA = new DFA[_ATN.NumberOfDecisions];
|
|
for (int i = 0; i < _ATN.NumberOfDecisions; i++) {
|
|
decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i);
|
|
}
|
|
}
|
|
|
|
public InkBlotAntlrGrammarParser(ITokenStream input) : this(input, Console.Out, Console.Error) { }
|
|
|
|
public InkBlotAntlrGrammarParser(ITokenStream input, TextWriter output, TextWriter errorOutput)
|
|
: base(input, output, errorOutput)
|
|
{
|
|
Interpreter = new ParserATNSimulator(this, _ATN, decisionToDFA, sharedContextCache);
|
|
}
|
|
|
|
public partial class StoryContext : ParserRuleContext {
|
|
[System.Diagnostics.DebuggerNonUserCode] public ContentTextContext[] contentText() {
|
|
return GetRuleContexts<ContentTextContext>();
|
|
}
|
|
[System.Diagnostics.DebuggerNonUserCode] public ContentTextContext contentText(int i) {
|
|
return GetRuleContext<ContentTextContext>(i);
|
|
}
|
|
public StoryContext(ParserRuleContext parent, int invokingState)
|
|
: base(parent, invokingState)
|
|
{
|
|
}
|
|
public override int RuleIndex { get { return RULE_story; } }
|
|
[System.Diagnostics.DebuggerNonUserCode]
|
|
public override void EnterRule(IParseTreeListener listener) {
|
|
IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
|
|
if (typedListener != null) typedListener.EnterStory(this);
|
|
}
|
|
[System.Diagnostics.DebuggerNonUserCode]
|
|
public override void ExitRule(IParseTreeListener listener) {
|
|
IInkBlotAntlrGrammarListener typedListener = listener as IInkBlotAntlrGrammarListener;
|
|
if (typedListener != null) typedListener.ExitStory(this);
|
|
}
|
|
[System.Diagnostics.DebuggerNonUserCode]
|
|
public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
|
|
IInkBlotAntlrGrammarVisitor<TResult> typedVisitor = visitor as IInkBlotAntlrGrammarVisitor<TResult>;
|
|
if (typedVisitor != null) return typedVisitor.VisitStory(this);
|
|
else return visitor.VisitChildren(this);
|
|
}
|
|
}
|
|
|
|
[RuleVersion(0)]
|
|
public StoryContext story() {
|
|
StoryContext _localctx = new StoryContext(Context, State);
|
|
EnterRule(_localctx, 0, RULE_story);
|
|
int _la;
|
|
try {
|
|
EnterOuterAlt(_localctx, 1);
|
|
{
|
|
State = 5;
|
|
ErrorHandler.Sync(this);
|
|
_la = TokenStream.LA(1);
|
|
do {
|
|
{
|
|
{
|
|
State = 4;
|
|
contentText();
|
|
}
|
|
}
|
|
State = 7;
|
|
ErrorHandler.Sync(this);
|
|
_la = TokenStream.LA(1);
|
|
} while ( _la==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 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<TResult>(IParseTreeVisitor<TResult> visitor) {
|
|
IInkBlotAntlrGrammarVisitor<TResult> typedVisitor = visitor as IInkBlotAntlrGrammarVisitor<TResult>;
|
|
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, 2, RULE_contentText);
|
|
try {
|
|
EnterOuterAlt(_localctx, 1);
|
|
{
|
|
State = 9;
|
|
Match(CONTENT_TEXT_NO_ESCAPE_SIMPLE);
|
|
}
|
|
}
|
|
catch (RecognitionException re) {
|
|
_localctx.exception = re;
|
|
ErrorHandler.ReportError(this, re);
|
|
ErrorHandler.Recover(this, re);
|
|
}
|
|
finally {
|
|
ExitRule();
|
|
}
|
|
return _localctx;
|
|
}
|
|
|
|
private static int[] _serializedATN = {
|
|
4,1,2,12,2,0,7,0,2,1,7,1,1,0,4,0,6,8,0,11,0,12,0,7,1,1,1,1,1,1,0,0,2,0,
|
|
2,0,0,10,0,5,1,0,0,0,2,9,1,0,0,0,4,6,3,2,1,0,5,4,1,0,0,0,6,7,1,0,0,0,7,
|
|
5,1,0,0,0,7,8,1,0,0,0,8,1,1,0,0,0,9,10,5,2,0,0,10,3,1,0,0,0,1,7
|
|
};
|
|
|
|
public static readonly ATN _ATN =
|
|
new ATNDeserializer().Deserialize(_serializedATN);
|
|
|
|
|
|
}
|