14 #pragma warning disable 0162
16 #pragma warning disable 0219
18 #pragma warning disable 1591
20 #pragma warning disable 419
25 using System.Diagnostics;
26 using System.Collections.Generic;
28 using Antlr4.Runtime.Atn;
29 using Antlr4.Runtime.Misc;
30 using Antlr4.Runtime.Tree;
31 using DFA = Antlr4.Runtime.Dfa.DFA;
33 [System.CodeDom.Compiler.GeneratedCode(
"ANTLR",
"4.7")]
34 [System.CLSCompliant(
false)]
35 public partial class ASPGrammarParser : Parser {
36 protected static DFA[] decisionToDFA;
37 protected static PredictionContextCache sharedContextCache =
new PredictionContextCache();
39 T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, IDENTIFIER=6, INTEGER=7, STRING=8,
42 RULE_output = 0, RULE_predicate_atom = 1, RULE_term = 2;
43 public static readonly
string[] ruleNames = {
44 "output",
"predicate_atom",
"term"
47 private static readonly
string[] _LiteralNames = {
48 null,
"'('",
"','",
"')'",
"'['",
"']'"
50 private static readonly
string[] _SymbolicNames = {
51 null,
null,
null,
null,
null,
null,
"IDENTIFIER",
"INTEGER",
"STRING",
54 public static readonly IVocabulary DefaultVocabulary =
new Vocabulary(_LiteralNames, _SymbolicNames);
57 public override IVocabulary Vocabulary
61 return DefaultVocabulary;
65 public override string GrammarFileName {
get {
return "ASPGrammar.g4"; } }
67 public override string[] RuleNames {
get {
return ruleNames; } }
69 public override string SerializedAtn {
get {
return new string(_serializedATN); } }
71 static ASPGrammarParser() {
72 decisionToDFA =
new DFA[_ATN.NumberOfDecisions];
73 for (
int i = 0; i < _ATN.NumberOfDecisions; i++) {
74 decisionToDFA[i] =
new DFA(_ATN.GetDecisionState(i), i);
78 public ASPGrammarParser(ITokenStream input) : this(input, Console.Out, Console.Error) { }
80 public ASPGrammarParser(ITokenStream input, TextWriter output, TextWriter errorOutput)
81 :
base(input, output, errorOutput)
83 Interpreter =
new ParserATNSimulator(
this, _ATN, decisionToDFA, sharedContextCache);
85 public partial class OutputContext : ParserRuleContext {
86 public Predicate_atomContext[] predicate_atom() {
87 return GetRuleContexts<Predicate_atomContext>();
89 public Predicate_atomContext predicate_atom(
int i) {
90 return GetRuleContext<Predicate_atomContext>(i);
92 public OutputContext(ParserRuleContext parent,
int invokingState)
93 :
base(parent, invokingState)
96 public override int RuleIndex {
get {
return RULE_output; } }
97 public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
99 if (typedVisitor !=
null)
return typedVisitor.
VisitOutput(
this);
100 else return visitor.VisitChildren(
this);
105 public OutputContext output() {
106 OutputContext _localctx =
new OutputContext(Context, State);
107 EnterRule(_localctx, 0, RULE_output);
110 EnterOuterAlt(_localctx, 1);
113 ErrorHandler.Sync(
this);
114 _la = TokenStream.LA(1);
115 while (_la==IDENTIFIER) {
118 State = 6; predicate_atom();
122 ErrorHandler.Sync(
this);
123 _la = TokenStream.LA(1);
127 catch (RecognitionException re) {
128 _localctx.exception = re;
129 ErrorHandler.ReportError(
this, re);
130 ErrorHandler.Recover(
this, re);
138 public partial class Predicate_atomContext : ParserRuleContext {
139 public ITerminalNode IDENTIFIER() {
return GetToken(ASPGrammarParser.IDENTIFIER, 0); }
140 public TermContext[] term() {
141 return GetRuleContexts<TermContext>();
143 public TermContext term(
int i) {
144 return GetRuleContext<TermContext>(i);
146 public Predicate_atomContext(ParserRuleContext parent,
int invokingState)
147 :
base(parent, invokingState)
150 public override int RuleIndex {
get {
return RULE_predicate_atom; } }
151 public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
154 else return visitor.VisitChildren(
this);
159 public Predicate_atomContext predicate_atom() {
160 Predicate_atomContext _localctx =
new Predicate_atomContext(Context, State);
161 EnterRule(_localctx, 2, RULE_predicate_atom);
164 EnterOuterAlt(_localctx, 1);
166 State = 12; Match(IDENTIFIER);
168 ErrorHandler.Sync(
this);
169 _la = TokenStream.LA(1);
172 State = 13; Match(T__0);
175 ErrorHandler.Sync(
this);
176 _la = TokenStream.LA(1);
180 State = 15; Match(T__1);
185 ErrorHandler.Sync(
this);
186 _la = TokenStream.LA(1);
188 State = 22; Match(T__2);
194 catch (RecognitionException re) {
195 _localctx.exception = re;
196 ErrorHandler.ReportError(
this, re);
197 ErrorHandler.Recover(
this, re);
205 public partial class TermContext : ParserRuleContext {
206 public ITerminalNode IDENTIFIER() {
return GetToken(ASPGrammarParser.IDENTIFIER, 0); }
207 public ITerminalNode INTEGER() {
return GetToken(ASPGrammarParser.INTEGER, 0); }
208 public Predicate_atomContext predicate_atom() {
209 return GetRuleContext<Predicate_atomContext>(0);
211 public TermContext[] term() {
212 return GetRuleContexts<TermContext>();
214 public TermContext term(
int i) {
215 return GetRuleContext<TermContext>(i);
217 public ITerminalNode STRING() {
return GetToken(ASPGrammarParser.STRING, 0); }
218 public TermContext(ParserRuleContext parent,
int invokingState)
219 :
base(parent, invokingState)
222 public override int RuleIndex {
get {
return RULE_term; } }
223 public override TResult Accept<TResult>(IParseTreeVisitor<TResult> visitor) {
225 if (typedVisitor !=
null)
return typedVisitor.
VisitTerm(
this);
226 else return visitor.VisitChildren(
this);
231 public TermContext term() {
232 TermContext _localctx =
new TermContext(Context, State);
233 EnterRule(_localctx, 4, RULE_term);
237 ErrorHandler.Sync(
this);
238 switch ( Interpreter.AdaptivePredict(TokenStream,5,Context) ) {
240 EnterOuterAlt(_localctx, 1);
242 State = 26; Match(IDENTIFIER);
246 EnterOuterAlt(_localctx, 2);
248 State = 27; Match(INTEGER);
252 EnterOuterAlt(_localctx, 3);
254 State = 28; predicate_atom();
258 EnterOuterAlt(_localctx, 4);
260 State = 29; Match(T__3);
262 ErrorHandler.Sync(
this);
263 _la = TokenStream.LA(1);
264 if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__3) | (1L << IDENTIFIER) | (1L << INTEGER) | (1L << STRING))) != 0)) {
268 ErrorHandler.Sync(
this);
269 _la = TokenStream.LA(1);
273 State = 31; Match(T__1);
278 ErrorHandler.Sync(
this);
279 _la = TokenStream.LA(1);
284 State = 40; Match(T__4);
288 EnterOuterAlt(_localctx, 5);
290 State = 41; Match(STRING);
295 catch (RecognitionException re) {
296 _localctx.exception = re;
297 ErrorHandler.ReportError(
this, re);
298 ErrorHandler.Recover(
this, re);
306 private static char[] _serializedATN = {
307 '\x3',
'\x608B',
'\xA72A',
'\x8133',
'\xB9ED',
'\x417C',
'\x3BE7',
'\x7786',
308 '\x5964',
'\x3',
'\v',
'/',
'\x4',
'\x2',
'\t',
'\x2',
'\x4',
'\x3',
'\t',
309 '\x3',
'\x4',
'\x4',
'\t',
'\x4',
'\x3',
'\x2',
'\a',
'\x2',
'\n',
'\n',
310 '\x2',
'\f',
'\x2',
'\xE',
'\x2',
'\r',
'\v',
'\x2',
'\x3',
'\x3',
'\x3',
311 '\x3',
'\x3',
'\x3',
'\x3',
'\x3',
'\x3',
'\x3',
'\a',
'\x3',
'\x14',
312 '\n',
'\x3',
'\f',
'\x3',
'\xE',
'\x3',
'\x17',
'\v',
'\x3',
'\x3',
'\x3',
313 '\x3',
'\x3',
'\x5',
'\x3',
'\x1B',
'\n',
'\x3',
'\x3',
'\x4',
'\x3',
314 '\x4',
'\x3',
'\x4',
'\x3',
'\x4',
'\x3',
'\x4',
'\x3',
'\x4',
'\x3',
315 '\x4',
'\a',
'\x4',
'$',
'\n',
'\x4',
'\f',
'\x4',
'\xE',
'\x4',
'\'',
316 '\v',
'\x4',
'\x5',
'\x4',
')',
'\n',
'\x4',
'\x3',
'\x4',
'\x3',
'\x4',
317 '\x5',
'\x4',
'-',
'\n',
'\x4',
'\x3',
'\x4',
'\x2',
'\x2',
'\x5',
'\x2',
318 '\x4',
'\x6',
'\x2',
'\x2',
'\x2',
'\x34',
'\x2',
'\v',
'\x3',
'\x2',
319 '\x2',
'\x2',
'\x4',
'\xE',
'\x3',
'\x2',
'\x2',
'\x2',
'\x6',
',',
'\x3',
320 '\x2',
'\x2',
'\x2',
'\b',
'\n',
'\x5',
'\x4',
'\x3',
'\x2',
'\t',
'\b',
321 '\x3',
'\x2',
'\x2',
'\x2',
'\n',
'\r',
'\x3',
'\x2',
'\x2',
'\x2',
'\v',
322 '\t',
'\x3',
'\x2',
'\x2',
'\x2',
'\v',
'\f',
'\x3',
'\x2',
'\x2',
'\x2',
323 '\f',
'\x3',
'\x3',
'\x2',
'\x2',
'\x2',
'\r',
'\v',
'\x3',
'\x2',
'\x2',
324 '\x2',
'\xE',
'\x1A',
'\a',
'\b',
'\x2',
'\x2',
'\xF',
'\x10',
'\a',
'\x3',
325 '\x2',
'\x2',
'\x10',
'\x15',
'\x5',
'\x6',
'\x4',
'\x2',
'\x11',
'\x12',
326 '\a',
'\x4',
'\x2',
'\x2',
'\x12',
'\x14',
'\x5',
'\x6',
'\x4',
'\x2',
327 '\x13',
'\x11',
'\x3',
'\x2',
'\x2',
'\x2',
'\x14',
'\x17',
'\x3',
'\x2',
328 '\x2',
'\x2',
'\x15',
'\x13',
'\x3',
'\x2',
'\x2',
'\x2',
'\x15',
'\x16',
329 '\x3',
'\x2',
'\x2',
'\x2',
'\x16',
'\x18',
'\x3',
'\x2',
'\x2',
'\x2',
330 '\x17',
'\x15',
'\x3',
'\x2',
'\x2',
'\x2',
'\x18',
'\x19',
'\a',
'\x5',
331 '\x2',
'\x2',
'\x19',
'\x1B',
'\x3',
'\x2',
'\x2',
'\x2',
'\x1A',
'\xF',
332 '\x3',
'\x2',
'\x2',
'\x2',
'\x1A',
'\x1B',
'\x3',
'\x2',
'\x2',
'\x2',
333 '\x1B',
'\x5',
'\x3',
'\x2',
'\x2',
'\x2',
'\x1C',
'-',
'\a',
'\b',
'\x2',
334 '\x2',
'\x1D',
'-',
'\a',
'\t',
'\x2',
'\x2',
'\x1E',
'-',
'\x5',
'\x4',
335 '\x3',
'\x2',
'\x1F',
'(',
'\a',
'\x6',
'\x2',
'\x2',
' ',
'%',
'\x5',
336 '\x6',
'\x4',
'\x2',
'!',
'\"',
'\a',
'\x4',
'\x2',
'\x2',
'\"',
'$',
337 '\x5',
'\x6',
'\x4',
'\x2',
'#',
'!',
'\x3',
'\x2',
'\x2',
'\x2',
'$',
338 '\'',
'\x3',
'\x2',
'\x2',
'\x2',
'%',
'#',
'\x3',
'\x2',
'\x2',
'\x2',
339 '%',
'&',
'\x3',
'\x2',
'\x2',
'\x2',
'&',
')',
'\x3',
'\x2',
'\x2',
'\x2',
340 '\'',
'%',
'\x3',
'\x2',
'\x2',
'\x2',
'(',
' ',
'\x3',
'\x2',
'\x2',
341 '\x2',
'(',
')',
'\x3',
'\x2',
'\x2',
'\x2',
')',
'*',
'\x3',
'\x2',
'\x2',
342 '\x2',
'*',
'-',
'\a',
'\a',
'\x2',
'\x2',
'+',
'-',
'\a',
'\n',
'\x2',
343 '\x2',
',',
'\x1C',
'\x3',
'\x2',
'\x2',
'\x2',
',',
'\x1D',
'\x3',
'\x2',
344 '\x2',
'\x2',
',',
'\x1E',
'\x3',
'\x2',
'\x2',
'\x2',
',',
'\x1F',
'\x3',
345 '\x2',
'\x2',
'\x2',
',',
'+',
'\x3',
'\x2',
'\x2',
'\x2',
'-',
'\a',
346 '\x3',
'\x2',
'\x2',
'\x2',
'\b',
'\v',
'\x15',
'\x1A',
'%',
'(',
',',
349 public static readonly ATN _ATN =
350 new ATNDeserializer().Deserialize(_serializedATN);