1 // Generated from source/antlr/v4/runtime/tree/xpath/XPathLexer.g4 by ANTLR 4.7.2
2 module antlr.v4.runtime.tree.xpath.XPathLexer;
3 
4 import antlr.v4.runtime.Lexer;
5 import antlr.v4.runtime.CharStream;
6 import antlr.v4.runtime.InterfaceRuleContext;
7 import antlr.v4.runtime.RuntimeMetaData;
8 import antlr.v4.runtime.Token;
9 import antlr.v4.runtime.TokenStream;
10 import antlr.v4.runtime.Vocabulary;
11 import antlr.v4.runtime.VocabularyImpl;
12 import antlr.v4.runtime.atn.ATN;
13 import antlr.v4.runtime.atn.PredictionContextCache;
14 import antlr.v4.runtime.atn.ATNDeserializer;
15 import antlr.v4.runtime.atn.LexerATNSimulator;
16 import antlr.v4.runtime.dfa.DFA;
17 import antlr.v4.runtime.LexerNoViableAltException;
18 
19 public class XPathLexer : Lexer {
20     alias recover = Lexer.recover;
21     static this() { RuntimeMetaData.checkVersion("4.7.2", RuntimeMetaData.VERSION); }
22 
23     protected static DFA[] _decisionToDFA;
24     protected PredictionContextCache _sharedContextCache =
25         new PredictionContextCache();
26     public static immutable int
27     TOKEN_REF=1,RULE_REF=2,ANYWHERE=3,ROOT=4,WILDCARD=5,BANG=6,ID=7,STRING=8;
28     public static string[] channelNames = [
29                                            "DEFAULT_TOKEN_CHANNEL", "HIDDEN"
30                                            ];
31     public static string[] modeNames = [
32                                         "DEFAULT_MODE"
33                                         ];
34 
35     public static string[] ruleNames = [
36                                         "ANYWHERE","ROOT","WILDCARD","BANG","ID","NameChar","NameStartChar","STRING"
37                                         ];
38 
39     private static const string[] _LITERAL_NAMES = [
40                                                     null,null,null,"'//'","'/'","'*'","'!'"
41                                                     ];
42     private static const string[] _SYMBOLIC_NAMES = [
43                                                      null,"TOKEN_REF","RULE_REF","ANYWHERE","ROOT","WILDCARD","BANG","ID","STRING"
44                                                      ];
45     public static Vocabulary VOCABULARY;
46 
47     /**
48      * @deprecated Use {@link #VOCABULARY} instead.
49      */
50     public static string[] tokenNames;
51 
52     static this() {
53         VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
54         string[_SYMBOLIC_NAMES.length] tokenNames;
55         for (int i = 0; i < tokenNames.length; i++) {
56             tokenNames[i] = VOCABULARY.getLiteralName(i);
57             if (tokenNames[i] is null) {
58                 tokenNames[i] = VOCABULARY.getSymbolicName(i);
59             }
60 
61             if (tokenNames[i] is null) {
62                 tokenNames[i] = "<INVALID>";
63             }
64         }
65     }
66 
67     override public string[] getTokenNames() {
68         return tokenNames;
69     }
70 
71     override public Vocabulary getVocabulary() {
72         return VOCABULARY;
73     }
74 
75 
76     public this(CharStream input) {
77         super(input);
78         _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
79     }
80 
81     override
82     public string getGrammarFileName() { return "XPathLexer.g4"; }
83 
84     override
85     public string[] getRuleNames() { return ruleNames; }
86 
87     override
88     public wstring getSerializedATN() { return _serializedATN; }
89 
90     override
91     public string[] getChannelNames() { return channelNames; }
92 
93     override
94     public string[] getModeNames() { return modeNames; }
95 
96     override
97     public ATN getATN() { return _ATN; }
98 
99     override
100     public void action(InterfaceRuleContext _localctx, int ruleIndex, int actionIndex) {
101         switch (ruleIndex) {
102         case 4:
103             ID_action(cast(InterfaceRuleContext)_localctx, actionIndex);
104             break;
105         default: {}
106         }
107     }
108     private void ID_action(InterfaceRuleContext _localctx, int actionIndex) {
109         switch (actionIndex) {
110         case 0:
111 
112             import std.ascii : isUpper;
113             import std.conv : to;
114 
115             string text = to!string(getText);
116             if (isUpper(text[0])) setType(TOKEN_REF);
117             else setType(RULE_REF);
118 
119             break;
120         default: {}
121         }
122     }
123 
124     public static immutable wstring _serializedATN =
125         "\x03\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\x02\n4\b\x01\x04"~
126         "\x02\t\x02\x04\x03\t\x03\x04\x04\t\x04\x04\x05\t\x05\x04\x06\t\x06\x04"~
127         "\x07\t\x07\x04\b\t\b\x04\t\t\t\x03\x02\x03\x02\x03\x02\x03\x03\x03\x03"~
128         "\x03\x04\x03\x04\x03\x05\x03\x05\x03\x06\x03\x06\x07\x06\x1f\n\x06\f\x06"~
129         "\x0e\x06\"\x0b\x06\x03\x06\x03\x06\x03\x07\x03\x07\x05\x07(\n\x07\x03"~
130         "\b\x03\b\x03\t\x03\t\x07\t.\n\t\f\t\x0e\t1\x0b\t\x03\t\x03\t\x03/\x02"~
131         "\n\x03\x05\x05\x06\x07\x07\t\b\x0b\t\r\x02\x0f\x02\x11\n\x03\x02\x04\x07"~
132         "\x022;aa\u00b9\u00b9\u0302\u0371\u2041\u2042\x0f\x02C\\c|\u00c2\u00d8"~
133         "\u00da\u00f8\u00fa\u0301\u0372\u037f\u0381\u2001\u200e\u200f\u2072\u2191"~
134         "\u2c02\u2ff1\u3003[154001]\uf902\ufdd1\ufdf2\uffff\x024\x02\x03\x03\x02"~
135         "\x02\x02\x02\x05\x03\x02\x02\x02\x02\x07\x03\x02\x02\x02\x02\t\x03\x02"~
136         "\x02\x02\x02\x0b\x03\x02\x02\x02\x02\x11\x03\x02\x02\x02\x03\x13\x03\x02"~
137         "\x02\x02\x05\x16\x03\x02\x02\x02\x07\x18\x03\x02\x02\x02\t\x1a\x03\x02"~
138         "\x02\x02\x0b\x1c\x03\x02\x02\x02\r\'\x03\x02\x02\x02\x0f)\x03\x02\x02"~
139         "\x02\x11+\x03\x02\x02\x02\x13\x14\x071\x02\x02\x14\x15\x071\x02\x02\x15"~
140         "\x04\x03\x02\x02\x02\x16\x17\x071\x02\x02\x17\x06\x03\x02\x02\x02\x18"~
141         "\x19\x07,\x02\x02\x19\b\x03\x02\x02\x02\x1a\x1b\x07#\x02\x02\x1b\n\x03"~
142         "\x02\x02\x02\x1c \x05\x0f\b\x02\x1d\x1f\x05\r\x07\x02\x1e\x1d\x03\x02"~
143         "\x02\x02\x1f\"\x03\x02\x02\x02 \x1e\x03\x02\x02\x02 !\x03\x02\x02\x02"~
144         "!#\x03\x02\x02\x02\" \x03\x02\x02\x02#$\b\x06\x02\x02$\f\x03\x02\x02\x02"~
145         "%(\x05\x0f\b\x02&(\t\x02\x02\x02\'%\x03\x02\x02\x02\'&\x03\x02\x02\x02"~
146         "(\x0e\x03\x02\x02\x02)*\t\x03\x02\x02*\x10\x03\x02\x02\x02+/\x07)\x02"~
147         "\x02,.\x0b\x02\x02\x02-,\x03\x02\x02\x02.1\x03\x02\x02\x02/0\x03\x02\x02"~
148         "\x02/-\x03\x02\x02\x0202\x03\x02\x02\x021/\x03\x02\x02\x0223\x07)\x02"~
149         "\x023\x12\x03\x02\x02\x02\x06\x02 \'/\x03\x03\x06\x02";
150     public static ATN _ATN;
151 
152     static this() {
153         auto atnDeserializer = new ATNDeserializer;
154         _ATN = atnDeserializer.deserialize(_serializedATN);
155         _decisionToDFA.length = 0;
156         for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
157             _decisionToDFA ~= new DFA(_ATN.getDecisionState(i), i);
158         }
159     }
160 }