| 1 |
// Generated from XMLParser.g4 by ANTLR 4.5.3 |
| 2 |
package android.databinding.parser; |
| 3 |
import org.antlr.v4.runtime.atn.*; |
| 4 |
import org.antlr.v4.runtime.dfa.DFA; |
| 5 |
import org.antlr.v4.runtime.*; |
| 6 |
import org.antlr.v4.runtime.misc.*; |
| 7 |
import org.antlr.v4.runtime.tree.*; |
| 8 |
import java.util.List; |
| 9 |
import java.util.Iterator; |
| 10 |
import java.util.ArrayList; |
| 11 |
|
| 12 |
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) |
| 13 |
public class XMLParser extends Parser { |
| 14 |
static { RuntimeMetaData.checkVersion("4.5.3", RuntimeMetaData.VERSION); } |
| 15 |
|
| 16 |
protected static final DFA[] _decisionToDFA; |
| 17 |
protected static final PredictionContextCache _sharedContextCache = |
| 18 |
new PredictionContextCache(); |
| 19 |
public static final int |
| 20 |
COMMENT=1, CDATA=2, DTD=3, EntityRef=4, CharRef=5, SEA_WS=6, OPEN=7, XMLDeclOpen=8, |
| 21 |
TEXT=9, CLOSE=10, SPECIAL_CLOSE=11, SLASH_CLOSE=12, SLASH=13, EQUALS=14, |
| 22 |
STRING=15, Name=16, S=17, PI=18; |
| 23 |
public static final int |
| 24 |
RULE_document = 0, RULE_prolog = 1, RULE_content = 2, RULE_element = 3, |
| 25 |
RULE_reference = 4, RULE_attribute = 5, RULE_chardata = 6, RULE_misc = 7; |
| 26 |
public static final String[] ruleNames = { |
| 27 |
"document", "prolog", "content", "element", "reference", "attribute", |
| 28 |
"chardata", "misc" |
| 29 |
}; |
| 30 |
|
| 31 |
private static final String[] _LITERAL_NAMES = { |
| 32 |
null, null, null, null, null, null, null, "'<'", null, null, "'>'", null, |
| 33 |
"'/>'", "'/'", "'='" |
| 34 |
}; |
| 35 |
private static final String[] _SYMBOLIC_NAMES = { |
| 36 |
null, "COMMENT", "CDATA", "DTD", "EntityRef", "CharRef", "SEA_WS", "OPEN", |
| 37 |
"XMLDeclOpen", "TEXT", "CLOSE", "SPECIAL_CLOSE", "SLASH_CLOSE", "SLASH", |
| 38 |
"EQUALS", "STRING", "Name", "S", "PI" |
| 39 |
}; |
| 40 |
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); |
| 41 |
|
| 42 |
/** |
| 43 |
* @deprecated Use {@link #VOCABULARY} instead. |
| 44 |
*/ |
| 45 |
@Deprecated |
| 46 |
public static final String[] tokenNames; |
| 47 |
static { |
| 48 |
tokenNames = new String[_SYMBOLIC_NAMES.length]; |
| 49 |
for (int i = 0; i < tokenNames.length; i++) { |
| 50 |
tokenNames[i] = VOCABULARY.getLiteralName(i); |
| 51 |
if (tokenNames[i] == null) { |
| 52 |
tokenNames[i] = VOCABULARY.getSymbolicName(i); |
| 53 |
} |
| 54 |
|
| 55 |
if (tokenNames[i] == null) { |
| 56 |
tokenNames[i] = "<INVALID>"; |
| 57 |
} |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
@Override |
| 62 |
@Deprecated |
| 63 |
public String[] getTokenNames() { |
| 64 |
return tokenNames; |
| 65 |
} |
| 66 |
|
| 67 |
@Override |
| 68 |
|
| 69 |
public Vocabulary getVocabulary() { |
| 70 |
return VOCABULARY; |
| 71 |
} |
| 72 |
|
| 73 |
@Override |
| 74 |
public String getGrammarFileName() { return "XMLParser.g4"; } |
| 75 |
|
| 76 |
@Override |
| 77 |
public String[] getRuleNames() { return ruleNames; } |
| 78 |
|
| 79 |
@Override |
| 80 |
public String getSerializedATN() { return _serializedATN; } |
| 81 |
|
| 82 |
@Override |
| 83 |
public ATN getATN() { return _ATN; } |
| 84 |
|
| 85 |
public XMLParser(TokenStream input) { |
| 86 |
super(input); |
| 87 |
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); |
| 88 |
} |
| 89 |
public static class DocumentContext extends ParserRuleContext { |
| 90 |
public ElementContext element() { |
| 91 |
return getRuleContext(ElementContext.class,0); |
| 92 |
} |
| 93 |
public PrologContext prolog() { |
| 94 |
return getRuleContext(PrologContext.class,0); |
| 95 |
} |
| 96 |
public List<MiscContext> misc() { |
| 97 |
return getRuleContexts(MiscContext.class); |
| 98 |
} |
| 99 |
public MiscContext misc(int i) { |
| 100 |
return getRuleContext(MiscContext.class,i); |
| 101 |
} |
| 102 |
public DocumentContext(ParserRuleContext parent, int invokingState) { |
| 103 |
super(parent, invokingState); |
| 104 |
} |
| 105 |
@Override public int getRuleIndex() { return RULE_document; } |
| 106 |
@Override |
| 107 |
public void enterRule(ParseTreeListener listener) { |
| 108 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterDocument(this); |
| 109 |
} |
| 110 |
@Override |
| 111 |
public void exitRule(ParseTreeListener listener) { |
| 112 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitDocument(this); |
| 113 |
} |
| 114 |
@Override |
| 115 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 116 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitDocument(this); |
| 117 |
else return visitor.visitChildren(this); |
| 118 |
} |
| 119 |
} |
| 120 |
|
| 121 |
public final DocumentContext document() throws RecognitionException { |
| 122 |
DocumentContext _localctx = new DocumentContext(_ctx, getState()); |
| 123 |
enterRule(_localctx, 0, RULE_document); |
| 124 |
int _la; |
| 125 |
try { |
| 126 |
enterOuterAlt(_localctx, 1); |
| 127 |
{ |
| 128 |
setState(17); |
| 129 |
_la = _input.LA(1); |
| 130 |
if (_la==XMLDeclOpen) { |
| 131 |
{ |
| 132 |
setState(16); |
| 133 |
prolog(); |
| 134 |
} |
| 135 |
} |
| 136 |
|
| 137 |
setState(22); |
| 138 |
_errHandler.sync(this); |
| 139 |
_la = _input.LA(1); |
| 140 |
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << COMMENT) | (1L << SEA_WS) | (1L << PI))) != 0)) { |
| 141 |
{ |
| 142 |
{ |
| 143 |
setState(19); |
| 144 |
misc(); |
| 145 |
} |
| 146 |
} |
| 147 |
setState(24); |
| 148 |
_errHandler.sync(this); |
| 149 |
_la = _input.LA(1); |
| 150 |
} |
| 151 |
setState(25); |
| 152 |
element(); |
| 153 |
setState(29); |
| 154 |
_errHandler.sync(this); |
| 155 |
_la = _input.LA(1); |
| 156 |
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << COMMENT) | (1L << SEA_WS) | (1L << PI))) != 0)) { |
| 157 |
{ |
| 158 |
{ |
| 159 |
setState(26); |
| 160 |
misc(); |
| 161 |
} |
| 162 |
} |
| 163 |
setState(31); |
| 164 |
_errHandler.sync(this); |
| 165 |
_la = _input.LA(1); |
| 166 |
} |
| 167 |
} |
| 168 |
} |
| 169 |
catch (RecognitionException re) { |
| 170 |
_localctx.exception = re; |
| 171 |
_errHandler.reportError(this, re); |
| 172 |
_errHandler.recover(this, re); |
| 173 |
} |
| 174 |
finally { |
| 175 |
exitRule(); |
| 176 |
} |
| 177 |
return _localctx; |
| 178 |
} |
| 179 |
|
| 180 |
public static class PrologContext extends ParserRuleContext { |
| 181 |
public TerminalNode XMLDeclOpen() { return getToken(XMLParser.XMLDeclOpen, 0); } |
| 182 |
public TerminalNode SPECIAL_CLOSE() { return getToken(XMLParser.SPECIAL_CLOSE, 0); } |
| 183 |
public List<AttributeContext> attribute() { |
| 184 |
return getRuleContexts(AttributeContext.class); |
| 185 |
} |
| 186 |
public AttributeContext attribute(int i) { |
| 187 |
return getRuleContext(AttributeContext.class,i); |
| 188 |
} |
| 189 |
public PrologContext(ParserRuleContext parent, int invokingState) { |
| 190 |
super(parent, invokingState); |
| 191 |
} |
| 192 |
@Override public int getRuleIndex() { return RULE_prolog; } |
| 193 |
@Override |
| 194 |
public void enterRule(ParseTreeListener listener) { |
| 195 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterProlog(this); |
| 196 |
} |
| 197 |
@Override |
| 198 |
public void exitRule(ParseTreeListener listener) { |
| 199 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitProlog(this); |
| 200 |
} |
| 201 |
@Override |
| 202 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 203 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitProlog(this); |
| 204 |
else return visitor.visitChildren(this); |
| 205 |
} |
| 206 |
} |
| 207 |
|
| 208 |
public final PrologContext prolog() throws RecognitionException { |
| 209 |
PrologContext _localctx = new PrologContext(_ctx, getState()); |
| 210 |
enterRule(_localctx, 2, RULE_prolog); |
| 211 |
int _la; |
| 212 |
try { |
| 213 |
enterOuterAlt(_localctx, 1); |
| 214 |
{ |
| 215 |
setState(32); |
| 216 |
match(XMLDeclOpen); |
| 217 |
setState(36); |
| 218 |
_errHandler.sync(this); |
| 219 |
_la = _input.LA(1); |
| 220 |
while (_la==Name) { |
| 221 |
{ |
| 222 |
{ |
| 223 |
setState(33); |
| 224 |
attribute(); |
| 225 |
} |
| 226 |
} |
| 227 |
setState(38); |
| 228 |
_errHandler.sync(this); |
| 229 |
_la = _input.LA(1); |
| 230 |
} |
| 231 |
setState(39); |
| 232 |
match(SPECIAL_CLOSE); |
| 233 |
} |
| 234 |
} |
| 235 |
catch (RecognitionException re) { |
| 236 |
_localctx.exception = re; |
| 237 |
_errHandler.reportError(this, re); |
| 238 |
_errHandler.recover(this, re); |
| 239 |
} |
| 240 |
finally { |
| 241 |
exitRule(); |
| 242 |
} |
| 243 |
return _localctx; |
| 244 |
} |
| 245 |
|
| 246 |
public static class ContentContext extends ParserRuleContext { |
| 247 |
public List<ChardataContext> chardata() { |
| 248 |
return getRuleContexts(ChardataContext.class); |
| 249 |
} |
| 250 |
public ChardataContext chardata(int i) { |
| 251 |
return getRuleContext(ChardataContext.class,i); |
| 252 |
} |
| 253 |
public List<ElementContext> element() { |
| 254 |
return getRuleContexts(ElementContext.class); |
| 255 |
} |
| 256 |
public ElementContext element(int i) { |
| 257 |
return getRuleContext(ElementContext.class,i); |
| 258 |
} |
| 259 |
public List<ReferenceContext> reference() { |
| 260 |
return getRuleContexts(ReferenceContext.class); |
| 261 |
} |
| 262 |
public ReferenceContext reference(int i) { |
| 263 |
return getRuleContext(ReferenceContext.class,i); |
| 264 |
} |
| 265 |
public List<TerminalNode> CDATA() { return getTokens(XMLParser.CDATA); } |
| 266 |
public TerminalNode CDATA(int i) { |
| 267 |
return getToken(XMLParser.CDATA, i); |
| 268 |
} |
| 269 |
public List<TerminalNode> PI() { return getTokens(XMLParser.PI); } |
| 270 |
public TerminalNode PI(int i) { |
| 271 |
return getToken(XMLParser.PI, i); |
| 272 |
} |
| 273 |
public List<TerminalNode> COMMENT() { return getTokens(XMLParser.COMMENT); } |
| 274 |
public TerminalNode COMMENT(int i) { |
| 275 |
return getToken(XMLParser.COMMENT, i); |
| 276 |
} |
| 277 |
public ContentContext(ParserRuleContext parent, int invokingState) { |
| 278 |
super(parent, invokingState); |
| 279 |
} |
| 280 |
@Override public int getRuleIndex() { return RULE_content; } |
| 281 |
@Override |
| 282 |
public void enterRule(ParseTreeListener listener) { |
| 283 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterContent(this); |
| 284 |
} |
| 285 |
@Override |
| 286 |
public void exitRule(ParseTreeListener listener) { |
| 287 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitContent(this); |
| 288 |
} |
| 289 |
@Override |
| 290 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 291 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitContent(this); |
| 292 |
else return visitor.visitChildren(this); |
| 293 |
} |
| 294 |
} |
| 295 |
|
| 296 |
public final ContentContext content() throws RecognitionException { |
| 297 |
ContentContext _localctx = new ContentContext(_ctx, getState()); |
| 298 |
enterRule(_localctx, 4, RULE_content); |
| 299 |
int _la; |
| 300 |
try { |
| 301 |
int _alt; |
| 302 |
enterOuterAlt(_localctx, 1); |
| 303 |
{ |
| 304 |
setState(42); |
| 305 |
_la = _input.LA(1); |
| 306 |
if (_la==SEA_WS || _la==TEXT) { |
| 307 |
{ |
| 308 |
setState(41); |
| 309 |
chardata(); |
| 310 |
} |
| 311 |
} |
| 312 |
|
| 313 |
setState(56); |
| 314 |
_errHandler.sync(this); |
| 315 |
_alt = getInterpreter().adaptivePredict(_input,7,_ctx); |
| 316 |
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { |
| 317 |
if ( _alt==1 ) { |
| 318 |
{ |
| 319 |
{ |
| 320 |
setState(49); |
| 321 |
switch (_input.LA(1)) { |
| 322 |
case OPEN: |
| 323 |
{ |
| 324 |
setState(44); |
| 325 |
element(); |
| 326 |
} |
| 327 |
break; |
| 328 |
case EntityRef: |
| 329 |
case CharRef: |
| 330 |
{ |
| 331 |
setState(45); |
| 332 |
reference(); |
| 333 |
} |
| 334 |
break; |
| 335 |
case CDATA: |
| 336 |
{ |
| 337 |
setState(46); |
| 338 |
match(CDATA); |
| 339 |
} |
| 340 |
break; |
| 341 |
case PI: |
| 342 |
{ |
| 343 |
setState(47); |
| 344 |
match(PI); |
| 345 |
} |
| 346 |
break; |
| 347 |
case COMMENT: |
| 348 |
{ |
| 349 |
setState(48); |
| 350 |
match(COMMENT); |
| 351 |
} |
| 352 |
break; |
| 353 |
default: |
| 354 |
throw new NoViableAltException(this); |
| 355 |
} |
| 356 |
setState(52); |
| 357 |
_la = _input.LA(1); |
| 358 |
if (_la==SEA_WS || _la==TEXT) { |
| 359 |
{ |
| 360 |
setState(51); |
| 361 |
chardata(); |
| 362 |
} |
| 363 |
} |
| 364 |
|
| 365 |
} |
| 366 |
} |
| 367 |
} |
| 368 |
setState(58); |
| 369 |
_errHandler.sync(this); |
| 370 |
_alt = getInterpreter().adaptivePredict(_input,7,_ctx); |
| 371 |
} |
| 372 |
} |
| 373 |
} |
| 374 |
catch (RecognitionException re) { |
| 375 |
_localctx.exception = re; |
| 376 |
_errHandler.reportError(this, re); |
| 377 |
_errHandler.recover(this, re); |
| 378 |
} |
| 379 |
finally { |
| 380 |
exitRule(); |
| 381 |
} |
| 382 |
return _localctx; |
| 383 |
} |
| 384 |
|
| 385 |
public static class ElementContext extends ParserRuleContext { |
| 386 |
public Token elmName; |
| 387 |
public ContentContext content() { |
| 388 |
return getRuleContext(ContentContext.class,0); |
| 389 |
} |
| 390 |
public List<TerminalNode> Name() { return getTokens(XMLParser.Name); } |
| 391 |
public TerminalNode Name(int i) { |
| 392 |
return getToken(XMLParser.Name, i); |
| 393 |
} |
| 394 |
public List<AttributeContext> attribute() { |
| 395 |
return getRuleContexts(AttributeContext.class); |
| 396 |
} |
| 397 |
public AttributeContext attribute(int i) { |
| 398 |
return getRuleContext(AttributeContext.class,i); |
| 399 |
} |
| 400 |
public ElementContext(ParserRuleContext parent, int invokingState) { |
| 401 |
super(parent, invokingState); |
| 402 |
} |
| 403 |
@Override public int getRuleIndex() { return RULE_element; } |
| 404 |
@Override |
| 405 |
public void enterRule(ParseTreeListener listener) { |
| 406 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterElement(this); |
| 407 |
} |
| 408 |
@Override |
| 409 |
public void exitRule(ParseTreeListener listener) { |
| 410 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitElement(this); |
| 411 |
} |
| 412 |
@Override |
| 413 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 414 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitElement(this); |
| 415 |
else return visitor.visitChildren(this); |
| 416 |
} |
| 417 |
} |
| 418 |
|
| 419 |
public final ElementContext element() throws RecognitionException { |
| 420 |
ElementContext _localctx = new ElementContext(_ctx, getState()); |
| 421 |
enterRule(_localctx, 6, RULE_element); |
| 422 |
int _la; |
| 423 |
try { |
| 424 |
setState(83); |
| 425 |
_errHandler.sync(this); |
| 426 |
switch ( getInterpreter().adaptivePredict(_input,10,_ctx) ) { |
| 427 |
case 1: |
| 428 |
enterOuterAlt(_localctx, 1); |
| 429 |
{ |
| 430 |
setState(59); |
| 431 |
match(OPEN); |
| 432 |
setState(60); |
| 433 |
((ElementContext)_localctx).elmName = match(Name); |
| 434 |
setState(64); |
| 435 |
_errHandler.sync(this); |
| 436 |
_la = _input.LA(1); |
| 437 |
while (_la==Name) { |
| 438 |
{ |
| 439 |
{ |
| 440 |
setState(61); |
| 441 |
attribute(); |
| 442 |
} |
| 443 |
} |
| 444 |
setState(66); |
| 445 |
_errHandler.sync(this); |
| 446 |
_la = _input.LA(1); |
| 447 |
} |
| 448 |
setState(67); |
| 449 |
match(CLOSE); |
| 450 |
setState(68); |
| 451 |
content(); |
| 452 |
setState(69); |
| 453 |
match(OPEN); |
| 454 |
setState(70); |
| 455 |
match(SLASH); |
| 456 |
setState(71); |
| 457 |
match(Name); |
| 458 |
setState(72); |
| 459 |
match(CLOSE); |
| 460 |
} |
| 461 |
break; |
| 462 |
case 2: |
| 463 |
enterOuterAlt(_localctx, 2); |
| 464 |
{ |
| 465 |
setState(74); |
| 466 |
match(OPEN); |
| 467 |
setState(75); |
| 468 |
((ElementContext)_localctx).elmName = match(Name); |
| 469 |
setState(79); |
| 470 |
_errHandler.sync(this); |
| 471 |
_la = _input.LA(1); |
| 472 |
while (_la==Name) { |
| 473 |
{ |
| 474 |
{ |
| 475 |
setState(76); |
| 476 |
attribute(); |
| 477 |
} |
| 478 |
} |
| 479 |
setState(81); |
| 480 |
_errHandler.sync(this); |
| 481 |
_la = _input.LA(1); |
| 482 |
} |
| 483 |
setState(82); |
| 484 |
match(SLASH_CLOSE); |
| 485 |
} |
| 486 |
break; |
| 487 |
} |
| 488 |
} |
| 489 |
catch (RecognitionException re) { |
| 490 |
_localctx.exception = re; |
| 491 |
_errHandler.reportError(this, re); |
| 492 |
_errHandler.recover(this, re); |
| 493 |
} |
| 494 |
finally { |
| 495 |
exitRule(); |
| 496 |
} |
| 497 |
return _localctx; |
| 498 |
} |
| 499 |
|
| 500 |
public static class ReferenceContext extends ParserRuleContext { |
| 501 |
public TerminalNode EntityRef() { return getToken(XMLParser.EntityRef, 0); } |
| 502 |
public TerminalNode CharRef() { return getToken(XMLParser.CharRef, 0); } |
| 503 |
public ReferenceContext(ParserRuleContext parent, int invokingState) { |
| 504 |
super(parent, invokingState); |
| 505 |
} |
| 506 |
@Override public int getRuleIndex() { return RULE_reference; } |
| 507 |
@Override |
| 508 |
public void enterRule(ParseTreeListener listener) { |
| 509 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterReference(this); |
| 510 |
} |
| 511 |
@Override |
| 512 |
public void exitRule(ParseTreeListener listener) { |
| 513 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitReference(this); |
| 514 |
} |
| 515 |
@Override |
| 516 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 517 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitReference(this); |
| 518 |
else return visitor.visitChildren(this); |
| 519 |
} |
| 520 |
} |
| 521 |
|
| 522 |
public final ReferenceContext reference() throws RecognitionException { |
| 523 |
ReferenceContext _localctx = new ReferenceContext(_ctx, getState()); |
| 524 |
enterRule(_localctx, 8, RULE_reference); |
| 525 |
int _la; |
| 526 |
try { |
| 527 |
enterOuterAlt(_localctx, 1); |
| 528 |
{ |
| 529 |
setState(85); |
| 530 |
_la = _input.LA(1); |
| 531 |
if ( !(_la==EntityRef || _la==CharRef) ) { |
| 532 |
_errHandler.recoverInline(this); |
| 533 |
} else { |
| 534 |
consume(); |
| 535 |
} |
| 536 |
} |
| 537 |
} |
| 538 |
catch (RecognitionException re) { |
| 539 |
_localctx.exception = re; |
| 540 |
_errHandler.reportError(this, re); |
| 541 |
_errHandler.recover(this, re); |
| 542 |
} |
| 543 |
finally { |
| 544 |
exitRule(); |
| 545 |
} |
| 546 |
return _localctx; |
| 547 |
} |
| 548 |
|
| 549 |
public static class AttributeContext extends ParserRuleContext { |
| 550 |
public Token attrName; |
| 551 |
public Token attrValue; |
| 552 |
public TerminalNode Name() { return getToken(XMLParser.Name, 0); } |
| 553 |
public TerminalNode STRING() { return getToken(XMLParser.STRING, 0); } |
| 554 |
public AttributeContext(ParserRuleContext parent, int invokingState) { |
| 555 |
super(parent, invokingState); |
| 556 |
} |
| 557 |
@Override public int getRuleIndex() { return RULE_attribute; } |
| 558 |
@Override |
| 559 |
public void enterRule(ParseTreeListener listener) { |
| 560 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterAttribute(this); |
| 561 |
} |
| 562 |
@Override |
| 563 |
public void exitRule(ParseTreeListener listener) { |
| 564 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitAttribute(this); |
| 565 |
} |
| 566 |
@Override |
| 567 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 568 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitAttribute(this); |
| 569 |
else return visitor.visitChildren(this); |
| 570 |
} |
| 571 |
} |
| 572 |
|
| 573 |
public final AttributeContext attribute() throws RecognitionException { |
| 574 |
AttributeContext _localctx = new AttributeContext(_ctx, getState()); |
| 575 |
enterRule(_localctx, 10, RULE_attribute); |
| 576 |
try { |
| 577 |
enterOuterAlt(_localctx, 1); |
| 578 |
{ |
| 579 |
setState(87); |
| 580 |
((AttributeContext)_localctx).attrName = match(Name); |
| 581 |
setState(88); |
| 582 |
match(EQUALS); |
| 583 |
setState(89); |
| 584 |
((AttributeContext)_localctx).attrValue = match(STRING); |
| 585 |
} |
| 586 |
} |
| 587 |
catch (RecognitionException re) { |
| 588 |
_localctx.exception = re; |
| 589 |
_errHandler.reportError(this, re); |
| 590 |
_errHandler.recover(this, re); |
| 591 |
} |
| 592 |
finally { |
| 593 |
exitRule(); |
| 594 |
} |
| 595 |
return _localctx; |
| 596 |
} |
| 597 |
|
| 598 |
public static class ChardataContext extends ParserRuleContext { |
| 599 |
public TerminalNode TEXT() { return getToken(XMLParser.TEXT, 0); } |
| 600 |
public TerminalNode SEA_WS() { return getToken(XMLParser.SEA_WS, 0); } |
| 601 |
public ChardataContext(ParserRuleContext parent, int invokingState) { |
| 602 |
super(parent, invokingState); |
| 603 |
} |
| 604 |
@Override public int getRuleIndex() { return RULE_chardata; } |
| 605 |
@Override |
| 606 |
public void enterRule(ParseTreeListener listener) { |
| 607 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterChardata(this); |
| 608 |
} |
| 609 |
@Override |
| 610 |
public void exitRule(ParseTreeListener listener) { |
| 611 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitChardata(this); |
| 612 |
} |
| 613 |
@Override |
| 614 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 615 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitChardata(this); |
| 616 |
else return visitor.visitChildren(this); |
| 617 |
} |
| 618 |
} |
| 619 |
|
| 620 |
public final ChardataContext chardata() throws RecognitionException { |
| 621 |
ChardataContext _localctx = new ChardataContext(_ctx, getState()); |
| 622 |
enterRule(_localctx, 12, RULE_chardata); |
| 623 |
int _la; |
| 624 |
try { |
| 625 |
enterOuterAlt(_localctx, 1); |
| 626 |
{ |
| 627 |
setState(91); |
| 628 |
_la = _input.LA(1); |
| 629 |
if ( !(_la==SEA_WS || _la==TEXT) ) { |
| 630 |
_errHandler.recoverInline(this); |
| 631 |
} else { |
| 632 |
consume(); |
| 633 |
} |
| 634 |
} |
| 635 |
} |
| 636 |
catch (RecognitionException re) { |
| 637 |
_localctx.exception = re; |
| 638 |
_errHandler.reportError(this, re); |
| 639 |
_errHandler.recover(this, re); |
| 640 |
} |
| 641 |
finally { |
| 642 |
exitRule(); |
| 643 |
} |
| 644 |
return _localctx; |
| 645 |
} |
| 646 |
|
| 647 |
public static class MiscContext extends ParserRuleContext { |
| 648 |
public TerminalNode COMMENT() { return getToken(XMLParser.COMMENT, 0); } |
| 649 |
public TerminalNode PI() { return getToken(XMLParser.PI, 0); } |
| 650 |
public TerminalNode SEA_WS() { return getToken(XMLParser.SEA_WS, 0); } |
| 651 |
public MiscContext(ParserRuleContext parent, int invokingState) { |
| 652 |
super(parent, invokingState); |
| 653 |
} |
| 654 |
@Override public int getRuleIndex() { return RULE_misc; } |
| 655 |
@Override |
| 656 |
public void enterRule(ParseTreeListener listener) { |
| 657 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).enterMisc(this); |
| 658 |
} |
| 659 |
@Override |
| 660 |
public void exitRule(ParseTreeListener listener) { |
| 661 |
if ( listener instanceof XMLParserListener ) ((XMLParserListener)listener).exitMisc(this); |
| 662 |
} |
| 663 |
@Override |
| 664 |
public <T> T accept(ParseTreeVisitor<? extends T> visitor) { |
| 665 |
if ( visitor instanceof XMLParserVisitor ) return ((XMLParserVisitor<? extends T>)visitor).visitMisc(this); |
| 666 |
else return visitor.visitChildren(this); |
| 667 |
} |
| 668 |
} |
| 669 |
|
| 670 |
public final MiscContext misc() throws RecognitionException { |
| 671 |
MiscContext _localctx = new MiscContext(_ctx, getState()); |
| 672 |
enterRule(_localctx, 14, RULE_misc); |
| 673 |
int _la; |
| 674 |
try { |
| 675 |
enterOuterAlt(_localctx, 1); |
| 676 |
{ |
| 677 |
setState(93); |
| 678 |
_la = _input.LA(1); |
| 679 |
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << COMMENT) | (1L << SEA_WS) | (1L << PI))) != 0)) ) { |
| 680 |
_errHandler.recoverInline(this); |
| 681 |
} else { |
| 682 |
consume(); |
| 683 |
} |
| 684 |
} |
| 685 |
} |
| 686 |
catch (RecognitionException re) { |
| 687 |
_localctx.exception = re; |
| 688 |
_errHandler.reportError(this, re); |
| 689 |
_errHandler.recover(this, re); |
| 690 |
} |
| 691 |
finally { |
| 692 |
exitRule(); |
| 693 |
} |
| 694 |
return _localctx; |
| 695 |
} |
| 696 |
|
| 697 |
public static final String _serializedATN = |
| 698 |
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\24b\4\2\t\2\4\3\t"+ |
| 699 |
"\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\3\2\5\2\24\n\2\3\2"+ |
| 700 |
"\7\2\27\n\2\f\2\16\2\32\13\2\3\2\3\2\7\2\36\n\2\f\2\16\2!\13\2\3\3\3\3"+ |
| 701 |
"\7\3%\n\3\f\3\16\3(\13\3\3\3\3\3\3\4\5\4-\n\4\3\4\3\4\3\4\3\4\3\4\5\4"+ |
| 702 |
"\64\n\4\3\4\5\4\67\n\4\7\49\n\4\f\4\16\4<\13\4\3\5\3\5\3\5\7\5A\n\5\f"+ |
| 703 |
"\5\16\5D\13\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\7\5P\n\5\f\5\16"+ |
| 704 |
"\5S\13\5\3\5\5\5V\n\5\3\6\3\6\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3\t\2\2"+ |
| 705 |
"\n\2\4\6\b\n\f\16\20\2\5\3\2\6\7\4\2\b\b\13\13\5\2\3\3\b\b\24\24g\2\23"+ |
| 706 |
"\3\2\2\2\4\"\3\2\2\2\6,\3\2\2\2\bU\3\2\2\2\nW\3\2\2\2\fY\3\2\2\2\16]\3"+ |
| 707 |
"\2\2\2\20_\3\2\2\2\22\24\5\4\3\2\23\22\3\2\2\2\23\24\3\2\2\2\24\30\3\2"+ |
| 708 |
"\2\2\25\27\5\20\t\2\26\25\3\2\2\2\27\32\3\2\2\2\30\26\3\2\2\2\30\31\3"+ |
| 709 |
"\2\2\2\31\33\3\2\2\2\32\30\3\2\2\2\33\37\5\b\5\2\34\36\5\20\t\2\35\34"+ |
| 710 |
"\3\2\2\2\36!\3\2\2\2\37\35\3\2\2\2\37 \3\2\2\2 \3\3\2\2\2!\37\3\2\2\2"+ |
| 711 |
"\"&\7\n\2\2#%\5\f\7\2$#\3\2\2\2%(\3\2\2\2&$\3\2\2\2&\'\3\2\2\2\')\3\2"+ |
| 712 |
"\2\2(&\3\2\2\2)*\7\r\2\2*\5\3\2\2\2+-\5\16\b\2,+\3\2\2\2,-\3\2\2\2-:\3"+ |
| 713 |
"\2\2\2.\64\5\b\5\2/\64\5\n\6\2\60\64\7\4\2\2\61\64\7\24\2\2\62\64\7\3"+ |
| 714 |
"\2\2\63.\3\2\2\2\63/\3\2\2\2\63\60\3\2\2\2\63\61\3\2\2\2\63\62\3\2\2\2"+ |
| 715 |
"\64\66\3\2\2\2\65\67\5\16\b\2\66\65\3\2\2\2\66\67\3\2\2\2\679\3\2\2\2"+ |
| 716 |
"8\63\3\2\2\29<\3\2\2\2:8\3\2\2\2:;\3\2\2\2;\7\3\2\2\2<:\3\2\2\2=>\7\t"+ |
| 717 |
"\2\2>B\7\22\2\2?A\5\f\7\2@?\3\2\2\2AD\3\2\2\2B@\3\2\2\2BC\3\2\2\2CE\3"+ |
| 718 |
"\2\2\2DB\3\2\2\2EF\7\f\2\2FG\5\6\4\2GH\7\t\2\2HI\7\17\2\2IJ\7\22\2\2J"+ |
| 719 |
"K\7\f\2\2KV\3\2\2\2LM\7\t\2\2MQ\7\22\2\2NP\5\f\7\2ON\3\2\2\2PS\3\2\2\2"+ |
| 720 |
"QO\3\2\2\2QR\3\2\2\2RT\3\2\2\2SQ\3\2\2\2TV\7\16\2\2U=\3\2\2\2UL\3\2\2"+ |
| 721 |
"\2V\t\3\2\2\2WX\t\2\2\2X\13\3\2\2\2YZ\7\22\2\2Z[\7\20\2\2[\\\7\21\2\2"+ |
| 722 |
"\\\r\3\2\2\2]^\t\3\2\2^\17\3\2\2\2_`\t\4\2\2`\21\3\2\2\2\r\23\30\37&,"+ |
| 723 |
"\63\66:BQU"; |
| 724 |
public static final ATN _ATN = |
| 725 |
new ATNDeserializer().deserialize(_serializedATN.toCharArray()); |
| 726 |
static { |
| 727 |
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; |
| 728 |
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { |
| 729 |
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); |
| 730 |
} |
| 731 |
} |
| 732 |
} |