1 /*
2  * Copyright (c) 2012-2020 The ANTLR Project. All rights reserved.
3  * Use of this file is governed by the BSD 3-clause license that
4  * can be found in the LICENSE.txt file in the project root.
5  */
6 
7 module antlr.v4.runtime.NoViableAltException;
8 
9 import antlr.v4.runtime.RecognitionException;
10 import antlr.v4.runtime.Token;
11 import antlr.v4.runtime.Parser;
12 import antlr.v4.runtime.TokenStream;
13 import antlr.v4.runtime.ParserRuleContext;
14 import antlr.v4.runtime.atn.ATNConfigSet;
15 
16 /**
17  * TODO add class description
18  */
19 class NoViableAltException : RecognitionException
20 {
21 
22     private ATNConfigSet deadEndConfigs;
23 
24     private Token startToken;
25 
26     public this(Parser recognizer)
27     {
28         this(recognizer,
29          recognizer.getInputStream(),
30          recognizer.getCurrentToken(),
31          recognizer.getCurrentToken(),
32          null,
33          recognizer.ctx_);
34     }
35 
36     public this(Parser recognizer, TokenStream input, Token startToken, Token offendingToken,
37         ATNConfigSet deadEndConfigs, ParserRuleContext ctx)
38     {
39         super(recognizer, input, ctx);
40         this.deadEndConfigs = deadEndConfigs;
41         this.startToken = startToken;
42         this.setOffendingToken(offendingToken);
43     }
44 
45     public Token getStartToken()
46     {
47         return startToken;
48     }
49 
50     public ATNConfigSet getDeadEndConfigs()
51     {
52         return deadEndConfigs;
53     }
54 
55 }