Updated XML lexer to handle incomplete comments

This commit is contained in:
Akash Yadav
2022-06-22 11:40:37 +05:30
parent f472ca3de5
commit 966f4f2f69
13 changed files with 830 additions and 188 deletions
+12 -1
View File
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
compileSdkVersion rootProject.ext.compileSdk
@@ -14,6 +15,10 @@ android {
targetCompatibility rootProject.ext.javaTargetVersion
}
kotlinOptions {
jvmTarget = "11"
}
buildTypes {
release {
minifyEnabled true
@@ -23,6 +28,12 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api common.antlr4
implementation androidx.ktx
implementation common.kotlin
testImplementation tests.junit
testImplementation tests.google_truth
testImplementation tests.robolectric
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,294 @@
// Generated from /home/itsaky/Projects/Android/AndroidIDE/lexers/src/main/java/com/itsaky/androidide/lexers/xml/XMLLexer.g4 by ANTLR 4.10.1
package com.itsaky.androidide.lexers.xml;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.TokenStream;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.misc.*;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class XMLLexer extends Lexer {
static { RuntimeMetaData.checkVersion("4.10.1", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
COLON=1, NOT=2, DASH=3, COMMENT_START=4, COMMENT_END=5, COMMENT=6, CDATA=7,
DTD=8, EntityRef=9, CharRef=10, SEA_WS=11, OPEN=12, OPEN_SLASH=13, XMLDeclOpen=14,
TEXT=15, CLOSE=16, SPECIAL_CLOSE=17, SLASH_CLOSE=18, SLASH=19, EQUALS=20,
STRING=21, Name=22, S=23, PI=24;
public static final int
INSIDE=1, PROC_INSTR=2;
public static String[] channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
public static String[] modeNames = {
"DEFAULT_MODE", "INSIDE", "PROC_INSTR"
};
private static String[] makeRuleNames() {
return new String[] {
"COLON", "NOT", "DASH", "COMMENT_START", "COMMENT_END", "COMMENT", "CDATA",
"DTD", "EntityRef", "CharRef", "SEA_WS", "OPEN", "OPEN_SLASH", "XMLDeclOpen",
"SPECIAL_OPEN", "TEXT", "CLOSE", "SPECIAL_CLOSE", "SLASH_CLOSE", "SLASH",
"EQUALS", "STRING", "Name", "S", "HEXDIGIT", "DIGIT", "NameChar", "NameStartChar",
"PI", "IGNORE"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, "':'", "'!'", "'-'", null, null, null, null, null, null, null,
null, "'<'", "'</'", null, null, "'>'", null, "'/>'", "'/'", "'='"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, "COLON", "NOT", "DASH", "COMMENT_START", "COMMENT_END", "COMMENT",
"CDATA", "DTD", "EntityRef", "CharRef", "SEA_WS", "OPEN", "OPEN_SLASH",
"XMLDeclOpen", "TEXT", "CLOSE", "SPECIAL_CLOSE", "SLASH_CLOSE", "SLASH",
"EQUALS", "STRING", "Name", "S", "PI"
};
}
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
/**
* @deprecated Use {@link #VOCABULARY} instead.
*/
@Deprecated
public static final String[] tokenNames;
static {
tokenNames = new String[_SYMBOLIC_NAMES.length];
for (int i = 0; i < tokenNames.length; i++) {
tokenNames[i] = VOCABULARY.getLiteralName(i);
if (tokenNames[i] == null) {
tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
if (tokenNames[i] == null) {
tokenNames[i] = "<INVALID>";
}
}
}
@Override
@Deprecated
public String[] getTokenNames() {
return tokenNames;
}
@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}
public XMLLexer(CharStream input) {
super(input);
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
@Override
public String getGrammarFileName() { return "XMLLexer.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public String[] getChannelNames() { return channelNames; }
@Override
public String[] getModeNames() { return modeNames; }
@Override
public ATN getATN() { return _ATN; }
public static final String _serializedATN =
"\u0004\u0000\u0018\u0101\u0006\uffff\uffff\u0006\uffff\uffff\u0006\uffff"+
"\uffff\u0002\u0000\u0007\u0000\u0002\u0001\u0007\u0001\u0002\u0002\u0007"+
"\u0002\u0002\u0003\u0007\u0003\u0002\u0004\u0007\u0004\u0002\u0005\u0007"+
"\u0005\u0002\u0006\u0007\u0006\u0002\u0007\u0007\u0007\u0002\b\u0007\b"+
"\u0002\t\u0007\t\u0002\n\u0007\n\u0002\u000b\u0007\u000b\u0002\f\u0007"+
"\f\u0002\r\u0007\r\u0002\u000e\u0007\u000e\u0002\u000f\u0007\u000f\u0002"+
"\u0010\u0007\u0010\u0002\u0011\u0007\u0011\u0002\u0012\u0007\u0012\u0002"+
"\u0013\u0007\u0013\u0002\u0014\u0007\u0014\u0002\u0015\u0007\u0015\u0002"+
"\u0016\u0007\u0016\u0002\u0017\u0007\u0017\u0002\u0018\u0007\u0018\u0002"+
"\u0019\u0007\u0019\u0002\u001a\u0007\u001a\u0002\u001b\u0007\u001b\u0002"+
"\u001c\u0007\u001c\u0002\u001d\u0007\u001d\u0001\u0000\u0001\u0000\u0001"+
"\u0001\u0001\u0001\u0001\u0002\u0001\u0002\u0001\u0003\u0001\u0003\u0001"+
"\u0003\u0001\u0003\u0001\u0003\u0001\u0004\u0001\u0004\u0001\u0004\u0001"+
"\u0004\u0001\u0005\u0001\u0005\u0005\u0005Q\b\u0005\n\u0005\f\u0005T\t"+
"\u0005\u0001\u0005\u0001\u0005\u0001\u0006\u0001\u0006\u0001\u0006\u0001"+
"\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001"+
"\u0006\u0001\u0006\u0005\u0006c\b\u0006\n\u0006\f\u0006f\t\u0006\u0001"+
"\u0006\u0001\u0006\u0001\u0006\u0001\u0006\u0001\u0007\u0001\u0007\u0001"+
"\u0007\u0001\u0007\u0005\u0007p\b\u0007\n\u0007\f\u0007s\t\u0007\u0001"+
"\u0007\u0001\u0007\u0001\u0007\u0001\u0007\u0001\b\u0001\b\u0001\b\u0001"+
"\b\u0001\t\u0001\t\u0001\t\u0001\t\u0004\t\u0081\b\t\u000b\t\f\t\u0082"+
"\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0001\t\u0004\t\u008c"+
"\b\t\u000b\t\f\t\u008d\u0001\t\u0001\t\u0003\t\u0092\b\t\u0001\n\u0001"+
"\n\u0003\n\u0096\b\n\u0001\n\u0004\n\u0099\b\n\u000b\n\f\n\u009a\u0001"+
"\u000b\u0001\u000b\u0001\u000b\u0001\u000b\u0001\f\u0001\f\u0001\f\u0001"+
"\f\u0001\f\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001\r\u0001"+
"\r\u0001\r\u0001\r\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001"+
"\u000e\u0001\u000e\u0001\u000e\u0001\u000e\u0001\u000f\u0004\u000f\u00b9"+
"\b\u000f\u000b\u000f\f\u000f\u00ba\u0001\u0010\u0001\u0010\u0001\u0010"+
"\u0001\u0010\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011\u0001\u0011"+
"\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0012\u0001\u0013"+
"\u0001\u0013\u0001\u0014\u0001\u0014\u0001\u0015\u0001\u0015\u0005\u0015"+
"\u00d1\b\u0015\n\u0015\f\u0015\u00d4\t\u0015\u0001\u0015\u0001\u0015\u0001"+
"\u0015\u0005\u0015\u00d9\b\u0015\n\u0015\f\u0015\u00dc\t\u0015\u0001\u0015"+
"\u0003\u0015\u00df\b\u0015\u0001\u0016\u0001\u0016\u0005\u0016\u00e3\b"+
"\u0016\n\u0016\f\u0016\u00e6\t\u0016\u0001\u0017\u0001\u0017\u0001\u0017"+
"\u0001\u0017\u0001\u0018\u0001\u0018\u0001\u0019\u0001\u0019\u0001\u001a"+
"\u0001\u001a\u0001\u001a\u0001\u001a\u0003\u001a\u00f4\b\u001a\u0001\u001b"+
"\u0003\u001b\u00f7\b\u001b\u0001\u001c\u0001\u001c\u0001\u001c\u0001\u001c"+
"\u0001\u001c\u0001\u001d\u0001\u001d\u0001\u001d\u0001\u001d\u0003Rdq"+
"\u0000\u001e\u0003\u0001\u0005\u0002\u0007\u0003\t\u0004\u000b\u0005\r"+
"\u0006\u000f\u0007\u0011\b\u0013\t\u0015\n\u0017\u000b\u0019\f\u001b\r"+
"\u001d\u000e\u001f\u0000!\u000f#\u0010%\u0011\'\u0012)\u0013+\u0014-\u0015"+
"/\u00161\u00173\u00005\u00007\u00009\u0000;\u0018=\u0000\u0003\u0000\u0001"+
"\u0002\n\u0002\u0000\t\t \u0002\u0000&&<<\u0002\u0000\"\"<<\u0002\u0000"+
"\'\'<<\u0003\u0000\t\n\r\r \u0003\u000009AFaf\u0001\u000009\u0002\u0000"+
"-.__\u0003\u0000\u00b7\u00b7\u0300\u036f\u203f\u2040\b\u0000::AZaz\u2070"+
"\u218f\u2c00\u2fef\u3001\u8000\ud7ff\u8000\uf900\u8000\ufdcf\u8000\ufdf0"+
"\u8000\ufffd\u010b\u0000\u0003\u0001\u0000\u0000\u0000\u0000\u0005\u0001"+
"\u0000\u0000\u0000\u0000\u0007\u0001\u0000\u0000\u0000\u0000\t\u0001\u0000"+
"\u0000\u0000\u0000\u000b\u0001\u0000\u0000\u0000\u0000\r\u0001\u0000\u0000"+
"\u0000\u0000\u000f\u0001\u0000\u0000\u0000\u0000\u0011\u0001\u0000\u0000"+
"\u0000\u0000\u0013\u0001\u0000\u0000\u0000\u0000\u0015\u0001\u0000\u0000"+
"\u0000\u0000\u0017\u0001\u0000\u0000\u0000\u0000\u0019\u0001\u0000\u0000"+
"\u0000\u0000\u001b\u0001\u0000\u0000\u0000\u0000\u001d\u0001\u0000\u0000"+
"\u0000\u0000\u001f\u0001\u0000\u0000\u0000\u0000!\u0001\u0000\u0000\u0000"+
"\u0001#\u0001\u0000\u0000\u0000\u0001%\u0001\u0000\u0000\u0000\u0001\'"+
"\u0001\u0000\u0000\u0000\u0001)\u0001\u0000\u0000\u0000\u0001+\u0001\u0000"+
"\u0000\u0000\u0001-\u0001\u0000\u0000\u0000\u0001/\u0001\u0000\u0000\u0000"+
"\u00011\u0001\u0000\u0000\u0000\u0002;\u0001\u0000\u0000\u0000\u0002="+
"\u0001\u0000\u0000\u0000\u0003?\u0001\u0000\u0000\u0000\u0005A\u0001\u0000"+
"\u0000\u0000\u0007C\u0001\u0000\u0000\u0000\tE\u0001\u0000\u0000\u0000"+
"\u000bJ\u0001\u0000\u0000\u0000\rN\u0001\u0000\u0000\u0000\u000fW\u0001"+
"\u0000\u0000\u0000\u0011k\u0001\u0000\u0000\u0000\u0013x\u0001\u0000\u0000"+
"\u0000\u0015\u0091\u0001\u0000\u0000\u0000\u0017\u0098\u0001\u0000\u0000"+
"\u0000\u0019\u009c\u0001\u0000\u0000\u0000\u001b\u00a0\u0001\u0000\u0000"+
"\u0000\u001d\u00a5\u0001\u0000\u0000\u0000\u001f\u00af\u0001\u0000\u0000"+
"\u0000!\u00b8\u0001\u0000\u0000\u0000#\u00bc\u0001\u0000\u0000\u0000%"+
"\u00c0\u0001\u0000\u0000\u0000\'\u00c5\u0001\u0000\u0000\u0000)\u00ca"+
"\u0001\u0000\u0000\u0000+\u00cc\u0001\u0000\u0000\u0000-\u00de\u0001\u0000"+
"\u0000\u0000/\u00e0\u0001\u0000\u0000\u00001\u00e7\u0001\u0000\u0000\u0000"+
"3\u00eb\u0001\u0000\u0000\u00005\u00ed\u0001\u0000\u0000\u00007\u00f3"+
"\u0001\u0000\u0000\u00009\u00f6\u0001\u0000\u0000\u0000;\u00f8\u0001\u0000"+
"\u0000\u0000=\u00fd\u0001\u0000\u0000\u0000?@\u0005:\u0000\u0000@\u0004"+
"\u0001\u0000\u0000\u0000AB\u0005!\u0000\u0000B\u0006\u0001\u0000\u0000"+
"\u0000CD\u0005-\u0000\u0000D\b\u0001\u0000\u0000\u0000EF\u0005<\u0000"+
"\u0000FG\u0003\u0005\u0001\u0000GH\u0003\u0007\u0002\u0000HI\u0003\u0007"+
"\u0002\u0000I\n\u0001\u0000\u0000\u0000JK\u0003\u0007\u0002\u0000KL\u0003"+
"\u0007\u0002\u0000LM\u0005>\u0000\u0000M\f\u0001\u0000\u0000\u0000NR\u0003"+
"\t\u0003\u0000OQ\t\u0000\u0000\u0000PO\u0001\u0000\u0000\u0000QT\u0001"+
"\u0000\u0000\u0000RS\u0001\u0000\u0000\u0000RP\u0001\u0000\u0000\u0000"+
"SU\u0001\u0000\u0000\u0000TR\u0001\u0000\u0000\u0000UV\u0003\u000b\u0004"+
"\u0000V\u000e\u0001\u0000\u0000\u0000WX\u0005<\u0000\u0000XY\u0005!\u0000"+
"\u0000YZ\u0005[\u0000\u0000Z[\u0005C\u0000\u0000[\\\u0005D\u0000\u0000"+
"\\]\u0005A\u0000\u0000]^\u0005T\u0000\u0000^_\u0005A\u0000\u0000_`\u0005"+
"[\u0000\u0000`d\u0001\u0000\u0000\u0000ac\t\u0000\u0000\u0000ba\u0001"+
"\u0000\u0000\u0000cf\u0001\u0000\u0000\u0000de\u0001\u0000\u0000\u0000"+
"db\u0001\u0000\u0000\u0000eg\u0001\u0000\u0000\u0000fd\u0001\u0000\u0000"+
"\u0000gh\u0005]\u0000\u0000hi\u0005]\u0000\u0000ij\u0005>\u0000\u0000"+
"j\u0010\u0001\u0000\u0000\u0000kl\u0005<\u0000\u0000lm\u0005!\u0000\u0000"+
"mq\u0001\u0000\u0000\u0000np\t\u0000\u0000\u0000on\u0001\u0000\u0000\u0000"+
"ps\u0001\u0000\u0000\u0000qr\u0001\u0000\u0000\u0000qo\u0001\u0000\u0000"+
"\u0000rt\u0001\u0000\u0000\u0000sq\u0001\u0000\u0000\u0000tu\u0005>\u0000"+
"\u0000uv\u0001\u0000\u0000\u0000vw\u0006\u0007\u0000\u0000w\u0012\u0001"+
"\u0000\u0000\u0000xy\u0005&\u0000\u0000yz\u0003/\u0016\u0000z{\u0005;"+
"\u0000\u0000{\u0014\u0001\u0000\u0000\u0000|}\u0005&\u0000\u0000}~\u0005"+
"#\u0000\u0000~\u0080\u0001\u0000\u0000\u0000\u007f\u0081\u00035\u0019"+
"\u0000\u0080\u007f\u0001\u0000\u0000\u0000\u0081\u0082\u0001\u0000\u0000"+
"\u0000\u0082\u0080\u0001\u0000\u0000\u0000\u0082\u0083\u0001\u0000\u0000"+
"\u0000\u0083\u0084\u0001\u0000\u0000\u0000\u0084\u0085\u0005;\u0000\u0000"+
"\u0085\u0092\u0001\u0000\u0000\u0000\u0086\u0087\u0005&\u0000\u0000\u0087"+
"\u0088\u0005#\u0000\u0000\u0088\u0089\u0005x\u0000\u0000\u0089\u008b\u0001"+
"\u0000\u0000\u0000\u008a\u008c\u00033\u0018\u0000\u008b\u008a\u0001\u0000"+
"\u0000\u0000\u008c\u008d\u0001\u0000\u0000\u0000\u008d\u008b\u0001\u0000"+
"\u0000\u0000\u008d\u008e\u0001\u0000\u0000\u0000\u008e\u008f\u0001\u0000"+
"\u0000\u0000\u008f\u0090\u0005;\u0000\u0000\u0090\u0092\u0001\u0000\u0000"+
"\u0000\u0091|\u0001\u0000\u0000\u0000\u0091\u0086\u0001\u0000\u0000\u0000"+
"\u0092\u0016\u0001\u0000\u0000\u0000\u0093\u0099\u0007\u0000\u0000\u0000"+
"\u0094\u0096\u0005\r\u0000\u0000\u0095\u0094\u0001\u0000\u0000\u0000\u0095"+
"\u0096\u0001\u0000\u0000\u0000\u0096\u0097\u0001\u0000\u0000\u0000\u0097"+
"\u0099\u0005\n\u0000\u0000\u0098\u0093\u0001\u0000\u0000\u0000\u0098\u0095"+
"\u0001\u0000\u0000\u0000\u0099\u009a\u0001\u0000\u0000\u0000\u009a\u0098"+
"\u0001\u0000\u0000\u0000\u009a\u009b\u0001\u0000\u0000\u0000\u009b\u0018"+
"\u0001\u0000\u0000\u0000\u009c\u009d\u0005<\u0000\u0000\u009d\u009e\u0001"+
"\u0000\u0000\u0000\u009e\u009f\u0006\u000b\u0001\u0000\u009f\u001a\u0001"+
"\u0000\u0000\u0000\u00a0\u00a1\u0005<\u0000\u0000\u00a1\u00a2\u0005/\u0000"+
"\u0000\u00a2\u00a3\u0001\u0000\u0000\u0000\u00a3\u00a4\u0006\f\u0001\u0000"+
"\u00a4\u001c\u0001\u0000\u0000\u0000\u00a5\u00a6\u0005<\u0000\u0000\u00a6"+
"\u00a7\u0005?\u0000\u0000\u00a7\u00a8\u0005x\u0000\u0000\u00a8\u00a9\u0005"+
"m\u0000\u0000\u00a9\u00aa\u0005l\u0000\u0000\u00aa\u00ab\u0001\u0000\u0000"+
"\u0000\u00ab\u00ac\u00031\u0017\u0000\u00ac\u00ad\u0001\u0000\u0000\u0000"+
"\u00ad\u00ae\u0006\r\u0001\u0000\u00ae\u001e\u0001\u0000\u0000\u0000\u00af"+
"\u00b0\u0005<\u0000\u0000\u00b0\u00b1\u0005?\u0000\u0000\u00b1\u00b2\u0001"+
"\u0000\u0000\u0000\u00b2\u00b3\u0003/\u0016\u0000\u00b3\u00b4\u0001\u0000"+
"\u0000\u0000\u00b4\u00b5\u0006\u000e\u0002\u0000\u00b5\u00b6\u0006\u000e"+
"\u0003\u0000\u00b6 \u0001\u0000\u0000\u0000\u00b7\u00b9\b\u0001\u0000"+
"\u0000\u00b8\u00b7\u0001\u0000\u0000\u0000\u00b9\u00ba\u0001\u0000\u0000"+
"\u0000\u00ba\u00b8\u0001\u0000\u0000\u0000\u00ba\u00bb\u0001\u0000\u0000"+
"\u0000\u00bb\"\u0001\u0000\u0000\u0000\u00bc\u00bd\u0005>\u0000\u0000"+
"\u00bd\u00be\u0001\u0000\u0000\u0000\u00be\u00bf\u0006\u0010\u0004\u0000"+
"\u00bf$\u0001\u0000\u0000\u0000\u00c0\u00c1\u0005?\u0000\u0000\u00c1\u00c2"+
"\u0005>\u0000\u0000\u00c2\u00c3\u0001\u0000\u0000\u0000\u00c3\u00c4\u0006"+
"\u0011\u0004\u0000\u00c4&\u0001\u0000\u0000\u0000\u00c5\u00c6\u0005/\u0000"+
"\u0000\u00c6\u00c7\u0005>\u0000\u0000\u00c7\u00c8\u0001\u0000\u0000\u0000"+
"\u00c8\u00c9\u0006\u0012\u0004\u0000\u00c9(\u0001\u0000\u0000\u0000\u00ca"+
"\u00cb\u0005/\u0000\u0000\u00cb*\u0001\u0000\u0000\u0000\u00cc\u00cd\u0005"+
"=\u0000\u0000\u00cd,\u0001\u0000\u0000\u0000\u00ce\u00d2\u0005\"\u0000"+
"\u0000\u00cf\u00d1\b\u0002\u0000\u0000\u00d0\u00cf\u0001\u0000\u0000\u0000"+
"\u00d1\u00d4\u0001\u0000\u0000\u0000\u00d2\u00d0\u0001\u0000\u0000\u0000"+
"\u00d2\u00d3\u0001\u0000\u0000\u0000\u00d3\u00d5\u0001\u0000\u0000\u0000"+
"\u00d4\u00d2\u0001\u0000\u0000\u0000\u00d5\u00df\u0005\"\u0000\u0000\u00d6"+
"\u00da\u0005\'\u0000\u0000\u00d7\u00d9\b\u0003\u0000\u0000\u00d8\u00d7"+
"\u0001\u0000\u0000\u0000\u00d9\u00dc\u0001\u0000\u0000\u0000\u00da\u00d8"+
"\u0001\u0000\u0000\u0000\u00da\u00db\u0001\u0000\u0000\u0000\u00db\u00dd"+
"\u0001\u0000\u0000\u0000\u00dc\u00da\u0001\u0000\u0000\u0000\u00dd\u00df"+
"\u0005\'\u0000\u0000\u00de\u00ce\u0001\u0000\u0000\u0000\u00de\u00d6\u0001"+
"\u0000\u0000\u0000\u00df.\u0001\u0000\u0000\u0000\u00e0\u00e4\u00039\u001b"+
"\u0000\u00e1\u00e3\u00037\u001a\u0000\u00e2\u00e1\u0001\u0000\u0000\u0000"+
"\u00e3\u00e6\u0001\u0000\u0000\u0000\u00e4\u00e2\u0001\u0000\u0000\u0000"+
"\u00e4\u00e5\u0001\u0000\u0000\u0000\u00e50\u0001\u0000\u0000\u0000\u00e6"+
"\u00e4\u0001\u0000\u0000\u0000\u00e7\u00e8\u0007\u0004\u0000\u0000\u00e8"+
"\u00e9\u0001\u0000\u0000\u0000\u00e9\u00ea\u0006\u0017\u0000\u0000\u00ea"+
"2\u0001\u0000\u0000\u0000\u00eb\u00ec\u0007\u0005\u0000\u0000\u00ec4\u0001"+
"\u0000\u0000\u0000\u00ed\u00ee\u0007\u0006\u0000\u0000\u00ee6\u0001\u0000"+
"\u0000\u0000\u00ef\u00f4\u00039\u001b\u0000\u00f0\u00f4\u0007\u0007\u0000"+
"\u0000\u00f1\u00f4\u00035\u0019\u0000\u00f2\u00f4\u0007\b\u0000\u0000"+
"\u00f3\u00ef\u0001\u0000\u0000\u0000\u00f3\u00f0\u0001\u0000\u0000\u0000"+
"\u00f3\u00f1\u0001\u0000\u0000\u0000\u00f3\u00f2\u0001\u0000\u0000\u0000"+
"\u00f48\u0001\u0000\u0000\u0000\u00f5\u00f7\u0007\t\u0000\u0000\u00f6"+
"\u00f5\u0001\u0000\u0000\u0000\u00f7:\u0001\u0000\u0000\u0000\u00f8\u00f9"+
"\u0005?\u0000\u0000\u00f9\u00fa\u0005>\u0000\u0000\u00fa\u00fb\u0001\u0000"+
"\u0000\u0000\u00fb\u00fc\u0006\u001c\u0004\u0000\u00fc<\u0001\u0000\u0000"+
"\u0000\u00fd\u00fe\t\u0000\u0000\u0000\u00fe\u00ff\u0001\u0000\u0000\u0000"+
"\u00ff\u0100\u0006\u001d\u0002\u0000\u0100>\u0001\u0000\u0000\u0000\u0013"+
"\u0000\u0001\u0002Rdq\u0082\u008d\u0091\u0095\u0098\u009a\u00ba\u00d2"+
"\u00da\u00de\u00e4\u00f3\u00f6\u0005\u0006\u0000\u0000\u0005\u0001\u0000"+
"\u0003\u0000\u0000\u0005\u0002\u0000\u0004\u0000\u0000";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
_decisionToDFA = new DFA[_ATN.getNumberOfDecisions()];
for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) {
_decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i);
}
}
}
@@ -0,0 +1,33 @@
COLON=1
NOT=2
DASH=3
COMMENT_START=4
COMMENT_END=5
COMMENT=6
CDATA=7
DTD=8
EntityRef=9
CharRef=10
SEA_WS=11
OPEN=12
OPEN_SLASH=13
XMLDeclOpen=14
TEXT=15
CLOSE=16
SPECIAL_CLOSE=17
SLASH_CLOSE=18
SLASH=19
EQUALS=20
STRING=21
Name=22
S=23
PI=24
':'=1
'!'=2
'-'=3
'<'=12
'</'=13
'>'=16
'/>'=18
'/'=19
'='=20
@@ -30,10 +30,14 @@
lexer grammar XMLLexer;
// Default "mode": Everything OUTSIDE of a tag
COLON : ':' ;
NOT : '!' ;
DASH : '-' ;
COMMENT : '<!--' .*? '-->' ;
COLON : ':' ;
NOT : '!' ;
DASH : '-' ;
// When we encounter a comment, enter COMMENT_MODE
COMMENT_START: '<' NOT DASH DASH -> pushMode(COMMENT_MODE);
COMMENT_END : DASH DASH '>' ;
COMMENT : COMMENT_START .*? COMMENT_END ;
CDATA : '<![CDATA[' .*? ']]>' ;
/** Scarf all DTD stuff, Entity Declarations like <!ENTITY ...>,
* and Notation Declarations <!NOTATION ...>
@@ -45,15 +49,20 @@ CharRef : '&#' DIGIT+ ';'
;
SEA_WS : (' '|'\t'|'\r'? '\n')+ ;
OPEN : '<' -> pushMode(INSIDE) ;
OPEN_SLASH : '</' -> pushMode(INSIDE) ;
XMLDeclOpen : '<?xml' S -> pushMode(INSIDE) ;
OPEN : '<' -> pushMode(TAG_MODE) ;
OPEN_SLASH : '</' -> pushMode(TAG_MODE) ;
XMLDeclOpen : '<?xml' S -> pushMode(TAG_MODE) ;
SPECIAL_OPEN: '<?' Name -> more, pushMode(PROC_INSTR) ;
TEXT : ~[<&]+ ; // match any 16 bit char other than < and &
TEXT : ~[<&]+; // match any 16 bit char other than < and &
// ----------------- Inside a comment ------------------------------
mode COMMENT_MODE;
CommentText : ~[<&-]+ -> skip ;
CommentModeEnd : COMMENT_END -> popMode; // Comment ended, exit COMMENT_MODE
// ----------------- Everything INSIDE of a tag ---------------------
mode INSIDE;
mode TAG_MODE;
CLOSE : '>' -> popMode ;
SPECIAL_CLOSE: '?>' -> popMode ; // close <?xml...?>
@@ -75,7 +84,7 @@ DIGIT : [0-9] ;
fragment
NameChar : NameStartChar
| '-' | '_' | '.' | DIGIT
| DASH | '_' | '.' | DIGIT
| '\u00B7'
| '\u0300'..'\u036F'
| '\u203F'..'\u2040'
File diff suppressed because one or more lines are too long
@@ -17,43 +17,45 @@ public class XMLLexer extends Lexer {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
COLON=1, NOT=2, DASH=3, COMMENT=4, CDATA=5, DTD=6, EntityRef=7, CharRef=8,
SEA_WS=9, OPEN=10, OPEN_SLASH=11, XMLDeclOpen=12, TEXT=13, CLOSE=14, SPECIAL_CLOSE=15,
SLASH_CLOSE=16, SLASH=17, EQUALS=18, STRING=19, Name=20, S=21, PI=22;
COLON=1, NOT=2, DASH=3, COMMENT_START=4, COMMENT_END=5, COMMENT=6, CDATA=7,
DTD=8, EntityRef=9, CharRef=10, SEA_WS=11, OPEN=12, OPEN_SLASH=13, XMLDeclOpen=14,
TEXT=15, CommentText=16, CommentModeEnd=17, CLOSE=18, SPECIAL_CLOSE=19,
SLASH_CLOSE=20, SLASH=21, EQUALS=22, STRING=23, Name=24, S=25, PI=26;
public static final int
INSIDE=1, PROC_INSTR=2;
COMMENT_MODE=1, TAG_MODE=2, PROC_INSTR=3;
public static String[] channelNames = {
"DEFAULT_TOKEN_CHANNEL", "HIDDEN"
};
public static String[] modeNames = {
"DEFAULT_MODE", "INSIDE", "PROC_INSTR"
"DEFAULT_MODE", "COMMENT_MODE", "TAG_MODE", "PROC_INSTR"
};
private static String[] makeRuleNames() {
return new String[] {
"COLON", "NOT", "DASH", "COMMENT", "CDATA", "DTD", "EntityRef", "CharRef",
"SEA_WS", "OPEN", "OPEN_SLASH", "XMLDeclOpen", "SPECIAL_OPEN", "TEXT",
"CLOSE", "SPECIAL_CLOSE", "SLASH_CLOSE", "SLASH", "EQUALS", "STRING",
"Name", "S", "HEXDIGIT", "DIGIT", "NameChar", "NameStartChar", "PI",
"IGNORE"
"COLON", "NOT", "DASH", "COMMENT_START", "COMMENT_END", "COMMENT", "CDATA",
"DTD", "EntityRef", "CharRef", "SEA_WS", "OPEN", "OPEN_SLASH", "XMLDeclOpen",
"SPECIAL_OPEN", "TEXT", "CommentText", "CommentModeEnd", "CLOSE", "SPECIAL_CLOSE",
"SLASH_CLOSE", "SLASH", "EQUALS", "STRING", "Name", "S", "HEXDIGIT",
"DIGIT", "NameChar", "NameStartChar", "PI", "IGNORE"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, "':'", "'!'", "'-'", null, null, null, null, null, null, "'<'",
"'</'", null, null, "'>'", null, "'/>'", "'/'", "'='"
null, "':'", "'!'", "'-'", null, null, null, null, null, null, null,
null, "'<'", "'</'", null, null, null, null, "'>'", null, "'/>'", "'/'",
"'='"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, "COLON", "NOT", "DASH", "COMMENT", "CDATA", "DTD", "EntityRef",
"CharRef", "SEA_WS", "OPEN", "OPEN_SLASH", "XMLDeclOpen", "TEXT", "CLOSE",
"SPECIAL_CLOSE", "SLASH_CLOSE", "SLASH", "EQUALS", "STRING", "Name",
"S", "PI"
null, "COLON", "NOT", "DASH", "COMMENT_START", "COMMENT_END", "COMMENT",
"CDATA", "DTD", "EntityRef", "CharRef", "SEA_WS", "OPEN", "OPEN_SLASH",
"XMLDeclOpen", "TEXT", "CommentText", "CommentModeEnd", "CLOSE", "SPECIAL_CLOSE",
"SLASH_CLOSE", "SLASH", "EQUALS", "STRING", "Name", "S", "PI"
};
}
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
@@ -115,89 +117,100 @@ public class XMLLexer extends Lexer {
public ATN getATN() { return _ATN; }
public static final String _serializedATN =
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\30\u00fc\b\1\b\1"+
"\b\1\4\2\t\2\4\3\t\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\4"+
"\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t"+
"\21\4\22\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t"+
"\30\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\3\2\3\2\3\3\3\3"+
"\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\7\5J\n\5\f\5\16\5M\13\5\3\5\3\5\3\5\3"+
"\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\7\6^\n\6\f\6\16\6a\13\6"+
"\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\7\7k\n\7\f\7\16\7n\13\7\3\7\3\7\3\7\3"+
"\7\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\6\t|\n\t\r\t\16\t}\3\t\3\t\3\t\3\t"+
"\3\t\3\t\3\t\6\t\u0087\n\t\r\t\16\t\u0088\3\t\3\t\5\t\u008d\n\t\3\n\3"+
"\n\5\n\u0091\n\n\3\n\6\n\u0094\n\n\r\n\16\n\u0095\3\13\3\13\3\13\3\13"+
"\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16"+
"\3\16\3\16\3\16\3\16\3\16\3\16\3\17\6\17\u00b4\n\17\r\17\16\17\u00b5\3"+
"\20\3\20\3\20\3\20\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3"+
"\23\3\23\3\24\3\24\3\25\3\25\7\25\u00cc\n\25\f\25\16\25\u00cf\13\25\3"+
"\25\3\25\3\25\7\25\u00d4\n\25\f\25\16\25\u00d7\13\25\3\25\5\25\u00da\n"+
"\25\3\26\3\26\7\26\u00de\n\26\f\26\16\26\u00e1\13\26\3\27\3\27\3\27\3"+
"\27\3\30\3\30\3\31\3\31\3\32\3\32\3\32\3\32\5\32\u00ef\n\32\3\33\5\33"+
"\u00f2\n\33\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\35\5K_l\2\36\5\3"+
"\7\4\t\5\13\6\r\7\17\b\21\t\23\n\25\13\27\f\31\r\33\16\35\2\37\17!\20"+
"#\21%\22\'\23)\24+\25-\26/\27\61\2\63\2\65\2\67\29\30;\2\5\2\3\4\f\4\2"+
"\13\13\"\"\4\2((>>\4\2$$>>\4\2))>>\5\2\13\f\17\17\"\"\5\2\62;CHch\3\2"+
"\62;\4\2/\60aa\5\2\u00b9\u00b9\u0302\u0371\u2041\u2042\n\2<<C\\c|\u2072"+
"\u2191\u2c02\u2ff1\u3003\ud801\uf902\ufdd1\ufdf2\uffff\2\u0106\2\5\3\2"+
"\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2\2\2\2\17\3\2\2\2\2\21"+
"\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2\2\31\3\2\2\2\2\33\3\2"+
"\2\2\2\35\3\2\2\2\2\37\3\2\2\2\3!\3\2\2\2\3#\3\2\2\2\3%\3\2\2\2\3\'\3"+
"\2\2\2\3)\3\2\2\2\3+\3\2\2\2\3-\3\2\2\2\3/\3\2\2\2\49\3\2\2\2\4;\3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2v\22\3\2\2\2wx\7(\2\2xy\7%\2\2y{\3\2\2\2z"+
"|\5\63\31\2{z\3\2\2\2|}\3\2\2\2}{\3\2\2\2}~\3\2\2\2~\177\3\2\2\2\177\u0080"+
"\7=\2\2\u0080\u008d\3\2\2\2\u0081\u0082\7(\2\2\u0082\u0083\7%\2\2\u0083"+
"\u0084\7z\2\2\u0084\u0086\3\2\2\2\u0085\u0087\5\61\30\2\u0086\u0085\3"+
"\2\2\2\u0087\u0088\3\2\2\2\u0088\u0086\3\2\2\2\u0088\u0089\3\2\2\2\u0089"+
"\u008a\3\2\2\2\u008a\u008b\7=\2\2\u008b\u008d\3\2\2\2\u008cw\3\2\2\2\u008c"+
"\u0081\3\2\2\2\u008d\24\3\2\2\2\u008e\u0094\t\2\2\2\u008f\u0091\7\17\2"+
"\2\u0090\u008f\3\2\2\2\u0090\u0091\3\2\2\2\u0091\u0092\3\2\2\2\u0092\u0094"+
"\7\f\2\2\u0093\u008e\3\2\2\2\u0093\u0090\3\2\2\2\u0094\u0095\3\2\2\2\u0095"+
"\u0093\3\2\2\2\u0095\u0096\3\2\2\2\u0096\26\3\2\2\2\u0097\u0098\7>\2\2"+
"\u0098\u0099\3\2\2\2\u0099\u009a\b\13\3\2\u009a\30\3\2\2\2\u009b\u009c"+
"\7>\2\2\u009c\u009d\7\61\2\2\u009d\u009e\3\2\2\2\u009e\u009f\b\f\3\2\u009f"+
"\32\3\2\2\2\u00a0\u00a1\7>\2\2\u00a1\u00a2\7A\2\2\u00a2\u00a3\7z\2\2\u00a3"+
"\u00a4\7o\2\2\u00a4\u00a5\7n\2\2\u00a5\u00a6\3\2\2\2\u00a6\u00a7\5/\27"+
"\2\u00a7\u00a8\3\2\2\2\u00a8\u00a9\b\r\3\2\u00a9\34\3\2\2\2\u00aa\u00ab"+
"\7>\2\2\u00ab\u00ac\7A\2\2\u00ac\u00ad\3\2\2\2\u00ad\u00ae\5-\26\2\u00ae"+
"\u00af\3\2\2\2\u00af\u00b0\b\16\4\2\u00b0\u00b1\b\16\5\2\u00b1\36\3\2"+
"\2\2\u00b2\u00b4\n\3\2\2\u00b3\u00b2\3\2\2\2\u00b4\u00b5\3\2\2\2\u00b5"+
"\u00b3\3\2\2\2\u00b5\u00b6\3\2\2\2\u00b6 \3\2\2\2\u00b7\u00b8\7@\2\2\u00b8"+
"\u00b9\3\2\2\2\u00b9\u00ba\b\20\6\2\u00ba\"\3\2\2\2\u00bb\u00bc\7A\2\2"+
"\u00bc\u00bd\7@\2\2\u00bd\u00be\3\2\2\2\u00be\u00bf\b\21\6\2\u00bf$\3"+
"\2\2\2\u00c0\u00c1\7\61\2\2\u00c1\u00c2\7@\2\2\u00c2\u00c3\3\2\2\2\u00c3"+
"\u00c4\b\22\6\2\u00c4&\3\2\2\2\u00c5\u00c6\7\61\2\2\u00c6(\3\2\2\2\u00c7"+
"\u00c8\7?\2\2\u00c8*\3\2\2\2\u00c9\u00cd\7$\2\2\u00ca\u00cc\n\4\2\2\u00cb"+
"\u00ca\3\2\2\2\u00cc\u00cf\3\2\2\2\u00cd\u00cb\3\2\2\2\u00cd\u00ce\3\2"+
"\2\2\u00ce\u00d0\3\2\2\2\u00cf\u00cd\3\2\2\2\u00d0\u00da\7$\2\2\u00d1"+
"\u00d5\7)\2\2\u00d2\u00d4\n\5\2\2\u00d3\u00d2\3\2\2\2\u00d4\u00d7\3\2"+
"\2\2\u00d5\u00d3\3\2\2\2\u00d5\u00d6\3\2\2\2\u00d6\u00d8\3\2\2\2\u00d7"+
"\u00d5\3\2\2\2\u00d8\u00da\7)\2\2\u00d9\u00c9\3\2\2\2\u00d9\u00d1\3\2"+
"\2\2\u00da,\3\2\2\2\u00db\u00df\5\67\33\2\u00dc\u00de\5\65\32\2\u00dd"+
"\u00dc\3\2\2\2\u00de\u00e1\3\2\2\2\u00df\u00dd\3\2\2\2\u00df\u00e0\3\2"+
"\2\2\u00e0.\3\2\2\2\u00e1\u00df\3\2\2\2\u00e2\u00e3\t\6\2\2\u00e3\u00e4"+
"\3\2\2\2\u00e4\u00e5\b\27\2\2\u00e5\60\3\2\2\2\u00e6\u00e7\t\7\2\2\u00e7"+
"\62\3\2\2\2\u00e8\u00e9\t\b\2\2\u00e9\64\3\2\2\2\u00ea\u00ef\5\67\33\2"+
"\u00eb\u00ef\t\t\2\2\u00ec\u00ef\5\63\31\2\u00ed\u00ef\t\n\2\2\u00ee\u00ea"+
"\3\2\2\2\u00ee\u00eb\3\2\2\2\u00ee\u00ec\3\2\2\2\u00ee\u00ed\3\2\2\2\u00ef"+
"\66\3\2\2\2\u00f0\u00f2\t\13\2\2\u00f1\u00f0\3\2\2\2\u00f28\3\2\2\2\u00f3"+
"\u00f4\7A\2\2\u00f4\u00f5\7@\2\2\u00f5\u00f6\3\2\2\2\u00f6\u00f7\b\34"+
"\6\2\u00f7:\3\2\2\2\u00f8\u00f9\13\2\2\2\u00f9\u00fa\3\2\2\2\u00fa\u00fb"+
"\b\35\4\2\u00fb<\3\2\2\2\25\2\3\4K_l}\u0088\u008c\u0090\u0093\u0095\u00b5"+
"\u00cd\u00d5\u00d9\u00df\u00ee\u00f1\7\b\2\2\7\3\2\5\2\2\7\4\2\6\2\2";
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\34\u0116\b\1\b\1"+
"\b\1\b\1\4\2\t\2\4\3\t\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\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21"+
"\t\21\4\22\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30"+
"\t\30\4\31\t\31\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37"+
"\t\37\4 \t \4!\t!\3\2\3\2\3\3\3\3\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5"+
"\3\6\3\6\3\6\3\6\3\7\3\7\7\7Z\n\7\f\7\16\7]\13\7\3\7\3\7\3\b\3\b\3\b\3"+
"\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\7\bl\n\b\f\b\16\bo\13\b\3\b\3\b\3\b\3\b"+
"\3\t\3\t\3\t\3\t\7\ty\n\t\f\t\16\t|\13\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3"+
"\n\3\13\3\13\3\13\3\13\6\13\u008a\n\13\r\13\16\13\u008b\3\13\3\13\3\13"+
"\3\13\3\13\3\13\3\13\6\13\u0095\n\13\r\13\16\13\u0096\3\13\3\13\5\13\u009b"+
"\n\13\3\f\3\f\5\f\u009f\n\f\3\f\6\f\u00a2\n\f\r\f\16\f\u00a3\3\r\3\r\3"+
"\r\3\r\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+
"\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\6\21\u00c2\n\21"+
"\r\21\16\21\u00c3\3\22\6\22\u00c7\n\22\r\22\16\22\u00c8\3\22\3\22\3\23"+
"\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\26\3\26"+
"\3\26\3\26\3\26\3\27\3\27\3\30\3\30\3\31\3\31\7\31\u00e5\n\31\f\31\16"+
"\31\u00e8\13\31\3\31\3\31\3\31\7\31\u00ed\n\31\f\31\16\31\u00f0\13\31"+
"\3\31\5\31\u00f3\n\31\3\32\3\32\7\32\u00f7\n\32\f\32\16\32\u00fa\13\32"+
"\3\33\3\33\3\33\3\33\3\34\3\34\3\35\3\35\3\36\3\36\3\36\3\36\3\36\5\36"+
"\u0109\n\36\3\37\5\37\u010c\n\37\3 \3 \3 \3 \3 \3!\3!\3!\3!\5[mz\2\"\6"+
"\3\b\4\n\5\f\6\16\7\20\b\22\t\24\n\26\13\30\f\32\r\34\16\36\17 \20\"\2"+
"$\21&\22(\23*\24,\25.\26\60\27\62\30\64\31\66\328\33:\2<\2>\2@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7\3\2\2\2HI\7#\2\2I\t\3\2\2\2JK\7/\2\2K\13\3\2\2\2LM\7>\2\2MN\5\b\3"+
"\2NO\5\n\4\2OP\5\n\4\2PQ\3\2\2\2QR\b\5\2\2R\r\3\2\2\2ST\5\n\4\2TU\5\n"+
"\4\2UV\7@\2\2V\17\3\2\2\2W[\5\f\5\2XZ\13\2\2\2YX\3\2\2\2Z]\3\2\2\2[\\"+
"\3\2\2\2[Y\3\2\2\2\\^\3\2\2\2][\3\2\2\2^_\5\16\6\2_\21\3\2\2\2`a\7>\2"+
"\2ab\7#\2\2bc\7]\2\2cd\7E\2\2de\7F\2\2ef\7C\2\2fg\7V\2\2gh\7C\2\2hi\7"+
"]\2\2im\3\2\2\2jl\13\2\2\2kj\3\2\2\2lo\3\2\2\2mn\3\2\2\2mk\3\2\2\2np\3"+
"\2\2\2om\3\2\2\2pq\7_\2\2qr\7_\2\2rs\7@\2\2s\23\3\2\2\2tu\7>\2\2uv\7#"+
"\2\2vz\3\2\2\2wy\13\2\2\2xw\3\2\2\2y|\3\2\2\2z{\3\2\2\2zx\3\2\2\2{}\3"+
"\2\2\2|z\3\2\2\2}~\7@\2\2~\177\3\2\2\2\177\u0080\b\t\3\2\u0080\25\3\2"+
"\2\2\u0081\u0082\7(\2\2\u0082\u0083\5\66\32\2\u0083\u0084\7=\2\2\u0084"+
"\27\3\2\2\2\u0085\u0086\7(\2\2\u0086\u0087\7%\2\2\u0087\u0089\3\2\2\2"+
"\u0088\u008a\5<\35\2\u0089\u0088\3\2\2\2\u008a\u008b\3\2\2\2\u008b\u0089"+
"\3\2\2\2\u008b\u008c\3\2\2\2\u008c\u008d\3\2\2\2\u008d\u008e\7=\2\2\u008e"+
"\u009b\3\2\2\2\u008f\u0090\7(\2\2\u0090\u0091\7%\2\2\u0091\u0092\7z\2"+
"\2\u0092\u0094\3\2\2\2\u0093\u0095\5:\34\2\u0094\u0093\3\2\2\2\u0095\u0096"+
"\3\2\2\2\u0096\u0094\3\2\2\2\u0096\u0097\3\2\2\2\u0097\u0098\3\2\2\2\u0098"+
"\u0099\7=\2\2\u0099\u009b\3\2\2\2\u009a\u0085\3\2\2\2\u009a\u008f\3\2"+
"\2\2\u009b\31\3\2\2\2\u009c\u00a2\t\2\2\2\u009d\u009f\7\17\2\2\u009e\u009d"+
"\3\2\2\2\u009e\u009f\3\2\2\2\u009f\u00a0\3\2\2\2\u00a0\u00a2\7\f\2\2\u00a1"+
"\u009c\3\2\2\2\u00a1\u009e\3\2\2\2\u00a2\u00a3\3\2\2\2\u00a3\u00a1\3\2"+
"\2\2\u00a3\u00a4\3\2\2\2\u00a4\33\3\2\2\2\u00a5\u00a6\7>\2\2\u00a6\u00a7"+
"\3\2\2\2\u00a7\u00a8\b\r\4\2\u00a8\35\3\2\2\2\u00a9\u00aa\7>\2\2\u00aa"+
"\u00ab\7\61\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ad\b\16\4\2\u00ad\37\3\2"+
"\2\2\u00ae\u00af\7>\2\2\u00af\u00b0\7A\2\2\u00b0\u00b1\7z\2\2\u00b1\u00b2"+
"\7o\2\2\u00b2\u00b3\7n\2\2\u00b3\u00b4\3\2\2\2\u00b4\u00b5\58\33\2\u00b5"+
"\u00b6\3\2\2\2\u00b6\u00b7\b\17\4\2\u00b7!\3\2\2\2\u00b8\u00b9\7>\2\2"+
"\u00b9\u00ba\7A\2\2\u00ba\u00bb\3\2\2\2\u00bb\u00bc\5\66\32\2\u00bc\u00bd"+
"\3\2\2\2\u00bd\u00be\b\20\5\2\u00be\u00bf\b\20\6\2\u00bf#\3\2\2\2\u00c0"+
"\u00c2\n\3\2\2\u00c1\u00c0\3\2\2\2\u00c2\u00c3\3\2\2\2\u00c3\u00c1\3\2"+
"\2\2\u00c3\u00c4\3\2\2\2\u00c4%\3\2\2\2\u00c5\u00c7\n\4\2\2\u00c6\u00c5"+
"\3\2\2\2\u00c7\u00c8\3\2\2\2\u00c8\u00c6\3\2\2\2\u00c8\u00c9\3\2\2\2\u00c9"+
"\u00ca\3\2\2\2\u00ca\u00cb\b\22\3\2\u00cb\'\3\2\2\2\u00cc\u00cd\5\16\6"+
"\2\u00cd\u00ce\3\2\2\2\u00ce\u00cf\b\23\7\2\u00cf)\3\2\2\2\u00d0\u00d1"+
"\7@\2\2\u00d1\u00d2\3\2\2\2\u00d2\u00d3\b\24\7\2\u00d3+\3\2\2\2\u00d4"+
"\u00d5\7A\2\2\u00d5\u00d6\7@\2\2\u00d6\u00d7\3\2\2\2\u00d7\u00d8\b\25"+
"\7\2\u00d8-\3\2\2\2\u00d9\u00da\7\61\2\2\u00da\u00db\7@\2\2\u00db\u00dc"+
"\3\2\2\2\u00dc\u00dd\b\26\7\2\u00dd/\3\2\2\2\u00de\u00df\7\61\2\2\u00df"+
"\61\3\2\2\2\u00e0\u00e1\7?\2\2\u00e1\63\3\2\2\2\u00e2\u00e6\7$\2\2\u00e3"+
"\u00e5\n\5\2\2\u00e4\u00e3\3\2\2\2\u00e5\u00e8\3\2\2\2\u00e6\u00e4\3\2"+
"\2\2\u00e6\u00e7\3\2\2\2\u00e7\u00e9\3\2\2\2\u00e8\u00e6\3\2\2\2\u00e9"+
"\u00f3\7$\2\2\u00ea\u00ee\7)\2\2\u00eb\u00ed\n\6\2\2\u00ec\u00eb\3\2\2"+
"\2\u00ed\u00f0\3\2\2\2\u00ee\u00ec\3\2\2\2\u00ee\u00ef\3\2\2\2\u00ef\u00f1"+
"\3\2\2\2\u00f0\u00ee\3\2\2\2\u00f1\u00f3\7)\2\2\u00f2\u00e2\3\2\2\2\u00f2"+
"\u00ea\3\2\2\2\u00f3\65\3\2\2\2\u00f4\u00f8\5@\37\2\u00f5\u00f7\5>\36"+
"\2\u00f6\u00f5\3\2\2\2\u00f7\u00fa\3\2\2\2\u00f8\u00f6\3\2\2\2\u00f8\u00f9"+
"\3\2\2\2\u00f9\67\3\2\2\2\u00fa\u00f8\3\2\2\2\u00fb\u00fc\t\7\2\2\u00fc"+
"\u00fd\3\2\2\2\u00fd\u00fe\b\33\3\2\u00fe9\3\2\2\2\u00ff\u0100\t\b\2\2"+
"\u0100;\3\2\2\2\u0101\u0102\t\t\2\2\u0102=\3\2\2\2\u0103\u0109\5@\37\2"+
"\u0104\u0109\5\n\4\2\u0105\u0109\t\n\2\2\u0106\u0109\5<\35\2\u0107\u0109"+
"\t\13\2\2\u0108\u0103\3\2\2\2\u0108\u0104\3\2\2\2\u0108\u0105\3\2\2\2"+
"\u0108\u0106\3\2\2\2\u0108\u0107\3\2\2\2\u0109?\3\2\2\2\u010a\u010c\t"+
"\f\2\2\u010b\u010a\3\2\2\2\u010cA\3\2\2\2\u010d\u010e\7A\2\2\u010e\u010f"+
"\7@\2\2\u010f\u0110\3\2\2\2\u0110\u0111\b \7\2\u0111C\3\2\2\2\u0112\u0113"+
"\13\2\2\2\u0113\u0114\3\2\2\2\u0114\u0115\b!\5\2\u0115E\3\2\2\2\27\2\3"+
"\4\5[mz\u008b\u0096\u009a\u009e\u00a1\u00a3\u00c3\u00c8\u00e6\u00ee\u00f2"+
"\u00f8\u0108\u010b\b\7\3\2\b\2\2\7\4\2\5\2\2\7\5\2\6\2\2";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
@@ -1,31 +1,35 @@
COLON=1
NOT=2
DASH=3
COMMENT=4
CDATA=5
DTD=6
EntityRef=7
CharRef=8
SEA_WS=9
OPEN=10
OPEN_SLASH=11
XMLDeclOpen=12
TEXT=13
CLOSE=14
SPECIAL_CLOSE=15
SLASH_CLOSE=16
SLASH=17
EQUALS=18
STRING=19
Name=20
S=21
PI=22
COMMENT_START=4
COMMENT_END=5
COMMENT=6
CDATA=7
DTD=8
EntityRef=9
CharRef=10
SEA_WS=11
OPEN=12
OPEN_SLASH=13
XMLDeclOpen=14
TEXT=15
CommentText=16
CommentModeEnd=17
CLOSE=18
SPECIAL_CLOSE=19
SLASH_CLOSE=20
SLASH=21
EQUALS=22
STRING=23
Name=24
S=25
PI=26
':'=1
'!'=2
'-'=3
'<'=10
'</'=11
'>'=14
'/>'=16
'/'=17
'='=18
'<'=12
'</'=13
'>'=18
'/>'=20
'/'=21
'='=22
@@ -9,10 +9,14 @@ null
null
null
null
null
null
'<'
'</'
null
null
null
null
'>'
null
'/>'
@@ -28,6 +32,8 @@ null
COLON
NOT
DASH
COMMENT_START
COMMENT_END
COMMENT
CDATA
DTD
@@ -38,6 +44,8 @@ OPEN
OPEN_SLASH
XMLDeclOpen
TEXT
CommentText
CommentModeEnd
CLOSE
SPECIAL_CLOSE
SLASH_CLOSE
@@ -63,4 +71,4 @@ misc
atn:
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 24, 112, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 3, 2, 5, 2, 26, 10, 2, 3, 2, 7, 2, 29, 10, 2, 12, 2, 14, 2, 32, 11, 2, 3, 2, 3, 2, 7, 2, 36, 10, 2, 12, 2, 14, 2, 39, 11, 2, 3, 3, 3, 3, 7, 3, 43, 10, 3, 12, 3, 14, 3, 46, 11, 3, 3, 3, 3, 3, 3, 4, 5, 4, 51, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 58, 10, 4, 3, 4, 5, 4, 61, 10, 4, 7, 4, 63, 10, 4, 12, 4, 14, 4, 66, 11, 4, 3, 5, 3, 5, 5, 5, 70, 10, 5, 3, 6, 3, 6, 3, 6, 7, 6, 75, 10, 6, 12, 6, 14, 6, 78, 11, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 7, 7, 89, 10, 7, 12, 7, 14, 7, 92, 11, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 5, 9, 99, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 2, 2, 13, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 2, 5, 3, 2, 9, 10, 4, 2, 11, 11, 15, 15, 5, 2, 6, 6, 11, 11, 24, 24, 2, 115, 2, 25, 3, 2, 2, 2, 4, 40, 3, 2, 2, 2, 6, 50, 3, 2, 2, 2, 8, 69, 3, 2, 2, 2, 10, 71, 3, 2, 2, 2, 12, 85, 3, 2, 2, 2, 14, 95, 3, 2, 2, 2, 16, 98, 3, 2, 2, 2, 18, 104, 3, 2, 2, 2, 20, 107, 3, 2, 2, 2, 22, 109, 3, 2, 2, 2, 24, 26, 5, 4, 3, 2, 25, 24, 3, 2, 2, 2, 25, 26, 3, 2, 2, 2, 26, 30, 3, 2, 2, 2, 27, 29, 5, 22, 12, 2, 28, 27, 3, 2, 2, 2, 29, 32, 3, 2, 2, 2, 30, 28, 3, 2, 2, 2, 30, 31, 3, 2, 2, 2, 31, 33, 3, 2, 2, 2, 32, 30, 3, 2, 2, 2, 33, 37, 5, 8, 5, 2, 34, 36, 5, 22, 12, 2, 35, 34, 3, 2, 2, 2, 36, 39, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 3, 3, 2, 2, 2, 39, 37, 3, 2, 2, 2, 40, 44, 7, 14, 2, 2, 41, 43, 5, 16, 9, 2, 42, 41, 3, 2, 2, 2, 43, 46, 3, 2, 2, 2, 44, 42, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 47, 3, 2, 2, 2, 46, 44, 3, 2, 2, 2, 47, 48, 7, 17, 2, 2, 48, 5, 3, 2, 2, 2, 49, 51, 5, 20, 11, 2, 50, 49, 3, 2, 2, 2, 50, 51, 3, 2, 2, 2, 51, 64, 3, 2, 2, 2, 52, 58, 5, 8, 5, 2, 53, 58, 5, 14, 8, 2, 54, 58, 7, 7, 2, 2, 55, 58, 7, 24, 2, 2, 56, 58, 7, 6, 2, 2, 57, 52, 3, 2, 2, 2, 57, 53, 3, 2, 2, 2, 57, 54, 3, 2, 2, 2, 57, 55, 3, 2, 2, 2, 57, 56, 3, 2, 2, 2, 58, 60, 3, 2, 2, 2, 59, 61, 5, 20, 11, 2, 60, 59, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 63, 3, 2, 2, 2, 62, 57, 3, 2, 2, 2, 63, 66, 3, 2, 2, 2, 64, 62, 3, 2, 2, 2, 64, 65, 3, 2, 2, 2, 65, 7, 3, 2, 2, 2, 66, 64, 3, 2, 2, 2, 67, 70, 5, 10, 6, 2, 68, 70, 5, 12, 7, 2, 69, 67, 3, 2, 2, 2, 69, 68, 3, 2, 2, 2, 70, 9, 3, 2, 2, 2, 71, 72, 7, 12, 2, 2, 72, 76, 7, 22, 2, 2, 73, 75, 5, 16, 9, 2, 74, 73, 3, 2, 2, 2, 75, 78, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 76, 77, 3, 2, 2, 2, 77, 79, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 79, 80, 7, 16, 2, 2, 80, 81, 5, 6, 4, 2, 81, 82, 7, 13, 2, 2, 82, 83, 7, 22, 2, 2, 83, 84, 7, 16, 2, 2, 84, 11, 3, 2, 2, 2, 85, 86, 7, 12, 2, 2, 86, 90, 7, 22, 2, 2, 87, 89, 5, 16, 9, 2, 88, 87, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 93, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 94, 7, 18, 2, 2, 94, 13, 3, 2, 2, 2, 95, 96, 9, 2, 2, 2, 96, 15, 3, 2, 2, 2, 97, 99, 5, 18, 10, 2, 98, 97, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 101, 7, 22, 2, 2, 101, 102, 7, 20, 2, 2, 102, 103, 7, 21, 2, 2, 103, 17, 3, 2, 2, 2, 104, 105, 7, 22, 2, 2, 105, 106, 7, 3, 2, 2, 106, 19, 3, 2, 2, 2, 107, 108, 9, 3, 2, 2, 108, 21, 3, 2, 2, 2, 109, 110, 9, 4, 2, 2, 110, 23, 3, 2, 2, 2, 14, 25, 30, 37, 44, 50, 57, 60, 64, 69, 76, 90, 98]
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 28, 112, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 3, 2, 5, 2, 26, 10, 2, 3, 2, 7, 2, 29, 10, 2, 12, 2, 14, 2, 32, 11, 2, 3, 2, 3, 2, 7, 2, 36, 10, 2, 12, 2, 14, 2, 39, 11, 2, 3, 3, 3, 3, 7, 3, 43, 10, 3, 12, 3, 14, 3, 46, 11, 3, 3, 3, 3, 3, 3, 4, 5, 4, 51, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 58, 10, 4, 3, 4, 5, 4, 61, 10, 4, 7, 4, 63, 10, 4, 12, 4, 14, 4, 66, 11, 4, 3, 5, 3, 5, 5, 5, 70, 10, 5, 3, 6, 3, 6, 3, 6, 7, 6, 75, 10, 6, 12, 6, 14, 6, 78, 11, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 7, 7, 89, 10, 7, 12, 7, 14, 7, 92, 11, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 9, 5, 9, 99, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 2, 2, 13, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 2, 5, 3, 2, 11, 12, 4, 2, 13, 13, 17, 17, 5, 2, 8, 8, 13, 13, 28, 28, 2, 115, 2, 25, 3, 2, 2, 2, 4, 40, 3, 2, 2, 2, 6, 50, 3, 2, 2, 2, 8, 69, 3, 2, 2, 2, 10, 71, 3, 2, 2, 2, 12, 85, 3, 2, 2, 2, 14, 95, 3, 2, 2, 2, 16, 98, 3, 2, 2, 2, 18, 104, 3, 2, 2, 2, 20, 107, 3, 2, 2, 2, 22, 109, 3, 2, 2, 2, 24, 26, 5, 4, 3, 2, 25, 24, 3, 2, 2, 2, 25, 26, 3, 2, 2, 2, 26, 30, 3, 2, 2, 2, 27, 29, 5, 22, 12, 2, 28, 27, 3, 2, 2, 2, 29, 32, 3, 2, 2, 2, 30, 28, 3, 2, 2, 2, 30, 31, 3, 2, 2, 2, 31, 33, 3, 2, 2, 2, 32, 30, 3, 2, 2, 2, 33, 37, 5, 8, 5, 2, 34, 36, 5, 22, 12, 2, 35, 34, 3, 2, 2, 2, 36, 39, 3, 2, 2, 2, 37, 35, 3, 2, 2, 2, 37, 38, 3, 2, 2, 2, 38, 3, 3, 2, 2, 2, 39, 37, 3, 2, 2, 2, 40, 44, 7, 16, 2, 2, 41, 43, 5, 16, 9, 2, 42, 41, 3, 2, 2, 2, 43, 46, 3, 2, 2, 2, 44, 42, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 47, 3, 2, 2, 2, 46, 44, 3, 2, 2, 2, 47, 48, 7, 21, 2, 2, 48, 5, 3, 2, 2, 2, 49, 51, 5, 20, 11, 2, 50, 49, 3, 2, 2, 2, 50, 51, 3, 2, 2, 2, 51, 64, 3, 2, 2, 2, 52, 58, 5, 8, 5, 2, 53, 58, 5, 14, 8, 2, 54, 58, 7, 9, 2, 2, 55, 58, 7, 28, 2, 2, 56, 58, 7, 8, 2, 2, 57, 52, 3, 2, 2, 2, 57, 53, 3, 2, 2, 2, 57, 54, 3, 2, 2, 2, 57, 55, 3, 2, 2, 2, 57, 56, 3, 2, 2, 2, 58, 60, 3, 2, 2, 2, 59, 61, 5, 20, 11, 2, 60, 59, 3, 2, 2, 2, 60, 61, 3, 2, 2, 2, 61, 63, 3, 2, 2, 2, 62, 57, 3, 2, 2, 2, 63, 66, 3, 2, 2, 2, 64, 62, 3, 2, 2, 2, 64, 65, 3, 2, 2, 2, 65, 7, 3, 2, 2, 2, 66, 64, 3, 2, 2, 2, 67, 70, 5, 10, 6, 2, 68, 70, 5, 12, 7, 2, 69, 67, 3, 2, 2, 2, 69, 68, 3, 2, 2, 2, 70, 9, 3, 2, 2, 2, 71, 72, 7, 14, 2, 2, 72, 76, 7, 26, 2, 2, 73, 75, 5, 16, 9, 2, 74, 73, 3, 2, 2, 2, 75, 78, 3, 2, 2, 2, 76, 74, 3, 2, 2, 2, 76, 77, 3, 2, 2, 2, 77, 79, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 79, 80, 7, 20, 2, 2, 80, 81, 5, 6, 4, 2, 81, 82, 7, 15, 2, 2, 82, 83, 7, 26, 2, 2, 83, 84, 7, 20, 2, 2, 84, 11, 3, 2, 2, 2, 85, 86, 7, 14, 2, 2, 86, 90, 7, 26, 2, 2, 87, 89, 5, 16, 9, 2, 88, 87, 3, 2, 2, 2, 89, 92, 3, 2, 2, 2, 90, 88, 3, 2, 2, 2, 90, 91, 3, 2, 2, 2, 91, 93, 3, 2, 2, 2, 92, 90, 3, 2, 2, 2, 93, 94, 7, 22, 2, 2, 94, 13, 3, 2, 2, 2, 95, 96, 9, 2, 2, 2, 96, 15, 3, 2, 2, 2, 97, 99, 5, 18, 10, 2, 98, 97, 3, 2, 2, 2, 98, 99, 3, 2, 2, 2, 99, 100, 3, 2, 2, 2, 100, 101, 7, 26, 2, 2, 101, 102, 7, 24, 2, 2, 102, 103, 7, 25, 2, 2, 103, 17, 3, 2, 2, 2, 104, 105, 7, 26, 2, 2, 105, 106, 7, 3, 2, 2, 106, 19, 3, 2, 2, 2, 107, 108, 9, 3, 2, 2, 108, 21, 3, 2, 2, 2, 109, 110, 9, 4, 2, 2, 110, 23, 3, 2, 2, 2, 14, 25, 30, 37, 44, 50, 57, 60, 64, 69, 76, 90, 98]
@@ -17,9 +17,10 @@ public class XMLParser extends Parser {
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
COLON=1, NOT=2, DASH=3, COMMENT=4, CDATA=5, DTD=6, EntityRef=7, CharRef=8,
SEA_WS=9, OPEN=10, OPEN_SLASH=11, XMLDeclOpen=12, TEXT=13, CLOSE=14, SPECIAL_CLOSE=15,
SLASH_CLOSE=16, SLASH=17, EQUALS=18, STRING=19, Name=20, S=21, PI=22;
COLON=1, NOT=2, DASH=3, COMMENT_START=4, COMMENT_END=5, COMMENT=6, CDATA=7,
DTD=8, EntityRef=9, CharRef=10, SEA_WS=11, OPEN=12, OPEN_SLASH=13, XMLDeclOpen=14,
TEXT=15, CommentText=16, CommentModeEnd=17, CLOSE=18, SPECIAL_CLOSE=19,
SLASH_CLOSE=20, SLASH=21, EQUALS=22, STRING=23, Name=24, S=25, PI=26;
public static final int
RULE_document = 0, RULE_prolog = 1, RULE_content = 2, RULE_element = 3,
RULE_nonEmptyClosingElement = 4, RULE_emptyClosingElement = 5, RULE_reference = 6,
@@ -35,17 +36,18 @@ public class XMLParser extends Parser {
private static String[] makeLiteralNames() {
return new String[] {
null, "':'", "'!'", "'-'", null, null, null, null, null, null, "'<'",
"'</'", null, null, "'>'", null, "'/>'", "'/'", "'='"
null, "':'", "'!'", "'-'", null, null, null, null, null, null, null,
null, "'<'", "'</'", null, null, null, null, "'>'", null, "'/>'", "'/'",
"'='"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, "COLON", "NOT", "DASH", "COMMENT", "CDATA", "DTD", "EntityRef",
"CharRef", "SEA_WS", "OPEN", "OPEN_SLASH", "XMLDeclOpen", "TEXT", "CLOSE",
"SPECIAL_CLOSE", "SLASH_CLOSE", "SLASH", "EQUALS", "STRING", "Name",
"S", "PI"
null, "COLON", "NOT", "DASH", "COMMENT_START", "COMMENT_END", "COMMENT",
"CDATA", "DTD", "EntityRef", "CharRef", "SEA_WS", "OPEN", "OPEN_SLASH",
"XMLDeclOpen", "TEXT", "CommentText", "CommentModeEnd", "CLOSE", "SPECIAL_CLOSE",
"SLASH_CLOSE", "SLASH", "EQUALS", "STRING", "Name", "S", "PI"
};
}
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
@@ -876,7 +878,7 @@ public class XMLParser extends Parser {
}
public static final String _serializedATN =
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\30p\4\2\t\2\4\3\t"+
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\34p\4\2\t\2\4\3\t"+
"\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\4\n\t\n\4\13\t\13\4"+
"\f\t\f\3\2\5\2\32\n\2\3\2\7\2\35\n\2\f\2\16\2 \13\2\3\2\3\2\7\2$\n\2\f"+
"\2\16\2\'\13\2\3\3\3\3\7\3+\n\3\f\3\16\3.\13\3\3\3\3\3\3\4\5\4\63\n\4"+
@@ -884,26 +886,26 @@ public class XMLParser extends Parser {
"\3\5\5\5F\n\5\3\6\3\6\3\6\7\6K\n\6\f\6\16\6N\13\6\3\6\3\6\3\6\3\6\3\6"+
"\3\6\3\7\3\7\3\7\7\7Y\n\7\f\7\16\7\\\13\7\3\7\3\7\3\b\3\b\3\t\5\tc\n\t"+
"\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\13\3\13\3\f\3\f\3\f\2\2\r\2\4\6\b\n\f\16"+
"\20\22\24\26\2\5\3\2\t\n\4\2\13\13\17\17\5\2\6\6\13\13\30\30\2s\2\31\3"+
"\2\2\2\4(\3\2\2\2\6\62\3\2\2\2\bE\3\2\2\2\nG\3\2\2\2\fU\3\2\2\2\16_\3"+
"\2\2\2\20b\3\2\2\2\22h\3\2\2\2\24k\3\2\2\2\26m\3\2\2\2\30\32\5\4\3\2\31"+
"\20\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\7\3\2\2j\23\3\2\2\2kl\t\3\2\2l\25\3\2\2\2mn\t\4\2"+
"\2n\27\3\2\2\2\16\31\36%,\629<@ELZb";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
@@ -1,31 +1,35 @@
COLON=1
NOT=2
DASH=3
COMMENT=4
CDATA=5
DTD=6
EntityRef=7
CharRef=8
SEA_WS=9
OPEN=10
OPEN_SLASH=11
XMLDeclOpen=12
TEXT=13
CLOSE=14
SPECIAL_CLOSE=15
SLASH_CLOSE=16
SLASH=17
EQUALS=18
STRING=19
Name=20
S=21
PI=22
COMMENT_START=4
COMMENT_END=5
COMMENT=6
CDATA=7
DTD=8
EntityRef=9
CharRef=10
SEA_WS=11
OPEN=12
OPEN_SLASH=13
XMLDeclOpen=14
TEXT=15
CommentText=16
CommentModeEnd=17
CLOSE=18
SPECIAL_CLOSE=19
SLASH_CLOSE=20
SLASH=21
EQUALS=22
STRING=23
Name=24
S=25
PI=26
':'=1
'!'=2
'-'=3
'<'=10
'</'=11
'>'=14
'/>'=16
'/'=17
'='=18
'<'=12
'</'=13
'>'=18
'/>'=20
'/'=21
'='=22
@@ -0,0 +1,39 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide.lexers
import com.google.common.truth.Truth.assertThat
import org.antlr.v4.runtime.CharStream
import org.antlr.v4.runtime.CharStreams
import org.antlr.v4.runtime.Token
/**
* Base class for lexer tests.
*
* @author Akash Yadav
*/
open class BaseLexerTest {
protected open fun createStream(input: String): CharStream = CharStreams.fromString(input)
protected open fun ensureTokenSequence(tokens: List<Token>, expectedTypes: List<Int>) {
assertThat(tokens.size).isEqualTo(expectedTypes.size)
for ((index, token) in tokens.withIndex()) {
assertThat(token.type).isEqualTo(expectedTypes[index])
}
}
}
@@ -0,0 +1,115 @@
/*
* This file is part of AndroidIDE.
*
* AndroidIDE is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* AndroidIDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with AndroidIDE. If not, see <https://www.gnu.org/licenses/>.
*/
package com.itsaky.androidide.lexers.xml
import com.itsaky.androidide.lexers.BaseLexerTest
import com.itsaky.androidide.lexers.xml.XMLLexer.CLOSE
import com.itsaky.androidide.lexers.xml.XMLLexer.COMMENT
import com.itsaky.androidide.lexers.xml.XMLLexer.COMMENT_END
import com.itsaky.androidide.lexers.xml.XMLLexer.COMMENT_MODE
import com.itsaky.androidide.lexers.xml.XMLLexer.COMMENT_START
import com.itsaky.androidide.lexers.xml.XMLLexer.CommentModeEnd
import com.itsaky.androidide.lexers.xml.XMLLexer.EQUALS
import com.itsaky.androidide.lexers.xml.XMLLexer.Name
import com.itsaky.androidide.lexers.xml.XMLLexer.OPEN
import com.itsaky.androidide.lexers.xml.XMLLexer.OPEN_SLASH
import com.itsaky.androidide.lexers.xml.XMLLexer.SLASH_CLOSE
import com.itsaky.androidide.lexers.xml.XMLLexer.STRING
import com.itsaky.androidide.lexers.xml.XMLLexer.TEXT
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
/** @author Akash Yadav */
@RunWith(JUnit4::class)
class XMLLexerTest : BaseLexerTest() {
@Test
fun emptyClosingTagTest() {
val lexer = XMLLexer(createStream("<tag attr=\"value\"/>"))
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(OPEN, Name, Name, EQUALS, STRING, SLASH_CLOSE))
}
@Test
fun nonEmptyClosingTagTest() {
val lexer = XMLLexer(createStream("<tag attr=\"value\"></tag>"))
val tokens = lexer.allTokens
ensureTokenSequence(
tokens,
listOf(OPEN, Name, Name, EQUALS, STRING, CLOSE, OPEN_SLASH, Name, CLOSE)
)
}
@Test
fun singleLineIncompleteTokensTest() {
val lexer = XMLLexer(createStream("<tag attr=\"value\""))
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(OPEN, Name, Name, EQUALS, STRING))
}
@Test
fun wholeCommentText() {
val lexer = XMLLexer(createStream("<!-- This is a whole comment -->"))
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(COMMENT))
}
@Test
fun commentStartTest() {
val lexer = XMLLexer(createStream("<!--"))
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(COMMENT_START))
}
@Test
fun commentEndTest() {
val lexer = XMLLexer(createStream("-->"))
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(COMMENT_END))
}
@Test
fun incompleteCommentStartTest() {
val lexer = XMLLexer(createStream("<!-- Comment text"))
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(COMMENT_START))
}
@Test
fun incompleteCommentStartAfterTextTest() {
val lexer = XMLLexer(createStream("Not in comment <!-- Comment text"))
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(TEXT, COMMENT_START))
}
@Test
fun incompleteCommentEndTest() {
val lexer = XMLLexer(createStream("Comment text -->"))
lexer.pushMode(COMMENT_MODE)
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(CommentModeEnd))
}
@Test
fun incompleteCommentEndBeforeTextTest() {
val lexer = XMLLexer(createStream("Comment text --> Not in comment"))
lexer.pushMode(COMMENT_MODE)
val tokens = lexer.allTokens
ensureTokenSequence(tokens, listOf(CommentModeEnd, TEXT))
}
}