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