file_name stringlengths 6 86 | file_path stringlengths 45 249 | content stringlengths 47 6.26M | file_size int64 47 6.26M | language stringclasses 1 value | extension stringclasses 1 value | repo_name stringclasses 767 values | repo_stars int64 8 14.4k | repo_forks int64 0 1.17k | repo_open_issues int64 0 788 | repo_created_at stringclasses 767 values | repo_pushed_at stringclasses 767 values |
|---|---|---|---|---|---|---|---|---|---|---|---|
CodeBlockUtils.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/textmate/CodeBlockUtils.java | package com.tyron.code.language.textmate;
import io.github.rosemoe.sora.langs.textmate.folding.FoldingRegions;
import io.github.rosemoe.sora.langs.textmate.folding.IndentRange;
import io.github.rosemoe.sora.langs.textmate.folding.PreviousRegion;
import io.github.rosemoe.sora.langs.textmate.folding.RangesCollector;
import io.github.rosemoe.sora.text.Content;
import io.github.rosemoe.sora.textmate.core.internal.oniguruma.OnigRegExp;
import io.github.rosemoe.sora.textmate.core.internal.oniguruma.OnigResult;
import io.github.rosemoe.sora.textmate.core.internal.oniguruma.OnigString;
import io.github.rosemoe.sora.textmate.languageconfiguration.internal.supports.Folding;
import java.util.ArrayList;
import java.util.List;
public class CodeBlockUtils {
@SuppressWarnings("rawtype")
public static FoldingRegions computeRanges(
Content model,
int tabSize,
boolean offSide,
Folding markers,
int foldingRangesLimit,
BaseIncrementalAnalyzeManager.CodeBlockAnalyzeDelegate delegate)
throws Exception {
RangesCollector result = new RangesCollector(foldingRangesLimit, tabSize);
OnigRegExp pattern = null;
if (markers != null) {
pattern =
new OnigRegExp("(" + markers.getMarkersStart() + ")|(?:" + markers.getMarkersEnd() + ")");
}
List<PreviousRegion> previousRegions = new ArrayList<>();
int line = model.getLineCount() + 1;
// sentinel, to make sure there's at least one entry
previousRegions.add(new PreviousRegion(-1, line, line));
for (line = model.getLineCount() - 1; line >= 0 && !delegate.isCancelled(); line--) {
String lineContent = model.getLineString(line);
int indent =
IndentRange.computeIndentLevel(
model.getLine(line).getRawData(), model.getColumnCount(line), tabSize);
PreviousRegion previous = previousRegions.get(previousRegions.size() - 1);
if (indent == -1) {
if (offSide) {
// for offSide languages, empty lines are associated to the previous block
// note: the next block is already written to the results, so this only
// impacts the end position of the block before
previous.endAbove = line;
}
continue; // only whitespace
}
OnigResult m;
if (pattern != null && (m = pattern.search(new OnigString(lineContent), 0)) != null) {
// folding pattern match
if (m.count() >= 2) { // start pattern match
// discard all regions until the folding pattern
int i = previousRegions.size() - 1;
while (i > 0 && previousRegions.get(i).indent != -2) {
i--;
}
if (i > 0) {
// ??? previousRegions.length = i + 1;
previous = previousRegions.get(i);
// new folding range from pattern, includes the end line
result.insertFirst(line, previous.line, indent);
previous.line = line;
previous.indent = indent;
previous.endAbove = line;
continue;
} else {
// no end marker found, treat line as a regular line
}
} else { // end pattern match
previousRegions.add(new PreviousRegion(-2, line, line));
continue;
}
}
if (previous.indent > indent) {
// discard all regions with larger indent
do {
previousRegions.remove(previousRegions.size() - 1);
previous = previousRegions.get(previousRegions.size() - 1);
} while (previous.indent > indent);
// new folding range
int endLineNumber = previous.endAbove - 1;
if (endLineNumber - line >= 1) { // needs at east size 1
result.insertFirst(line, endLineNumber, indent);
}
}
if (previous.indent == indent) {
previous.endAbove = line;
} else { // previous.indent < indent
// new region with a bigger indent
previousRegions.add(new PreviousRegion(indent, line, line));
}
}
return result.toIndentRanges(model);
}
}
| 4,078 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
KotlinAnalyzer.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/kotlin/KotlinAnalyzer.java | package com.tyron.code.language.kotlin;
import android.content.res.AssetManager;
import android.os.Build;
import com.tyron.builder.BuildModule;
import com.tyron.builder.project.Project;
import com.tyron.builder.project.api.AndroidModule;
import com.tyron.builder.project.api.JavaModule;
import com.tyron.builder.project.api.Module;
import com.tyron.code.ApplicationLoader;
import com.tyron.code.analyzer.DiagnosticTextmateAnalyzer;
import com.tyron.code.ui.editor.impl.text.rosemoe.CodeEditorView;
import com.tyron.code.ui.project.ProjectManager;
import com.tyron.code.util.TaskExecutor;
import com.tyron.common.SharedPreferenceKeys;
import com.tyron.common.util.BinaryExecutor;
import com.tyron.common.util.ExecutionResult;
import com.tyron.completion.progress.ProgressManager;
import com.tyron.editor.Editor;
import com.tyron.kotlin_completion.CompletionEngine;
import io.github.rosemoe.sora.langs.textmate.theme.TextMateColorScheme;
import io.github.rosemoe.sora.textmate.core.theme.IRawTheme;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.jar.JarFile;
import java.util.stream.Collectors;
import java.util.zip.ZipException;
import org.apache.commons.io.FileUtils;
import org.json.JSONObject;
public class KotlinAnalyzer extends DiagnosticTextmateAnalyzer {
private static final String GRAMMAR_NAME = "kotlin.tmLanguage";
private static final String LANGUAGE_PATH = "textmate/kotlin/syntaxes/kotlin.tmLanguage";
private static final String CONFIG_PATH = "textmate/kotlin/language-configuration.json";
public static KotlinAnalyzer create(Editor editor) {
try {
AssetManager assetManager = ApplicationLoader.applicationContext.getAssets();
try (InputStreamReader config = new InputStreamReader(assetManager.open(CONFIG_PATH))) {
return new KotlinAnalyzer(
editor,
GRAMMAR_NAME,
assetManager.open(LANGUAGE_PATH),
config,
((TextMateColorScheme) ((CodeEditorView) editor).getColorScheme()).getRawTheme());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public KotlinAnalyzer(
Editor editor,
String grammarName,
InputStream grammarIns,
Reader languageConfiguration,
IRawTheme theme)
throws Exception {
super(editor, grammarName, grammarIns, languageConfiguration, theme);
}
@Override
public void analyzeInBackground(CharSequence content) {
if (mEditor == null) {
return;
}
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null) {
Module module = currentProject.getModule(mEditor.getCurrentFile());
if (module instanceof AndroidModule) {
CompletableFuture<String> future =
TaskExecutor.executeAsyncProvideError(
() -> {
File buildSettings =
new File(
module.getProjectDir(),
".idea/" + module.getRootFile().getName() + "_compiler_settings.json");
String json =
new String(Files.readAllBytes(Paths.get(buildSettings.getAbsolutePath())));
JSONObject buildSettingsJson = new JSONObject(json);
boolean isCompileRuntime =
Boolean.parseBoolean(
buildSettingsJson
.optJSONObject("kotlin")
.optString("isCompileRuntime", "false"));
String jvm_target =
buildSettingsJson.optJSONObject("kotlin").optString("jvmTarget", "1.8");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
BuildModule.getKotlinc().setReadOnly();
}
if (isCompileRuntime) {
File mClassOutput =
new File(
module.getBuildDirectory(),
"libraries/kotlin_runtime/" + module.getRootFile().getName() + ".jar");
if (mClassOutput.getParentFile().exists()) {
mClassOutput.getParentFile().mkdirs();
}
File api_files =
new File(module.getRootFile(), "/build/libraries/api_files/libs");
File api_libs = new File(module.getRootFile(), "/build/libraries/api_libs");
File kotlinOutputDir =
new File(module.getBuildDirectory(), "bin/kotlin/classes");
File javaOutputDir = new File(module.getBuildDirectory(), "bin/java/classes");
File implementation_files =
new File(
module.getRootFile(), "/build/libraries/implementation_files/libs");
File implementation_libs =
new File(module.getRootFile(), "/build/libraries/implementation_libs");
File runtimeOnly_files =
new File(module.getRootFile(), "/build/libraries/runtimeOnly_files/libs");
File runtimeOnly_libs =
new File(module.getRootFile(), "/build/libraries/runtimeOnly_libs");
File compileOnly_files =
new File(module.getRootFile(), "/build/libraries/compileOnly_files/libs");
File compileOnly_libs =
new File(module.getRootFile(), "/build/libraries/compileOnly_libs");
File runtimeOnlyApi_files =
new File(
module.getRootFile(), "/build/libraries/runtimeOnlyApi_files/libs");
File runtimeOnlyApi_libs =
new File(module.getRootFile(), "/build/libraries/runtimeOnlyApi_libs");
File compileOnlyApi_files =
new File(
module.getRootFile(), "/build/libraries/compileOnlyApi_files/libs");
File compileOnlyApi_libs =
new File(module.getRootFile(), "/build/libraries/compileOnlyApi_libs");
List<File> compileClassPath = new ArrayList<>();
compileClassPath.addAll(getJarFiles(api_files));
compileClassPath.addAll(getJarFiles(api_libs));
compileClassPath.addAll(getJarFiles(implementation_files));
compileClassPath.addAll(getJarFiles(implementation_libs));
compileClassPath.addAll(getJarFiles(compileOnly_files));
compileClassPath.addAll(getJarFiles(compileOnly_libs));
compileClassPath.addAll(getJarFiles(compileOnlyApi_files));
compileClassPath.addAll(getJarFiles(compileOnlyApi_libs));
compileClassPath.add(javaOutputDir);
compileClassPath.add(kotlinOutputDir);
List<File> runtimeClassPath = new ArrayList<>();
runtimeClassPath.addAll(getJarFiles(runtimeOnly_files));
runtimeClassPath.addAll(getJarFiles(runtimeOnly_libs));
runtimeClassPath.addAll(getJarFiles(runtimeOnlyApi_files));
runtimeClassPath.addAll(getJarFiles(runtimeOnlyApi_libs));
runtimeClassPath.add(BuildModule.getAndroidJar());
runtimeClassPath.add(BuildModule.getLambdaStubs());
runtimeClassPath.addAll(getJarFiles(api_files));
runtimeClassPath.addAll(getJarFiles(api_libs));
runtimeClassPath.add(javaOutputDir);
runtimeClassPath.add(kotlinOutputDir);
List<File> classpath = new ArrayList<>();
classpath.add(module.getBuildClassesDirectory());
AndroidModule androidModule = (AndroidModule) module;
if (androidModule instanceof JavaModule) {
JavaModule javaModule = (JavaModule) androidModule;
classpath.addAll(javaModule.getLibraries());
}
classpath.addAll(compileClassPath);
classpath.addAll(runtimeClassPath);
List<String> arguments = new ArrayList<>();
Collections.addAll(
arguments,
classpath.stream()
.map(File::getAbsolutePath)
.collect(Collectors.joining(File.pathSeparator)));
File javaDir = new File(module.getRootFile() + "/src/main/java");
File kotlinDir = new File(module.getRootFile() + "/src/main/kotlin");
File buildGenDir = new File(module.getRootFile() + "/build/gen");
File viewBindingDir = new File(module.getRootFile() + "/build/view_binding");
List<File> javaSourceRoots = new ArrayList<>();
if (javaDir.exists()) {
javaSourceRoots.add(javaDir);
}
if (buildGenDir.exists()) {
javaSourceRoots.add(buildGenDir);
}
if (viewBindingDir.exists()) {
javaSourceRoots.add(viewBindingDir);
}
List<File> fileList = new ArrayList<>();
if (javaDir.exists()) {
fileList.add(javaDir);
}
if (buildGenDir.exists()) {
fileList.add(buildGenDir);
}
if (viewBindingDir.exists()) {
fileList.add(viewBindingDir);
}
if (kotlinDir.exists()) {
fileList.add(kotlinDir);
}
List<String> args = new ArrayList<>();
args.add("dalvikvm");
args.add("-Xcompiler-option");
args.add("--compiler-filter=speed");
args.add("-Xmx256m");
args.add("-cp");
args.add(BuildModule.getKotlinc().getAbsolutePath());
args.add("org.jetbrains.kotlin.cli.jvm.K2JVMCompiler");
args.add("-no-jdk");
args.add("-no-stdlib");
args.add("-no-reflect");
args.add("-jvm-target");
args.add(jvm_target);
args.add("-cp");
args.add(String.join(", ", arguments));
args.add(
"-Xjava-source-roots="
+ String.join(
", ",
javaSourceRoots.stream()
.map(File::getAbsolutePath)
.toArray(String[]::new)));
for (File file : fileList) {
args.add(file.getAbsolutePath());
}
args.add("-d");
args.add(mClassOutput.getAbsolutePath());
args.add("-module-name");
args.add(module.getRootFile().getName());
List<File> plugins = getPlugins(module);
String plugin = "";
String pluginString =
Arrays.toString(
plugins.stream().map(File::getAbsolutePath).toArray(String[]::new))
.replace("[", "")
.replace("]", "");
String pluginOptionsString =
Arrays.toString(getPluginOptions(module)).replace("[", "").replace("]", "");
plugin =
pluginString
+ ":"
+ (pluginOptionsString.isEmpty() ? ":=" : pluginOptionsString);
args.add("-P");
args.add("plugin:" + plugin);
BinaryExecutor executor = new BinaryExecutor();
executor.setCommands(args);
ExecutionResult result = executor.run();
}
return null;
},
(result, throwable) -> {});
if (ApplicationLoader.getDefaultPreferences()
.getBoolean(SharedPreferenceKeys.KOTLIN_HIGHLIGHTING, true)) {
ProgressManager.getInstance()
.runLater(
() -> {
mEditor.setAnalyzing(true);
CompletionEngine.getInstance((AndroidModule) module)
.doLint(
mEditor.getCurrentFile(),
content.toString(),
diagnostics -> {
mEditor.setDiagnostics(diagnostics);
ProgressManager.getInstance()
.runLater(() -> mEditor.setAnalyzing(false), 300);
});
},
900);
}
}
}
}
public List<File> getFiles(File dir) {
List<File> ktfiles = new ArrayList<>();
File[] files = dir.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile() && file.getName().endsWith(".kt")) {
ktfiles.add(file);
} else if (file.isDirectory()) {
ktfiles.addAll(getFiles(file));
}
}
}
return ktfiles;
}
public List<File> getJarFiles(File dir) {
List<File> jarFiles = new ArrayList<>();
File[] files = dir.listFiles();
if (files != null) {
for (File file : files) {
if (file.isFile() && file.getName().endsWith(".jar")) {
// Check if the JarFile is valid before adding it to the list
if (isJarFileValid(file)) {
jarFiles.add(file);
}
} else if (file.isDirectory()) {
// Recursively add JarFiles from subdirectories
jarFiles.addAll(getJarFiles(file));
}
}
}
return jarFiles;
}
public boolean isJarFileValid(File file) {
String message = "File " + file.getParentFile().getName() + " is corrupt! Ignoring.";
try {
// Try to open the JarFile
JarFile jarFile = new JarFile(file);
// If it opens successfully, close it and return true
jarFile.close();
return true;
} catch (ZipException e) {
// If the JarFile is invalid, it will throw a ZipException
return false;
} catch (IOException e) {
// If there is some other error reading the JarFile, return false
return false;
}
}
private List<File> getPlugins(Module module) {
File pluginDir = new File(module.getBuildDirectory(), "plugins");
File[] children = pluginDir.listFiles(c -> c.getName().endsWith(".jar"));
if (children == null) {
return Collections.emptyList();
}
return Arrays.stream(children).collect(Collectors.toList());
}
private String[] getPluginOptions(Module module) throws IOException {
File pluginDir = new File(module.getBuildDirectory(), "plugins");
File args = new File(pluginDir, "args.txt");
if (!args.exists()) {
return new String[0];
}
String string = FileUtils.readFileToString(args, StandardCharsets.UTF_8);
return string.split(" ");
}
}
| 15,994 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
KotlinLexer.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/kotlin/KotlinLexer.java | // Generated from
// C:/Users/admin/StudioProjects/CodeAssist/app/src/main/java/com/tyron/code/ui/editor/language/kotlin\KotlinLexer.g4 by ANTLR 4.9.1
package com.tyron.code.language.kotlin;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Lexer;
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 KotlinLexer extends Lexer {
static {
RuntimeMetaData.checkVersion("4.9.1", RuntimeMetaData.VERSION);
}
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache();
public static final int ShebangLine = 1,
DelimitedComment = 2,
LineComment = 3,
WS = 4,
NL = 5,
RESERVED = 6,
DOT = 7,
COMMA = 8,
LPAREN = 9,
RPAREN = 10,
LSQUARE = 11,
RSQUARE = 12,
LCURL = 13,
RCURL = 14,
MULT = 15,
MOD = 16,
DIV = 17,
ADD = 18,
SUB = 19,
INCR = 20,
DECR = 21,
CONJ = 22,
DISJ = 23,
EXCL = 24,
COLON = 25,
SEMICOLON = 26,
ASSIGNMENT = 27,
ADD_ASSIGNMENT = 28,
SUB_ASSIGNMENT = 29,
MULT_ASSIGNMENT = 30,
DIV_ASSIGNMENT = 31,
MOD_ASSIGNMENT = 32,
ARROW = 33,
DOUBLE_ARROW = 34,
RANGE = 35,
COLONCOLON = 36,
Q_COLONCOLON = 37,
DOUBLE_SEMICOLON = 38,
HASH = 39,
AT = 40,
QUEST = 41,
ELVIS = 42,
LANGLE = 43,
RANGLE = 44,
LE = 45,
GE = 46,
EXCL_EQ = 47,
EXCL_EQEQ = 48,
AS_SAFE = 49,
EQEQ = 50,
EQEQEQ = 51,
SINGLE_QUOTE = 52,
RETURN_AT = 53,
CONTINUE_AT = 54,
BREAK_AT = 55,
FILE = 56,
PACKAGE = 57,
IMPORT = 58,
CLASS = 59,
INTERFACE = 60,
FUN = 61,
OBJECT = 62,
VAL = 63,
VAR = 64,
TYPE_ALIAS = 65,
CONSTRUCTOR = 66,
BY = 67,
COMPANION = 68,
INIT = 69,
THIS = 70,
SUPER = 71,
TYPEOF = 72,
WHERE = 73,
IF = 74,
ELSE = 75,
WHEN = 76,
TRY = 77,
CATCH = 78,
FINALLY = 79,
FOR = 80,
DO = 81,
WHILE = 82,
THROW = 83,
RETURN = 84,
CONTINUE = 85,
BREAK = 86,
AS = 87,
IS = 88,
IN = 89,
NOT_IS = 90,
NOT_IN = 91,
OUT = 92,
FIELD = 93,
PROPERTY = 94,
GET = 95,
SET = 96,
GETTER = 97,
SETTER = 98,
RECEIVER = 99,
PARAM = 100,
SETPARAM = 101,
DELEGATE = 102,
DYNAMIC = 103,
PUBLIC = 104,
PRIVATE = 105,
PROTECTED = 106,
INTERNAL = 107,
ENUM = 108,
SEALED = 109,
ANNOTATION = 110,
DATA = 111,
INNER = 112,
TAILREC = 113,
OPERATOR = 114,
INLINE = 115,
INFIX = 116,
EXTERNAL = 117,
SUSPEND = 118,
OVERRIDE = 119,
ABSTRACT = 120,
FINAL = 121,
OPEN = 122,
CONST = 123,
LATEINIT = 124,
VARARG = 125,
NOINLINE = 126,
CROSSINLINE = 127,
REIFIED = 128,
QUOTE_OPEN = 129,
TRIPLE_QUOTE_OPEN = 130,
RealLiteral = 131,
FloatLiteral = 132,
DoubleLiteral = 133,
LongLiteral = 134,
IntegerLiteral = 135,
HexLiteral = 136,
BinLiteral = 137,
BooleanLiteral = 138,
NullLiteral = 139,
Identifier = 140,
LabelReference = 141,
LabelDefinition = 142,
FieldIdentifier = 143,
CharacterLiteral = 144,
UNICODE_CLASS_LL = 145,
UNICODE_CLASS_LM = 146,
UNICODE_CLASS_LO = 147,
UNICODE_CLASS_LT = 148,
UNICODE_CLASS_LU = 149,
UNICODE_CLASS_ND = 150,
UNICODE_CLASS_NL = 151,
Inside_Comment = 152,
Inside_WS = 153,
Inside_NL = 154,
QUOTE_CLOSE = 155,
LineStrRef = 156,
LineStrText = 157,
LineStrEscapedChar = 158,
LineStrExprStart = 159,
TRIPLE_QUOTE_CLOSE = 160,
MultiLineStringQuote = 161,
MultiLineStrRef = 162,
MultiLineStrText = 163,
MultiLineStrEscapedChar = 164,
MultiLineStrExprStart = 165,
MultiLineNL = 166,
StrExpr_IN = 167,
StrExpr_Comment = 168,
StrExpr_WS = 169,
StrExpr_NL = 170;
public static final int Inside = 1, LineString = 2, MultiLineString = 3, StringExpression = 4;
public static String[] channelNames = {"DEFAULT_TOKEN_CHANNEL", "HIDDEN"};
public static String[] modeNames = {
"DEFAULT_MODE", "Inside", "LineString", "MultiLineString", "StringExpression"
};
private static String[] makeRuleNames() {
return new String[] {
"ShebangLine",
"DelimitedComment",
"LineComment",
"WS",
"NL",
"RESERVED",
"DOT",
"COMMA",
"LPAREN",
"RPAREN",
"LSQUARE",
"RSQUARE",
"LCURL",
"RCURL",
"MULT",
"MOD",
"DIV",
"ADD",
"SUB",
"INCR",
"DECR",
"CONJ",
"DISJ",
"EXCL",
"COLON",
"SEMICOLON",
"ASSIGNMENT",
"ADD_ASSIGNMENT",
"SUB_ASSIGNMENT",
"MULT_ASSIGNMENT",
"DIV_ASSIGNMENT",
"MOD_ASSIGNMENT",
"ARROW",
"DOUBLE_ARROW",
"RANGE",
"COLONCOLON",
"Q_COLONCOLON",
"DOUBLE_SEMICOLON",
"HASH",
"AT",
"QUEST",
"ELVIS",
"LANGLE",
"RANGLE",
"LE",
"GE",
"EXCL_EQ",
"EXCL_EQEQ",
"AS_SAFE",
"EQEQ",
"EQEQEQ",
"SINGLE_QUOTE",
"RETURN_AT",
"CONTINUE_AT",
"BREAK_AT",
"FILE",
"PACKAGE",
"IMPORT",
"CLASS",
"INTERFACE",
"FUN",
"OBJECT",
"VAL",
"VAR",
"TYPE_ALIAS",
"CONSTRUCTOR",
"BY",
"COMPANION",
"INIT",
"THIS",
"SUPER",
"TYPEOF",
"WHERE",
"IF",
"ELSE",
"WHEN",
"TRY",
"CATCH",
"FINALLY",
"FOR",
"DO",
"WHILE",
"THROW",
"RETURN",
"CONTINUE",
"BREAK",
"AS",
"IS",
"IN",
"NOT_IS",
"NOT_IN",
"OUT",
"FIELD",
"PROPERTY",
"GET",
"SET",
"GETTER",
"SETTER",
"RECEIVER",
"PARAM",
"SETPARAM",
"DELEGATE",
"DYNAMIC",
"PUBLIC",
"PRIVATE",
"PROTECTED",
"INTERNAL",
"ENUM",
"SEALED",
"ANNOTATION",
"DATA",
"INNER",
"TAILREC",
"OPERATOR",
"INLINE",
"INFIX",
"EXTERNAL",
"SUSPEND",
"OVERRIDE",
"ABSTRACT",
"FINAL",
"OPEN",
"CONST",
"LATEINIT",
"VARARG",
"NOINLINE",
"CROSSINLINE",
"REIFIED",
"QUOTE_OPEN",
"TRIPLE_QUOTE_OPEN",
"RealLiteral",
"FloatLiteral",
"DoubleLiteral",
"LongLiteral",
"IntegerLiteral",
"DecDigit",
"DecDigitNoZero",
"UNICODE_CLASS_ND_NoZeros",
"HexLiteral",
"HexDigit",
"BinLiteral",
"BinDigit",
"BooleanLiteral",
"NullLiteral",
"Identifier",
"LabelReference",
"LabelDefinition",
"FieldIdentifier",
"CharacterLiteral",
"EscapeSeq",
"UniCharacterLiteral",
"EscapedIdentifier",
"Letter",
"UNICODE_CLASS_LL",
"UNICODE_CLASS_LM",
"UNICODE_CLASS_LO",
"UNICODE_CLASS_LT",
"UNICODE_CLASS_LU",
"UNICODE_CLASS_ND",
"UNICODE_CLASS_NL",
"Inside_RPAREN",
"Inside_RSQUARE",
"Inside_LPAREN",
"Inside_LSQUARE",
"Inside_LCURL",
"Inside_RCURL",
"Inside_DOT",
"Inside_COMMA",
"Inside_MULT",
"Inside_MOD",
"Inside_DIV",
"Inside_ADD",
"Inside_SUB",
"Inside_INCR",
"Inside_DECR",
"Inside_CONJ",
"Inside_DISJ",
"Inside_EXCL",
"Inside_COLON",
"Inside_SEMICOLON",
"Inside_ASSIGNMENT",
"Inside_ADD_ASSIGNMENT",
"Inside_SUB_ASSIGNMENT",
"Inside_MULT_ASSIGNMENT",
"Inside_DIV_ASSIGNMENT",
"Inside_MOD_ASSIGNMENT",
"Inside_ARROW",
"Inside_DOUBLE_ARROW",
"Inside_RANGE",
"Inside_RESERVED",
"Inside_COLONCOLON",
"Inside_Q_COLONCOLON",
"Inside_DOUBLE_SEMICOLON",
"Inside_HASH",
"Inside_AT",
"Inside_QUEST",
"Inside_ELVIS",
"Inside_LANGLE",
"Inside_RANGLE",
"Inside_LE",
"Inside_GE",
"Inside_EXCL_EQ",
"Inside_EXCL_EQEQ",
"Inside_NOT_IS",
"Inside_NOT_IN",
"Inside_AS_SAFE",
"Inside_EQEQ",
"Inside_EQEQEQ",
"Inside_SINGLE_QUOTE",
"Inside_QUOTE_OPEN",
"Inside_TRIPLE_QUOTE_OPEN",
"Inside_VAL",
"Inside_VAR",
"Inside_OBJECT",
"Inside_SUPER",
"Inside_IN",
"Inside_OUT",
"Inside_FIELD",
"Inside_FILE",
"Inside_PROPERTY",
"Inside_GET",
"Inside_SET",
"Inside_RECEIVER",
"Inside_PARAM",
"Inside_SETPARAM",
"Inside_DELEGATE",
"Inside_THROW",
"Inside_RETURN",
"Inside_CONTINUE",
"Inside_BREAK",
"Inside_RETURN_AT",
"Inside_CONTINUE_AT",
"Inside_BREAK_AT",
"Inside_IF",
"Inside_ELSE",
"Inside_WHEN",
"Inside_TRY",
"Inside_CATCH",
"Inside_FINALLY",
"Inside_FOR",
"Inside_DO",
"Inside_WHILE",
"Inside_PUBLIC",
"Inside_PRIVATE",
"Inside_PROTECTED",
"Inside_INTERNAL",
"Inside_ENUM",
"Inside_SEALED",
"Inside_ANNOTATION",
"Inside_DATA",
"Inside_INNER",
"Inside_TAILREC",
"Inside_OPERATOR",
"Inside_INLINE",
"Inside_INFIX",
"Inside_EXTERNAL",
"Inside_SUSPEND",
"Inside_OVERRIDE",
"Inside_ABSTRACT",
"Inside_FINAL",
"Inside_OPEN",
"Inside_CONST",
"Inside_LATEINIT",
"Inside_VARARG",
"Inside_NOINLINE",
"Inside_CROSSINLINE",
"Inside_REIFIED",
"Inside_BooleanLiteral",
"Inside_IntegerLiteral",
"Inside_HexLiteral",
"Inside_BinLiteral",
"Inside_CharacterLiteral",
"Inside_RealLiteral",
"Inside_NullLiteral",
"Inside_LongLiteral",
"Inside_Identifier",
"Inside_LabelReference",
"Inside_LabelDefinition",
"Inside_Comment",
"Inside_WS",
"Inside_NL",
"QUOTE_CLOSE",
"LineStrRef",
"LineStrText",
"LineStrEscapedChar",
"LineStrExprStart",
"TRIPLE_QUOTE_CLOSE",
"MultiLineStringQuote",
"MultiLineStrRef",
"MultiLineStrText",
"MultiLineStrEscapedChar",
"MultiLineStrExprStart",
"MultiLineNL",
"StrExpr_RCURL",
"StrExpr_LPAREN",
"StrExpr_LSQUARE",
"StrExpr_RPAREN",
"StrExpr_RSQUARE",
"StrExpr_LCURL",
"StrExpr_DOT",
"StrExpr_COMMA",
"StrExpr_MULT",
"StrExpr_MOD",
"StrExpr_DIV",
"StrExpr_ADD",
"StrExpr_SUB",
"StrExpr_INCR",
"StrExpr_DECR",
"StrExpr_CONJ",
"StrExpr_DISJ",
"StrExpr_EXCL",
"StrExpr_COLON",
"StrExpr_SEMICOLON",
"StrExpr_ASSIGNMENT",
"StrExpr_ADD_ASSIGNMENT",
"StrExpr_SUB_ASSIGNMENT",
"StrExpr_MULT_ASSIGNMENT",
"StrExpr_DIV_ASSIGNMENT",
"StrExpr_MOD_ASSIGNMENT",
"StrExpr_ARROW",
"StrExpr_DOUBLE_ARROW",
"StrExpr_RANGE",
"StrExpr_COLONCOLON",
"StrExpr_Q_COLONCOLON",
"StrExpr_DOUBLE_SEMICOLON",
"StrExpr_HASH",
"StrExpr_AT",
"StrExpr_QUEST",
"StrExpr_ELVIS",
"StrExpr_LANGLE",
"StrExpr_RANGLE",
"StrExpr_LE",
"StrExpr_GE",
"StrExpr_EXCL_EQ",
"StrExpr_EXCL_EQEQ",
"StrExpr_AS",
"StrExpr_IS",
"StrExpr_IN",
"StrExpr_NOT_IS",
"StrExpr_NOT_IN",
"StrExpr_AS_SAFE",
"StrExpr_EQEQ",
"StrExpr_EQEQEQ",
"StrExpr_SINGLE_QUOTE",
"StrExpr_QUOTE_OPEN",
"StrExpr_TRIPLE_QUOTE_OPEN",
"StrExpr_BooleanLiteral",
"StrExpr_IntegerLiteral",
"StrExpr_HexLiteral",
"StrExpr_BinLiteral",
"StrExpr_CharacterLiteral",
"StrExpr_RealLiteral",
"StrExpr_NullLiteral",
"StrExpr_LongLiteral",
"StrExpr_Identifier",
"StrExpr_LabelReference",
"StrExpr_LabelDefinition",
"StrExpr_Comment",
"StrExpr_WS",
"StrExpr_NL"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null,
null,
null,
null,
null,
null,
"'...'",
"'.'",
"','",
"'('",
null,
"'['",
null,
"'{'",
"'}'",
"'*'",
"'%'",
"'/'",
"'+'",
"'-'",
"'++'",
"'--'",
"'&&'",
"'||'",
"'!'",
"':'",
"';'",
"'='",
"'+='",
"'-='",
"'*='",
"'/='",
"'%='",
"'->'",
"'=>'",
"'..'",
"'::'",
"'?::'",
"';;'",
"'#'",
"'@'",
"'?'",
"'?:'",
"'<'",
"'>'",
"'<='",
"'>='",
"'!='",
"'!=='",
"'as?'",
"'=='",
"'==='",
"'''",
null,
null,
null,
"'@file'",
"'package'",
"'import'",
"'class'",
"'interface'",
"'fun'",
"'object'",
"'val'",
"'var'",
"'typealias'",
"'constructor'",
"'by'",
"'companion'",
"'init'",
"'this'",
"'super'",
"'typeof'",
"'where'",
"'if'",
"'else'",
"'when'",
"'try'",
"'catch'",
"'finally'",
"'for'",
"'do'",
"'while'",
"'throw'",
"'return'",
"'continue'",
"'break'",
"'as'",
"'is'",
"'in'",
null,
null,
"'out'",
"'@field'",
"'@property'",
"'@get'",
"'@set'",
"'get'",
"'set'",
"'@receiver'",
"'@param'",
"'@setparam'",
"'@delegate'",
"'dynamic'",
"'public'",
"'private'",
"'protected'",
"'internal'",
"'enum'",
"'sealed'",
"'annotation'",
"'data'",
"'inner'",
"'tailrec'",
"'operator'",
"'inline'",
"'infix'",
"'external'",
"'suspend'",
"'override'",
"'abstract'",
"'final'",
"'open'",
"'const'",
"'lateinit'",
"'vararg'",
"'noinline'",
"'crossinline'",
"'reified'",
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,
"ShebangLine",
"DelimitedComment",
"LineComment",
"WS",
"NL",
"RESERVED",
"DOT",
"COMMA",
"LPAREN",
"RPAREN",
"LSQUARE",
"RSQUARE",
"LCURL",
"RCURL",
"MULT",
"MOD",
"DIV",
"ADD",
"SUB",
"INCR",
"DECR",
"CONJ",
"DISJ",
"EXCL",
"COLON",
"SEMICOLON",
"ASSIGNMENT",
"ADD_ASSIGNMENT",
"SUB_ASSIGNMENT",
"MULT_ASSIGNMENT",
"DIV_ASSIGNMENT",
"MOD_ASSIGNMENT",
"ARROW",
"DOUBLE_ARROW",
"RANGE",
"COLONCOLON",
"Q_COLONCOLON",
"DOUBLE_SEMICOLON",
"HASH",
"AT",
"QUEST",
"ELVIS",
"LANGLE",
"RANGLE",
"LE",
"GE",
"EXCL_EQ",
"EXCL_EQEQ",
"AS_SAFE",
"EQEQ",
"EQEQEQ",
"SINGLE_QUOTE",
"RETURN_AT",
"CONTINUE_AT",
"BREAK_AT",
"FILE",
"PACKAGE",
"IMPORT",
"CLASS",
"INTERFACE",
"FUN",
"OBJECT",
"VAL",
"VAR",
"TYPE_ALIAS",
"CONSTRUCTOR",
"BY",
"COMPANION",
"INIT",
"THIS",
"SUPER",
"TYPEOF",
"WHERE",
"IF",
"ELSE",
"WHEN",
"TRY",
"CATCH",
"FINALLY",
"FOR",
"DO",
"WHILE",
"THROW",
"RETURN",
"CONTINUE",
"BREAK",
"AS",
"IS",
"IN",
"NOT_IS",
"NOT_IN",
"OUT",
"FIELD",
"PROPERTY",
"GET",
"SET",
"GETTER",
"SETTER",
"RECEIVER",
"PARAM",
"SETPARAM",
"DELEGATE",
"DYNAMIC",
"PUBLIC",
"PRIVATE",
"PROTECTED",
"INTERNAL",
"ENUM",
"SEALED",
"ANNOTATION",
"DATA",
"INNER",
"TAILREC",
"OPERATOR",
"INLINE",
"INFIX",
"EXTERNAL",
"SUSPEND",
"OVERRIDE",
"ABSTRACT",
"FINAL",
"OPEN",
"CONST",
"LATEINIT",
"VARARG",
"NOINLINE",
"CROSSINLINE",
"REIFIED",
"QUOTE_OPEN",
"TRIPLE_QUOTE_OPEN",
"RealLiteral",
"FloatLiteral",
"DoubleLiteral",
"LongLiteral",
"IntegerLiteral",
"HexLiteral",
"BinLiteral",
"BooleanLiteral",
"NullLiteral",
"Identifier",
"LabelReference",
"LabelDefinition",
"FieldIdentifier",
"CharacterLiteral",
"UNICODE_CLASS_LL",
"UNICODE_CLASS_LM",
"UNICODE_CLASS_LO",
"UNICODE_CLASS_LT",
"UNICODE_CLASS_LU",
"UNICODE_CLASS_ND",
"UNICODE_CLASS_NL",
"Inside_Comment",
"Inside_WS",
"Inside_NL",
"QUOTE_CLOSE",
"LineStrRef",
"LineStrText",
"LineStrEscapedChar",
"LineStrExprStart",
"TRIPLE_QUOTE_CLOSE",
"MultiLineStringQuote",
"MultiLineStrRef",
"MultiLineStrText",
"MultiLineStrEscapedChar",
"MultiLineStrExprStart",
"MultiLineNL",
"StrExpr_IN",
"StrExpr_Comment",
"StrExpr_WS",
"StrExpr_NL"
};
}
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 KotlinLexer(CharStream input) {
super(input);
_interp = new LexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
@Override
public String getGrammarFileName() {
return "KotlinLexer.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;
}
private static final int _serializedATNSegments = 2;
private static final String _serializedATNSegment0 =
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2\u00ac\u0a30\b\1\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!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t"
+ "(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t"
+ "\62\4\63\t\63\4\64\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t"
+ ":\4;\t;\4<\t<\4=\t=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4"
+ "F\tF\4G\tG\4H\tH\4I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\t"
+ "Q\4R\tR\4S\tS\4T\tT\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t\\"
+ "\4]\t]\4^\t^\4_\t_\4`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4h"
+ "\th\4i\ti\4j\tj\4k\tk\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\ts"
+ "\4t\tt\4u\tu\4v\tv\4w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4\177"
+ "\t\177\4\u0080\t\u0080\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083"
+ "\4\u0084\t\u0084\4\u0085\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088"
+ "\t\u0088\4\u0089\t\u0089\4\u008a\t\u008a\4\u008b\t\u008b\4\u008c\t\u008c"
+ "\4\u008d\t\u008d\4\u008e\t\u008e\4\u008f\t\u008f\4\u0090\t\u0090\4\u0091"
+ "\t\u0091\4\u0092\t\u0092\4\u0093\t\u0093\4\u0094\t\u0094\4\u0095\t\u0095"
+ "\4\u0096\t\u0096\4\u0097\t\u0097\4\u0098\t\u0098\4\u0099\t\u0099\4\u009a"
+ "\t\u009a\4\u009b\t\u009b\4\u009c\t\u009c\4\u009d\t\u009d\4\u009e\t\u009e"
+ "\4\u009f\t\u009f\4\u00a0\t\u00a0\4\u00a1\t\u00a1\4\u00a2\t\u00a2\4\u00a3"
+ "\t\u00a3\4\u00a4\t\u00a4\4\u00a5\t\u00a5\4\u00a6\t\u00a6\4\u00a7\t\u00a7"
+ "\4\u00a8\t\u00a8\4\u00a9\t\u00a9\4\u00aa\t\u00aa\4\u00ab\t\u00ab\4\u00ac"
+ "\t\u00ac\4\u00ad\t\u00ad\4\u00ae\t\u00ae\4\u00af\t\u00af\4\u00b0\t\u00b0"
+ "\4\u00b1\t\u00b1\4\u00b2\t\u00b2\4\u00b3\t\u00b3\4\u00b4\t\u00b4\4\u00b5"
+ "\t\u00b5\4\u00b6\t\u00b6\4\u00b7\t\u00b7\4\u00b8\t\u00b8\4\u00b9\t\u00b9"
+ "\4\u00ba\t\u00ba\4\u00bb\t\u00bb\4\u00bc\t\u00bc\4\u00bd\t\u00bd\4\u00be"
+ "\t\u00be\4\u00bf\t\u00bf\4\u00c0\t\u00c0\4\u00c1\t\u00c1\4\u00c2\t\u00c2"
+ "\4\u00c3\t\u00c3\4\u00c4\t\u00c4\4\u00c5\t\u00c5\4\u00c6\t\u00c6\4\u00c7"
+ "\t\u00c7\4\u00c8\t\u00c8\4\u00c9\t\u00c9\4\u00ca\t\u00ca\4\u00cb\t\u00cb"
+ "\4\u00cc\t\u00cc\4\u00cd\t\u00cd\4\u00ce\t\u00ce\4\u00cf\t\u00cf\4\u00d0"
+ "\t\u00d0\4\u00d1\t\u00d1\4\u00d2\t\u00d2\4\u00d3\t\u00d3\4\u00d4\t\u00d4"
+ "\4\u00d5\t\u00d5\4\u00d6\t\u00d6\4\u00d7\t\u00d7\4\u00d8\t\u00d8\4\u00d9"
+ "\t\u00d9\4\u00da\t\u00da\4\u00db\t\u00db\4\u00dc\t\u00dc\4\u00dd\t\u00dd"
+ "\4\u00de\t\u00de\4\u00df\t\u00df\4\u00e0\t\u00e0\4\u00e1\t\u00e1\4\u00e2"
+ "\t\u00e2\4\u00e3\t\u00e3\4\u00e4\t\u00e4\4\u00e5\t\u00e5\4\u00e6\t\u00e6"
+ "\4\u00e7\t\u00e7\4\u00e8\t\u00e8\4\u00e9\t\u00e9\4\u00ea\t\u00ea\4\u00eb"
+ "\t\u00eb\4\u00ec\t\u00ec\4\u00ed\t\u00ed\4\u00ee\t\u00ee\4\u00ef\t\u00ef"
+ "\4\u00f0\t\u00f0\4\u00f1\t\u00f1\4\u00f2\t\u00f2\4\u00f3\t\u00f3\4\u00f4"
+ "\t\u00f4\4\u00f5\t\u00f5\4\u00f6\t\u00f6\4\u00f7\t\u00f7\4\u00f8\t\u00f8"
+ "\4\u00f9\t\u00f9\4\u00fa\t\u00fa\4\u00fb\t\u00fb\4\u00fc\t\u00fc\4\u00fd"
+ "\t\u00fd\4\u00fe\t\u00fe\4\u00ff\t\u00ff\4\u0100\t\u0100\4\u0101\t\u0101"
+ "\4\u0102\t\u0102\4\u0103\t\u0103\4\u0104\t\u0104\4\u0105\t\u0105\4\u0106"
+ "\t\u0106\4\u0107\t\u0107\4\u0108\t\u0108\4\u0109\t\u0109\4\u010a\t\u010a"
+ "\4\u010b\t\u010b\4\u010c\t\u010c\4\u010d\t\u010d\4\u010e\t\u010e\4\u010f"
+ "\t\u010f\4\u0110\t\u0110\4\u0111\t\u0111\4\u0112\t\u0112\4\u0113\t\u0113"
+ "\4\u0114\t\u0114\4\u0115\t\u0115\4\u0116\t\u0116\4\u0117\t\u0117\4\u0118"
+ "\t\u0118\4\u0119\t\u0119\4\u011a\t\u011a\4\u011b\t\u011b\4\u011c\t\u011c"
+ "\4\u011d\t\u011d\4\u011e\t\u011e\4\u011f\t\u011f\4\u0120\t\u0120\4\u0121"
+ "\t\u0121\4\u0122\t\u0122\4\u0123\t\u0123\4\u0124\t\u0124\4\u0125\t\u0125"
+ "\4\u0126\t\u0126\4\u0127\t\u0127\4\u0128\t\u0128\4\u0129\t\u0129\4\u012a"
+ "\t\u012a\4\u012b\t\u012b\4\u012c\t\u012c\4\u012d\t\u012d\4\u012e\t\u012e"
+ "\4\u012f\t\u012f\4\u0130\t\u0130\4\u0131\t\u0131\4\u0132\t\u0132\4\u0133"
+ "\t\u0133\4\u0134\t\u0134\4\u0135\t\u0135\4\u0136\t\u0136\4\u0137\t\u0137"
+ "\4\u0138\t\u0138\4\u0139\t\u0139\4\u013a\t\u013a\4\u013b\t\u013b\4\u013c"
+ "\t\u013c\4\u013d\t\u013d\4\u013e\t\u013e\4\u013f\t\u013f\4\u0140\t\u0140"
+ "\4\u0141\t\u0141\4\u0142\t\u0142\4\u0143\t\u0143\4\u0144\t\u0144\4\u0145"
+ "\t\u0145\4\u0146\t\u0146\4\u0147\t\u0147\4\u0148\t\u0148\4\u0149\t\u0149"
+ "\4\u014a\t\u014a\4\u014b\t\u014b\4\u014c\t\u014c\4\u014d\t\u014d\4\u014e"
+ "\t\u014e\4\u014f\t\u014f\4\u0150\t\u0150\4\u0151\t\u0151\4\u0152\t\u0152"
+ "\4\u0153\t\u0153\4\u0154\t\u0154\4\u0155\t\u0155\4\u0156\t\u0156\4\u0157"
+ "\t\u0157\4\u0158\t\u0158\4\u0159\t\u0159\4\u015a\t\u015a\4\u015b\t\u015b"
+ "\4\u015c\t\u015c\4\u015d\t\u015d\4\u015e\t\u015e\4\u015f\t\u015f\4\u0160"
+ "\t\u0160\4\u0161\t\u0161\4\u0162\t\u0162\4\u0163\t\u0163\4\u0164\t\u0164"
+ "\4\u0165\t\u0165\4\u0166\t\u0166\4\u0167\t\u0167\4\u0168\t\u0168\4\u0169"
+ "\t\u0169\3\2\3\2\3\2\3\2\7\2\u02dc\n\2\f\2\16\2\u02df\13\2\3\2\3\2\3\3"
+ "\3\3\3\3\3\3\3\3\7\3\u02e8\n\3\f\3\16\3\u02eb\13\3\3\3\3\3\3\3\3\3\3\3"
+ "\3\4\3\4\3\4\3\4\7\4\u02f6\n\4\f\4\16\4\u02f9\13\4\3\4\3\4\3\5\3\5\3\5"
+ "\3\5\3\6\3\6\3\6\5\6\u0304\n\6\3\7\3\7\3\7\3\7\3\b\3\b\3\t\3\t\3\n\3\n"
+ "\3\n\3\n\3\13\3\13\3\f\3\f\3\f\3\f\3\r\3\r\3\16\3\16\3\17\3\17\3\20\3"
+ "\20\3\21\3\21\3\22\3\22\3\23\3\23\3\24\3\24\3\25\3\25\3\25\3\26\3\26\3"
+ "\26\3\27\3\27\3\27\3\30\3\30\3\30\3\31\3\31\3\32\3\32\3\33\3\33\3\34\3"
+ "\34\3\35\3\35\3\35\3\36\3\36\3\36\3\37\3\37\3\37\3 \3 \3 \3!\3!\3!\3\""
+ "\3\"\3\"\3#\3#\3#\3$\3$\3$\3%\3%\3%\3&\3&\3&\3&\3\'\3\'\3\'\3(\3(\3)\3"
+ ")\3*\3*\3+\3+\3+\3,\3,\3-\3-\3.\3.\3.\3/\3/\3/\3\60\3\60\3\60\3\61\3\61"
+ "\3\61\3\61\3\62\3\62\3\62\3\62\3\63\3\63\3\63\3\64\3\64\3\64\3\64\3\65"
+ "\3\65\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67"
+ "\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\38\38\38\38\38\38\38\38"
+ "\38\39\39\39\39\39\39\3:\3:\3:\3:\3:\3:\3:\3:\3;\3;\3;\3;\3;\3;\3;\3<"
+ "\3<\3<\3<\3<\3<\3=\3=\3=\3=\3=\3=\3=\3=\3=\3=\3>\3>\3>\3>\3?\3?\3?\3?"
+ "\3?\3?\3?\3@\3@\3@\3@\3A\3A\3A\3A\3B\3B\3B\3B\3B\3B\3B\3B\3B\3B\3C\3C"
+ "\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3D\3D\3D\3E\3E\3E\3E\3E\3E\3E\3E\3E\3E"
+ "\3F\3F\3F\3F\3F\3G\3G\3G\3G\3G\3H\3H\3H\3H\3H\3H\3I\3I\3I\3I\3I\3I\3I"
+ "\3J\3J\3J\3J\3J\3J\3K\3K\3K\3L\3L\3L\3L\3L\3M\3M\3M\3M\3M\3N\3N\3N\3N"
+ "\3O\3O\3O\3O\3O\3O\3P\3P\3P\3P\3P\3P\3P\3P\3Q\3Q\3Q\3Q\3R\3R\3R\3S\3S"
+ "\3S\3S\3S\3S\3T\3T\3T\3T\3T\3T\3U\3U\3U\3U\3U\3U\3U\3V\3V\3V\3V\3V\3V"
+ "\3V\3V\3V\3W\3W\3W\3W\3W\3W\3X\3X\3X\3Y\3Y\3Y\3Z\3Z\3Z\3[\3[\3[\3[\3["
+ "\3[\6[\u0473\n[\r[\16[\u0474\3\\\3\\\3\\\3\\\3\\\3\\\6\\\u047d\n\\\r\\"
+ "\16\\\u047e\3]\3]\3]\3]\3^\3^\3^\3^\3^\3^\3^\3_\3_\3_\3_\3_\3_\3_\3_\3"
+ "_\3_\3`\3`\3`\3`\3`\3a\3a\3a\3a\3a\3b\3b\3b\3b\3c\3c\3c\3c\3d\3d\3d\3"
+ "d\3d\3d\3d\3d\3d\3d\3e\3e\3e\3e\3e\3e\3e\3f\3f\3f\3f\3f\3f\3f\3f\3f\3"
+ "f\3g\3g\3g\3g\3g\3g\3g\3g\3g\3g\3h\3h\3h\3h\3h\3h\3h\3h\3i\3i\3i\3i\3"
+ "i\3i\3i\3j\3j\3j\3j\3j\3j\3j\3j\3k\3k\3k\3k\3k\3k\3k\3k\3k\3k\3l\3l\3"
+ "l\3l\3l\3l\3l\3l\3l\3m\3m\3m\3m\3m\3n\3n\3n\3n\3n\3n\3n\3o\3o\3o\3o\3"
+ "o\3o\3o\3o\3o\3o\3o\3p\3p\3p\3p\3p\3q\3q\3q\3q\3q\3q\3r\3r\3r\3r\3r\3"
+ "r\3r\3r\3s\3s\3s\3s\3s\3s\3s\3s\3s\3t\3t\3t\3t\3t\3t\3t\3u\3u\3u\3u\3"
+ "u\3u\3v\3v\3v\3v\3v\3v\3v\3v\3v\3w\3w\3w\3w\3w\3w\3w\3w\3x\3x\3x\3x\3"
+ "x\3x\3x\3x\3x\3y\3y\3y\3y\3y\3y\3y\3y\3y\3z\3z\3z\3z\3z\3z\3{\3{\3{\3"
+ "{\3{\3|\3|\3|\3|\3|\3|\3}\3}\3}\3}\3}\3}\3}\3}\3}\3~\3~\3~\3~\3~\3~\3"
+ "~\3\177\3\177\3\177\3\177\3\177\3\177\3\177\3\177\3\177\3\u0080\3\u0080"
+ "\3\u0080\3\u0080\3\u0080\3\u0080\3\u0080\3\u0080\3\u0080\3\u0080\3\u0080"
+ "\3\u0080\3\u0081\3\u0081\3\u0081\3\u0081\3\u0081\3\u0081\3\u0081\3\u0081"
+ "\3\u0082\3\u0082\3\u0082\3\u0082\3\u0083\3\u0083\3\u0083\3\u0083\3\u0083"
+ "\3\u0083\3\u0084\3\u0084\5\u0084\u05a4\n\u0084\3\u0085\3\u0085\5\u0085"
+ "\u05a8\n\u0085\3\u0085\3\u0085\3\u0086\3\u0086\7\u0086\u05ae\n\u0086\f"
+ "\u0086\16\u0086\u05b1\13\u0086\3\u0086\5\u0086\u05b4\n\u0086\3\u0086\3"
+ "\u0086\3\u0086\3\u0086\7\u0086\u05ba\n\u0086\f\u0086\16\u0086\u05bd\13"
+ "\u0086\3\u0086\3\u0086\5\u0086\u05c1\n\u0086\3\u0086\5\u0086\u05c4\n\u0086"
+ "\3\u0086\6\u0086\u05c7\n\u0086\r\u0086\16\u0086\u05c8\3\u0086\3\u0086"
+ "\3\u0086\6\u0086\u05ce\n\u0086\r\u0086\16\u0086\u05cf\3\u0086\3\u0086"
+ "\3\u0086\6\u0086\u05d5\n\u0086\r\u0086\16\u0086\u05d6\3\u0086\3\u0086"
+ "\5\u0086\u05db\n\u0086\3\u0086\6\u0086\u05de\n\u0086\r\u0086\16\u0086"
+ "\u05df\3\u0086\6\u0086\u05e3\n\u0086\r\u0086\16\u0086\u05e4\3\u0086\3"
+ "\u0086\5\u0086\u05e9\n\u0086\3\u0086\3\u0086\3\u0086\6\u0086\u05ee\n\u0086"
+ "\r\u0086\16\u0086\u05ef\3\u0086\3\u0086\3\u0086\3\u0086\3\u0086\6\u0086"
+ "\u05f7\n\u0086\r\u0086\16\u0086\u05f8\3\u0086\3\u0086\3\u0086\5\u0086"
+ "\u05fe\n\u0086\3\u0086\6\u0086\u0601\n\u0086\r\u0086\16\u0086\u0602\3"
+ "\u0086\3\u0086\3\u0086\6\u0086\u0608\n\u0086\r\u0086\16\u0086\u0609\3"
+ "\u0086\3\u0086\3\u0086\5\u0086\u060f\n\u0086\3\u0086\3\u0086\3\u0086\6"
+ "\u0086\u0614\n\u0086\r\u0086\16\u0086\u0615\3\u0086\3\u0086\5\u0086\u061a"
+ "\n\u0086\3\u0087\3\u0087\3\u0087\5\u0087\u061f\n\u0087\3\u0087\3\u0087"
+ "\3\u0088\3\u0088\3\u0088\7\u0088\u0626\n\u0088\f\u0088\16\u0088\u0629"
+ "\13\u0088\3\u0088\3\u0088\3\u0088\6\u0088\u062e\n\u0088\r\u0088\16\u0088"
+ "\u062f\3\u0088\3\u0088\3\u0088\3\u0088\7\u0088\u0636\n\u0088\f\u0088\16"
+ "\u0088\u0639\13\u0088\3\u0088\3\u0088\5\u0088\u063d\n\u0088\3\u0088\6"
+ "\u0088\u0640\n\u0088\r\u0088\16\u0088\u0641\3\u0088\3\u0088\7\u0088\u0646"
+ "\n\u0088\f\u0088\16\u0088\u0649\13\u0088\3\u0088\3\u0088\5\u0088\u064d"
+ "\n\u0088\3\u0088\3\u0088\3\u0088\6\u0088\u0652\n\u0088\r\u0088\16\u0088"
+ "\u0653\3\u0088\3\u0088\3\u0088\3\u0088\3\u0088\6\u0088\u065b\n\u0088\r"
+ "\u0088\16\u0088\u065c\3\u0088\3\u0088\3\u0088\5\u0088\u0662\n\u0088\3"
+ "\u0088\6\u0088\u0665\n\u0088\r\u0088\16\u0088\u0666\3\u0088\3\u0088\3"
+ "\u0088\6\u0088\u066c\n\u0088\r\u0088\16\u0088\u066d\3\u0088\3\u0088\3"
+ "\u0088\5\u0088\u0673\n\u0088\3\u0088\3\u0088\3\u0088\6\u0088\u0678\n\u0088"
+ "\r\u0088\16\u0088\u0679\3\u0088\3\u0088\5\u0088\u067e\n\u0088\3\u0089"
+ "\3\u0089\3\u008a\3\u008a\3\u008b\3\u008b\3\u008c\3\u008c\3\u008c\3\u008c"
+ "\3\u008c\7\u008c\u068b\n\u008c\f\u008c\16\u008c\u068e\13\u008c\3\u008d"
+ "\3\u008d\3\u008e\3\u008e\3\u008e\3\u008e\3\u008e\7\u008e\u0697\n\u008e"
+ "\f\u008e\16\u008e\u069a\13\u008e\3\u008f\3\u008f\3\u0090\3\u0090\3\u0090"
+ "\3\u0090\3\u0090\3\u0090\3\u0090\3\u0090\3\u0090\5\u0090\u06a7\n\u0090"
+ "\3\u0091\3\u0091\3\u0091\3\u0091\3\u0091\3\u0092\3\u0092\5\u0092\u06b0"
+ "\n\u0092\3\u0092\3\u0092\3\u0092\7\u0092\u06b5\n\u0092\f\u0092\16\u0092"
+ "\u06b8\13\u0092\3\u0092\3\u0092\6\u0092\u06bc\n\u0092\r\u0092\16\u0092"
+ "\u06bd\3\u0092\5\u0092\u06c1\n\u0092\3\u0093\3\u0093\3\u0093\3\u0094\3"
+ "\u0094\3\u0094\3\u0095\3\u0095\3\u0095\3\u0096\3\u0096\3\u0096\5\u0096"
+ "\u06cf\n\u0096\3\u0096\3\u0096\3\u0097\3\u0097\5\u0097\u06d5\n\u0097\3"
+ "\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0099\3\u0099"
+ "\3\u0099\3\u009a\3\u009a\3\u009a\3\u009a\3\u009a\3\u009a\5\u009a\u06e7"
+ "\n\u009a\3\u009b\3\u009b\3\u009c\3\u009c\3\u009d\3\u009d\3\u009e\3\u009e"
+ "\3\u009f\3\u009f\3\u00a0\3\u00a0\3\u00a1\3\u00a1\3\u00a2\3\u00a2\3\u00a2"
+ "\3\u00a2\3\u00a2\3\u00a3\3\u00a3\3\u00a3\3\u00a3\3\u00a3\3\u00a4\3\u00a4"
+ "\3\u00a4\3\u00a4\3\u00a4\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a6"
+ "\3\u00a6\3\u00a6\3\u00a6\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a8\3\u00a8"
+ "\3\u00a8\3\u00a8\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00aa\3\u00aa\3\u00aa"
+ "\3\u00aa\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ac\3\u00ac\3\u00ac\3\u00ac"
+ "\3\u00ad\3\u00ad\3\u00ad\3\u00ad\3\u00ae\3\u00ae\3\u00ae\3\u00ae\3\u00af"
+ "\3\u00af\3\u00af\3\u00af\3\u00b0\3\u00b0\3\u00b0\3\u00b0\3\u00b1\3\u00b1"
+ "\3\u00b1\3\u00b1\3\u00b2\3\u00b2\3\u00b2\3\u00b2\3\u00b3\3\u00b3\3\u00b3"
+ "\3\u00b3\3\u00b4\3\u00b4\3\u00b4\3\u00b4\3\u00b5\3\u00b5\3\u00b5\3\u00b5"
+ "\3\u00b6\3\u00b6\3\u00b6\3\u00b6\3\u00b7\3\u00b7\3\u00b7\3\u00b7\3\u00b8"
+ "\3\u00b8\3\u00b8\3\u00b8\3\u00b9\3\u00b9\3\u00b9\3\u00b9\3\u00ba\3\u00ba"
+ "\3\u00ba\3\u00ba\3\u00bb\3\u00bb\3\u00bb\3\u00bb\3\u00bc\3\u00bc\3\u00bc"
+ "\3\u00bc\3\u00bd\3\u00bd\3\u00bd\3\u00bd\3\u00be\3\u00be\3\u00be\3\u00be"
+ "\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c1"
+ "\3\u00c1\3\u00c1\3\u00c1\3\u00c2\3\u00c2\3\u00c2\3\u00c2\3\u00c3\3\u00c3"
+ "\3\u00c3\3\u00c3\3\u00c4\3\u00c4\3\u00c4\3\u00c4\3\u00c5\3\u00c5\3\u00c5"
+ "\3\u00c5\3\u00c6\3\u00c6\3\u00c6\3\u00c6\3\u00c7\3\u00c7\3\u00c7\3\u00c7"
+ "\3\u00c8\3\u00c8\3\u00c8\3\u00c8\3\u00c9\3\u00c9\3\u00c9\3\u00c9\3\u00ca"
+ "\3\u00ca\3\u00ca\3\u00ca\3\u00cb\3\u00cb\3\u00cb\3\u00cb\3\u00cc\3\u00cc"
+ "\3\u00cc\3\u00cc\3\u00cd\3\u00cd\3\u00cd\3\u00cd\3\u00ce\3\u00ce\3\u00ce"
+ "\3\u00ce\3\u00cf\3\u00cf\3\u00cf\3\u00cf\3\u00d0\3\u00d0\3\u00d0\3\u00d0"
+ "\3\u00d1\3\u00d1\3\u00d1\3\u00d1\3\u00d2\3\u00d2\3\u00d2\3\u00d2\3\u00d3"
+ "\3\u00d3\3\u00d3\3\u00d3\3\u00d3\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d4"
+ "\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d7"
+ "\3\u00d7\3\u00d7\3\u00d7\3\u00d8\3\u00d8\3\u00d8\3\u00d8\3\u00d9\3\u00d9"
+ "\3\u00d9\3\u00d9\3\u00da\3\u00da\3\u00da\3\u00da\3\u00db\3\u00db\3\u00db"
+ "\3\u00db\3\u00dc\3\u00dc\3\u00dc\3\u00dc\3\u00dd\3\u00dd\3\u00dd\3\u00dd"
+ "\3\u00de\3\u00de\3\u00de\3\u00de\3\u00df\3\u00df\3\u00df\3\u00df\3\u00e0"
+ "\3\u00e0\3\u00e0\3\u00e0\3\u00e1\3\u00e1\3\u00e1\3\u00e1\3\u00e2\3\u00e2"
+ "\3\u00e2\3\u00e2\3\u00e3\3\u00e3\3\u00e3\3\u00e3\3\u00e4\3\u00e4\3\u00e4"
+ "\3\u00e4\3\u00e5\3\u00e5\3\u00e5\3\u00e5\3\u00e6\3\u00e6\3\u00e6\3\u00e6"
+ "\3\u00e7\3\u00e7\3\u00e7\3\u00e7\3\u00e8\3\u00e8\3\u00e8\3\u00e8\3\u00e9"
+ "\3\u00e9\3\u00e9\3\u00e9\3\u00ea\3\u00ea\3\u00ea\3\u00ea\3\u00eb\3\u00eb"
+ "\3\u00eb\3\u00eb\3\u00ec\3\u00ec\3\u00ec\3\u00ec\3\u00ed\3\u00ed\3\u00ed"
+ "\3\u00ed\3\u00ee\3\u00ee\3\u00ee\3\u00ee\3\u00ef\3\u00ef\3\u00ef\3\u00ef"
+ "\3\u00f0\3\u00f0\3\u00f0\3\u00f0\3\u00f1\3\u00f1\3\u00f1\3\u00f1\3\u00f2"
+ "\3\u00f2\3\u00f2\3\u00f2\3\u00f3\3\u00f3\3\u00f3\3\u00f3\3\u00f4\3\u00f4"
+ "\3\u00f4\3\u00f4\3\u00f5\3\u00f5\3\u00f5\3\u00f5\3\u00f6\3\u00f6\3\u00f6"
+ "\3\u00f6\3\u00f7\3\u00f7\3\u00f7\3\u00f7\3\u00f8\3\u00f8\3\u00f8\3\u00f8"
+ "\3\u00f9\3\u00f9\3\u00f9\3\u00f9\3\u00fa\3\u00fa\3\u00fa\3\u00fa\3\u00fb"
+ "\3\u00fb\3\u00fb\3\u00fb\3\u00fc\3\u00fc\3\u00fc\3\u00fc\3\u00fd\3\u00fd"
+ "\3\u00fd\3\u00fd\3\u00fe\3\u00fe\3\u00fe\3\u00fe\3\u00ff\3\u00ff\3\u00ff"
+ "\3\u00ff\3\u0100\3\u0100\3\u0100\3\u0100\3\u0101\3\u0101\3\u0101\3\u0101"
+ "\3\u0102\3\u0102\3\u0102\3\u0102\3\u0103\3\u0103\3\u0103\3\u0103\3\u0104"
+ "\3\u0104\3\u0104\3\u0104\3\u0105\3\u0105\3\u0105\3\u0105\3\u0106\3\u0106"
+ "\3\u0106\3\u0106\3\u0107\3\u0107\3\u0107\3\u0107\3\u0108\3\u0108\3\u0108"
+ "\3\u0108\3\u0109\3\u0109\3\u0109\3\u0109\3\u010a\3\u010a\3\u010a\3\u010a"
+ "\3\u010b\3\u010b\3\u010b\3\u010b\3\u010c\3\u010c\3\u010c\3\u010c\3\u010d"
+ "\3\u010d\3\u010d\3\u010d\3\u010e\3\u010e\3\u010e\3\u010e\3\u010f\3\u010f"
+ "\3\u010f\3\u010f\3\u0110\3\u0110\3\u0110\3\u0110\3\u0111\3\u0111\3\u0111"
+ "\3\u0111\3\u0112\3\u0112\3\u0112\3\u0112\3\u0113\3\u0113\3\u0113\3\u0113"
+ "\3\u0114\3\u0114\3\u0114\3\u0114\3\u0115\3\u0115\3\u0115\3\u0115\3\u0116"
+ "\3\u0116\3\u0116\3\u0116\3\u0117\3\u0117\3\u0117\3\u0117\3\u0118\3\u0118"
+ "\5\u0118\u08d7\n\u0118\3\u0118\3\u0118\3\u0119\3\u0119\3\u0119\3\u0119"
+ "\3\u011a\3\u011a\3\u011a\3\u011a\3\u011b\3\u011b\3\u011b\3\u011b\3\u011c"
+ "\3\u011c\3\u011d\6\u011d\u08ea\n\u011d\r\u011d\16\u011d\u08eb\3\u011d"
+ "\5\u011d\u08ef\n\u011d\3\u011e\3\u011e\3\u011e\5\u011e\u08f4\n\u011e\3"
+ "\u011f\3\u011f\3\u011f\3\u011f\3\u011f\3\u0120\5\u0120\u08fc\n\u0120\3"
+ "\u0120\3\u0120\3\u0120\3\u0120\3\u0120\3\u0120\3\u0121\6\u0121\u0905\n"
+ "\u0121\r\u0121\16\u0121\u0906\3\u0122\3\u0122\3\u0123\6\u0123\u090c\n"
+ "\u0123\r\u0123\16\u0123\u090d\3\u0123\5\u0123\u0911\n\u0123\3\u0124\3"
+ "\u0124\3\u0124\3\u0125\3\u0125\3\u0125\3\u0125\3\u0125\3\u0126\3\u0126"
+ "\3\u0126\3\u0126\3\u0127\3\u0127\3\u0127\3\u0127\3\u0127\3\u0128\3\u0128"
+ "\3\u0128\3\u0128\3\u0128\3\u0129\3\u0129\3\u0129\3\u0129\3\u0129\3\u012a"
+ "\3\u012a\3\u012a\3\u012a\3\u012b\3\u012b\3\u012b\3\u012b\3\u012c\3\u012c"
+ "\3\u012c\3\u012c\3\u012c\3\u012d\3\u012d\3\u012d\3\u012d\3\u012e\3\u012e"
+ "\3\u012e\3\u012e\3\u012f\3\u012f\3\u012f\3\u012f\3\u0130\3\u0130\3\u0130"
+ "\3\u0130\3\u0131\3\u0131\3\u0131\3\u0131\3\u0132\3\u0132\3\u0132\3\u0132"
+ "\3\u0133\3\u0133\3\u0133\3\u0133\3\u0134\3\u0134\3\u0134\3\u0134\3\u0135"
+ "\3\u0135\3\u0135\3\u0135\3\u0136\3\u0136\3\u0136\3\u0136\3\u0137\3\u0137"
+ "\3\u0137\3\u0137\3\u0138\3\u0138\3\u0138\3\u0138\3\u0139\3\u0139\3\u0139"
+ "\3\u0139\3\u013a\3\u013a\3\u013a\3\u013a\3\u013b\3\u013b\3\u013b\3\u013b"
+ "\3\u013c\3\u013c\3\u013c\3\u013c\3\u013d\3\u013d\3\u013d\3\u013d\3\u013e"
+ "\3\u013e\3\u013e\3\u013e\3\u013f\3\u013f\3\u013f\3\u013f\3\u0140\3\u0140"
+ "\3\u0140\3\u0140\3\u0141\3\u0141\3\u0141\3\u0141\3\u0142\3\u0142\3\u0142"
+ "\3\u0142\3\u0143\3\u0143\3\u0143\3\u0143\3\u0144\3\u0144\3\u0144\3\u0144"
+ "\3\u0145\3\u0145\3\u0145\3\u0145\3\u0146\3\u0146\3\u0146\3\u0146\3\u0147"
+ "\3\u0147\3\u0147\3\u0147\3\u0148\3\u0148\3\u0148\3\u0148\3\u0149\3\u0149"
+ "\3\u0149\3\u0149\3\u014a\3\u014a\3\u014a\3\u014a\3\u014b\3\u014b\3\u014b"
+ "\3\u014b\3\u014c\3\u014c\3\u014c\3\u014c\3\u014d\3\u014d\3\u014d\3\u014d"
+ "\3\u014e\3\u014e\3\u014e\3\u014e\3\u014f\3\u014f\3\u014f\3\u014f\3\u0150"
+ "\3\u0150\3\u0150\3\u0150\3\u0151\3\u0151\3\u0151\3\u0151\3\u0152\3\u0152"
+ "\3\u0152\3\u0152\3\u0153\3\u0153\3\u0154\3\u0154\3\u0154\3\u0154\3\u0155"
+ "\3\u0155\3\u0155\3\u0155\3\u0156\3\u0156\3\u0156\3\u0156\3\u0157\3\u0157"
+ "\3\u0157\3\u0157\3\u0158\3\u0158\3\u0158\3\u0158\3\u0159\3\u0159\3\u0159"
+ "\3\u0159\3\u015a\3\u015a\3\u015a\3\u015a\3\u015a\3\u015b\3\u015b\3\u015b"
+ "\3\u015b\3\u015b\3\u015c\3\u015c\3\u015c\3\u015c\3\u015d\3\u015d\3\u015d"
+ "\3\u015d\3\u015e\3\u015e\3\u015e\3\u015e\3\u015f\3\u015f\3\u015f\3\u015f"
+ "\3\u0160\3\u0160\3\u0160\3\u0160\3\u0161\3\u0161\3\u0161\3\u0161\3\u0162"
+ "\3\u0162\3\u0162\3\u0162\3\u0163\3\u0163\3\u0163\3\u0163\3\u0164\3\u0164"
+ "\3\u0164\3\u0164\3\u0165\3\u0165\3\u0165\3\u0165\3\u0166\3\u0166\3\u0166"
+ "\3\u0166\3\u0167\3\u0167\5\u0167\u0a25\n\u0167\3\u0167\3\u0167\3\u0168"
+ "\3\u0168\3\u0168\3\u0168\3\u0169\3\u0169\3\u0169\3\u0169\3\u02e9\2\u016a"
+ "\7\3\t\4\13\5\r\6\17\7\21\b\23\t\25\n\27\13\31\f\33\r\35\16\37\17!\20"
+ "#\21%\22\'\23)\24+\25-\26/\27\61\30\63\31\65\32\67\339\34;\35=\36?\37"
+ "A C!E\"G#I$K%M&O\'Q(S)U*W+Y,[-]._/a\60c\61e\62g\63i\64k\65m\66o\67q8s"
+ "9u:w;y<{=}>\177?\u0081@\u0083A\u0085B\u0087C\u0089D\u008bE\u008dF\u008f"
+ "G\u0091H\u0093I\u0095J\u0097K\u0099L\u009bM\u009dN\u009fO\u00a1P\u00a3"
+ "Q\u00a5R\u00a7S\u00a9T\u00abU\u00adV\u00afW\u00b1X\u00b3Y\u00b5Z\u00b7"
+ "[\u00b9\\\u00bb]\u00bd^\u00bf_\u00c1`\u00c3a\u00c5b\u00c7c\u00c9d\u00cb"
+ "e\u00cdf\u00cfg\u00d1h\u00d3i\u00d5j\u00d7k\u00d9l\u00dbm\u00ddn\u00df"
+ "o\u00e1p\u00e3q\u00e5r\u00e7s\u00e9t\u00ebu\u00edv\u00efw\u00f1x\u00f3"
+ "y\u00f5z\u00f7{\u00f9|\u00fb}\u00fd~\u00ff\177\u0101\u0080\u0103\u0081"
+ "\u0105\u0082\u0107\u0083\u0109\u0084\u010b\u0085\u010d\u0086\u010f\u0087"
+ "\u0111\u0088\u0113\u0089\u0115\2\u0117\2\u0119\2\u011b\u008a\u011d\2\u011f"
+ "\u008b\u0121\2\u0123\u008c\u0125\u008d\u0127\u008e\u0129\u008f\u012b\u0090"
+ "\u012d\u0091\u012f\u0092\u0131\2\u0133\2\u0135\2\u0137\2\u0139\u0093\u013b"
+ "\u0094\u013d\u0095\u013f\u0096\u0141\u0097\u0143\u0098\u0145\u0099\u0147"
+ "\2\u0149\2\u014b\2\u014d\2\u014f\2\u0151\2\u0153\2\u0155\2\u0157\2\u0159"
+ "\2\u015b\2\u015d\2\u015f\2\u0161\2\u0163\2\u0165\2\u0167\2\u0169\2\u016b"
+ "\2\u016d\2\u016f\2\u0171\2\u0173\2\u0175\2\u0177\2\u0179\2\u017b\2\u017d"
+ "\2\u017f\2\u0181\2\u0183\2\u0185\2\u0187\2\u0189\2\u018b\2\u018d\2\u018f"
+ "\2\u0191\2\u0193\2\u0195\2\u0197\2\u0199\2\u019b\2\u019d\2\u019f\2\u01a1"
+ "\2\u01a3\2\u01a5\2\u01a7\2\u01a9\2\u01ab\2\u01ad\2\u01af\2\u01b1\2\u01b3"
+ "\2\u01b5\2\u01b7\2\u01b9\2\u01bb\2\u01bd\2\u01bf\2\u01c1\2\u01c3\2\u01c5"
+ "\2\u01c7\2\u01c9\2\u01cb\2\u01cd\2\u01cf\2\u01d1\2\u01d3\2\u01d5\2\u01d7"
+ "\2\u01d9\2\u01db\2\u01dd\2\u01df\2\u01e1\2\u01e3\2\u01e5\2\u01e7\2\u01e9"
+ "\2\u01eb\2\u01ed\2\u01ef\2\u01f1\2\u01f3\2\u01f5\2\u01f7\2\u01f9\2\u01fb"
+ "\2\u01fd\2\u01ff\2\u0201\2\u0203\2\u0205\2\u0207\2\u0209\2\u020b\2\u020d"
+ "\2\u020f\2\u0211\2\u0213\2\u0215\2\u0217\2\u0219\2\u021b\2\u021d\2\u021f"
+ "\2\u0221\2\u0223\2\u0225\2\u0227\2\u0229\2\u022b\2\u022d\2\u022f\2\u0231"
+ "\2\u0233\u009a\u0235\u009b\u0237\u009c\u0239\u009d\u023b\u009e\u023d\u009f"
+ "\u023f\u00a0\u0241\u00a1\u0243\u00a2\u0245\u00a3\u0247\u00a4\u0249\u00a5"
+ "\u024b\u00a6\u024d\u00a7\u024f\u00a8\u0251\2\u0253\2\u0255\2\u0257\2\u0259"
+ "\2\u025b\2\u025d\2\u025f\2\u0261\2\u0263\2\u0265\2\u0267\2\u0269\2\u026b"
+ "\2\u026d\2\u026f\2\u0271\2\u0273\2\u0275\2\u0277\2\u0279\2\u027b\2\u027d"
+ "\2\u027f\2\u0281\2\u0283\2\u0285\2\u0287\2\u0289\2\u028b\2\u028d\2\u028f"
+ "\2\u0291\2\u0293\2\u0295\2\u0297\2\u0299\2\u029b\2\u029d\2\u029f\2\u02a1"
+ "\2\u02a3\2\u02a5\2\u02a7\2\u02a9\u00a9\u02ab\2\u02ad\2\u02af\2\u02b1\2"
+ "\u02b3\2\u02b5\2\u02b7\2\u02b9\2\u02bb\2\u02bd\2\u02bf\2\u02c1\2\u02c3"
+ "\2\u02c5\2\u02c7\2\u02c9\2\u02cb\2\u02cd\2\u02cf\2\u02d1\u00aa\u02d3\u00ab"
+ "\u02d5\u00ac\7\2\3\4\5\6\26\4\2\f\f\17\17\5\2\13\13\16\16\"\"\4\2HHhh"
+ "\4\2GGgg\4\2--//\'\2\63;\u0663\u066b\u06f3\u06fb\u07c3\u07cb\u0969\u0971"
+ "\u09e9\u09f1\u0a69\u0a71\u0ae9\u0af1\u0b69\u0b71\u0be9\u0bf1\u0c69\u0c71"
+ "\u0ce9\u0cf1\u0d69\u0d71\u0de9\u0df1\u0e53\u0e5b\u0ed3\u0edb\u0f23\u0f2b"
+ "\u1043\u104b\u1093\u109b\u17e3\u17eb\u1813\u181b\u1949\u1951\u19d3\u19db"
+ "\u1a83\u1a8b\u1a93\u1a9b\u1b53\u1b5b\u1bb3\u1bbb\u1c43\u1c4b\u1c53\u1c5b"
+ "\ua623\ua62b\ua8d3\ua8db\ua903\ua90b\ua9d3\ua9db\ua9f3\ua9fb\uaa53\uaa5b"
+ "\uabf3\uabfb\uff13\uff1b\4\2ZZzz\5\2\62;CHch\4\2DDdd\3\2\62\63\3\2bb\n"
+ "\2$$&&))^^ddppttvv\u0248\2c|\u00b7\u00b7\u00e1\u00f8\u00fa\u0101\u0103"
+ "\u0103\u0105\u0105\u0107\u0107\u0109\u0109\u010b\u010b\u010d\u010d\u010f"
+ "\u010f\u0111\u0111\u0113\u0113\u0115\u0115\u0117\u0117\u0119\u0119\u011b"
+ "\u011b\u011d\u011d\u011f\u011f\u0121\u0121\u0123\u0123\u0125\u0125\u0127"
+ "\u0127\u0129\u0129\u012b\u012b\u012d\u012d\u012f\u012f\u0131\u0131\u0133"
+ "\u0133\u0135\u0135\u0137\u0137\u0139\u013a\u013c\u013c\u013e\u013e\u0140"
+ "\u0140\u0142\u0142\u0144\u0144\u0146\u0146\u0148\u0148\u014a\u014b\u014d"
+ "\u014d\u014f\u014f\u0151\u0151\u0153\u0153\u0155\u0155\u0157\u0157\u0159"
+ "\u0159\u015b\u015b\u015d\u015d\u015f\u015f\u0161\u0161\u0163\u0163\u0165"
+ "\u0165\u0167\u0167\u0169\u0169\u016b\u016b\u016d\u016d\u016f\u016f\u0171"
+ "\u0171\u0173\u0173\u0175\u0175\u0177\u0177\u0179\u0179\u017c\u017c\u017e"
+ "\u017e\u0180\u0182\u0185\u0185\u0187\u0187\u018a\u018a\u018e\u018f\u0194"
+ "\u0194\u0197\u0197\u019b\u019d\u01a0\u01a0\u01a3\u01a3\u01a5\u01a5\u01a7"
+ "\u01a7\u01aa\u01aa\u01ac\u01ad\u01af\u01af\u01b2\u01b2\u01b6\u01b6\u01b8"
+ "\u01b8\u01bb\u01bc\u01bf\u01c1\u01c8\u01c8\u01cb\u01cb\u01ce\u01ce\u01d0"
+ "\u01d0\u01d2\u01d2\u01d4\u01d4\u01d6\u01d6\u01d8\u01d8\u01da\u01da\u01dc"
+ "\u01dc\u01de\u01df\u01e1\u01e1\u01e3\u01e3\u01e5\u01e5\u01e7\u01e7\u01e9"
+ "\u01e9\u01eb\u01eb\u01ed\u01ed\u01ef\u01ef\u01f1\u01f2\u01f5\u01f5\u01f7"
+ "\u01f7\u01fb\u01fb\u01fd\u01fd\u01ff\u01ff\u0201\u0201\u0203\u0203\u0205"
+ "\u0205\u0207\u0207\u0209\u0209\u020b\u020b\u020d\u020d\u020f\u020f\u0211"
+ "\u0211\u0213\u0213\u0215\u0215\u0217\u0217\u0219\u0219\u021b\u021b\u021d"
+ "\u021d\u021f\u021f\u0221\u0221\u0223\u0223\u0225\u0225\u0227\u0227\u0229"
+ "\u0229\u022b\u022b\u022d\u022d\u022f\u022f\u0231\u0231\u0233\u0233\u0235"
+ "\u023b\u023e\u023e\u0241\u0242\u0244\u0244\u0249\u0249\u024b\u024b\u024d"
+ "\u024d\u024f\u024f\u0251\u0295\u0297\u02b1\u0373\u0373\u0375\u0375\u0379"
+ "\u0379\u037d\u037f\u0392\u0392\u03ae\u03d0\u03d2\u03d3\u03d7\u03d9\u03db"
+ "\u03db\u03dd\u03dd\u03df\u03df\u03e1\u03e1\u03e3\u03e3\u03e5\u03e5\u03e7"
+ "\u03e7\u03e9\u03e9\u03eb\u03eb\u03ed\u03ed\u03ef\u03ef\u03f1\u03f5\u03f7"
+ "\u03f7\u03fa\u03fa\u03fd\u03fe\u0432\u0461\u0463\u0463\u0465\u0465\u0467"
+ "\u0467\u0469\u0469\u046b\u046b\u046d\u046d\u046f\u046f\u0471\u0471\u0473"
+ "\u0473\u0475\u0475\u0477\u0477\u0479\u0479\u047b\u047b\u047d\u047d\u047f"
+ "\u047f\u0481\u0481\u0483\u0483\u048d\u048d\u048f\u048f\u0491\u0491\u0493"
+ "\u0493\u0495\u0495\u0497\u0497\u0499\u0499\u049b\u049b\u049d\u049d\u049f"
+ "\u049f\u04a1\u04a1\u04a3\u04a3\u04a5\u04a5\u04a7\u04a7\u04a9\u04a9\u04ab"
+ "\u04ab\u04ad\u04ad\u04af\u04af\u04b1\u04b1\u04b3\u04b3\u04b5\u04b5\u04b7"
+ "\u04b7\u04b9\u04b9\u04bb\u04bb\u04bd\u04bd\u04bf\u04bf\u04c1\u04c1\u04c4"
+ "\u04c4\u04c6\u04c6\u04c8\u04c8\u04ca\u04ca\u04cc\u04cc\u04ce\u04ce\u04d0"
+ "\u04d1\u04d3\u04d3\u04d5\u04d5\u04d7\u04d7\u04d9\u04d9\u04db\u04db\u04dd"
+ "\u04dd\u04df\u04df\u04e1\u04e1\u04e3\u04e3\u04e5\u04e5\u04e7\u04e7\u04e9"
+ "\u04e9\u04eb\u04eb\u04ed\u04ed\u04ef\u04ef\u04f1\u04f1\u04f3\u04f3\u04f5"
+ "\u04f5\u04f7\u04f7\u04f9\u04f9\u04fb\u04fb\u04fd\u04fd\u04ff\u04ff\u0501"
+ "\u0501\u0503\u0503\u0505\u0505\u0507\u0507\u0509\u0509\u050b\u050b\u050d"
+ "\u050d\u050f\u050f\u0511\u0511\u0513\u0513\u0515\u0515\u0517\u0517\u0519"
+ "\u0519\u051b\u051b\u051d\u051d\u051f\u051f\u0521\u0521\u0523\u0523\u0525"
+ "\u0525\u0527\u0527\u0529\u0529\u0563\u0589\u1d02\u1d2d\u1d6d\u1d79\u1d7b"
+ "\u1d9c\u1e03\u1e03\u1e05\u1e05\u1e07\u1e07\u1e09\u1e09\u1e0b\u1e0b\u1e0d"
+ "\u1e0d\u1e0f\u1e0f\u1e11\u1e11\u1e13\u1e13\u1e15\u1e15\u1e17\u1e17\u1e19"
+ "\u1e19\u1e1b\u1e1b\u1e1d\u1e1d\u1e1f\u1e1f\u1e21\u1e21\u1e23\u1e23\u1e25"
+ "\u1e25\u1e27\u1e27\u1e29\u1e29\u1e2b\u1e2b\u1e2d\u1e2d\u1e2f\u1e2f\u1e31"
+ "\u1e31\u1e33\u1e33\u1e35\u1e35\u1e37\u1e37\u1e39\u1e39\u1e3b\u1e3b\u1e3d"
+ "\u1e3d\u1e3f\u1e3f\u1e41\u1e41\u1e43\u1e43\u1e45\u1e45\u1e47\u1e47\u1e49"
+ "\u1e49\u1e4b\u1e4b\u1e4d\u1e4d\u1e4f\u1e4f\u1e51\u1e51\u1e53\u1e53\u1e55"
+ "\u1e55\u1e57\u1e57\u1e59\u1e59\u1e5b\u1e5b\u1e5d\u1e5d\u1e5f\u1e5f\u1e61"
+ "\u1e61\u1e63\u1e63\u1e65\u1e65\u1e67\u1e67\u1e69\u1e69\u1e6b\u1e6b\u1e6d"
+ "\u1e6d\u1e6f\u1e6f\u1e71\u1e71\u1e73\u1e73\u1e75\u1e75\u1e77\u1e77\u1e79"
+ "\u1e79\u1e7b\u1e7b\u1e7d\u1e7d\u1e7f\u1e7f\u1e81\u1e81\u1e83\u1e83\u1e85"
+ "\u1e85\u1e87\u1e87\u1e89\u1e89\u1e8b\u1e8b\u1e8d\u1e8d\u1e8f\u1e8f\u1e91"
+ "\u1e91\u1e93\u1e93\u1e95\u1e95\u1e97\u1e9f\u1ea1\u1ea1\u1ea3\u1ea3\u1ea5"
+ "\u1ea5\u1ea7\u1ea7\u1ea9\u1ea9\u1eab\u1eab\u1ead\u1ead\u1eaf\u1eaf\u1eb1"
+ "\u1eb1\u1eb3\u1eb3\u1eb5\u1eb5\u1eb7\u1eb7\u1eb9\u1eb9\u1ebb\u1ebb\u1ebd"
+ "\u1ebd\u1ebf\u1ebf\u1ec1\u1ec1\u1ec3\u1ec3\u1ec5\u1ec5\u1ec7\u1ec7\u1ec9"
+ "\u1ec9\u1ecb\u1ecb\u1ecd\u1ecd\u1ecf\u1ecf\u1ed1\u1ed1\u1ed3\u1ed3\u1ed5"
+ "\u1ed5\u1ed7\u1ed7\u1ed9\u1ed9\u1edb\u1edb\u1edd\u1edd\u1edf\u1edf\u1ee1"
+ "\u1ee1\u1ee3\u1ee3\u1ee5\u1ee5\u1ee7\u1ee7\u1ee9\u1ee9\u1eeb\u1eeb\u1eed"
+ "\u1eed\u1eef\u1eef\u1ef1\u1ef1\u1ef3\u1ef3\u1ef5\u1ef5\u1ef7\u1ef7\u1ef9"
+ "\u1ef9\u1efb\u1efb\u1efd\u1efd\u1eff\u1eff\u1f01\u1f09\u1f12\u1f17\u1f22"
+ "\u1f29\u1f32\u1f39\u1f42\u1f47\u1f52\u1f59\u1f62\u1f69\u1f72\u1f7f\u1f82"
+ "\u1f89\u1f92\u1f99\u1fa2\u1fa9\u1fb2\u1fb6\u1fb8\u1fb9\u1fc0\u1fc0\u1fc4"
+ "\u1fc6\u1fc8\u1fc9\u1fd2\u1fd5\u1fd8\u1fd9\u1fe2\u1fe9\u1ff4\u1ff6\u1ff8"
+ "\u1ff9\u210c\u210c\u2110\u2111\u2115\u2115\u2131\u2131\u2136\u2136\u213b"
+ "\u213b\u213e\u213f\u2148\u214b\u2150\u2150\u2186\u2186\u2c32\u2c60\u2c63"
+ "\u2c63\u2c67\u2c68\u2c6a\u2c6a\u2c6c\u2c6c\u2c6e\u2c6e\u2c73\u2c73\u2c75"
+ "\u2c76\u2c78\u2c7d\u2c83\u2c83\u2c85\u2c85\u2c87\u2c87\u2c89\u2c89\u2c8b"
+ "\u2c8b\u2c8d\u2c8d\u2c8f\u2c8f\u2c91\u2c91\u2c93\u2c93\u2c95\u2c95\u2c97"
+ "\u2c97\u2c99\u2c99\u2c9b\u2c9b\u2c9d\u2c9d\u2c9f\u2c9f\u2ca1\u2ca1\u2ca3"
+ "\u2ca3\u2ca5\u2ca5\u2ca7\u2ca7\u2ca9\u2ca9\u2cab\u2cab\u2cad\u2cad\u2caf"
+ "\u2caf\u2cb1\u2cb1\u2cb3\u2cb3\u2cb5\u2cb5\u2cb7\u2cb7\u2cb9\u2cb9\u2cbb"
+ "\u2cbb\u2cbd\u2cbd\u2cbf\u2cbf\u2cc1\u2cc1\u2cc3\u2cc3\u2cc5\u2cc5\u2cc7"
+ "\u2cc7\u2cc9\u2cc9\u2ccb\u2ccb\u2ccd\u2ccd\u2ccf\u2ccf\u2cd1\u2cd1\u2cd3"
+ "\u2cd3\u2cd5\u2cd5\u2cd7\u2cd7\u2cd9\u2cd9\u2cdb\u2cdb\u2cdd\u2cdd\u2cdf"
+ "\u2cdf\u2ce1\u2ce1\u2ce3\u2ce3\u2ce5\u2ce6\u2cee\u2cee\u2cf0\u2cf0\u2cf5"
+ "\u2cf5\u2d02\u2d27\u2d29\u2d29\u2d2f\u2d2f\ua643\ua643\ua645\ua645\ua647"
+ "\ua647\ua649\ua649\ua64b\ua64b\ua64d\ua64d\ua64f\ua64f\ua651\ua651\ua653"
+ "\ua653\ua655\ua655\ua657\ua657\ua659\ua659\ua65b\ua65b\ua65d\ua65d\ua65f"
+ "\ua65f\ua661\ua661\ua663\ua663\ua665\ua665\ua667\ua667\ua669\ua669\ua66b"
+ "\ua66b\ua66d\ua66d\ua66f\ua66f\ua683\ua683\ua685\ua685\ua687\ua687\ua689"
+ "\ua689\ua68b\ua68b\ua68d\ua68d\ua68f\ua68f\ua691\ua691\ua693\ua693\ua695"
+ "\ua695\ua697\ua697\ua699\ua699\ua725\ua725\ua727\ua727\ua729\ua729\ua72b"
+ "\ua72b\ua72d\ua72d\ua72f\ua72f\ua731\ua733\ua735\ua735\ua737\ua737\ua739"
+ "\ua739\ua73b\ua73b\ua73d\ua73d\ua73f\ua73f\ua741\ua741\ua743\ua743\ua745"
+ "\ua745\ua747\ua747\ua749\ua749\ua74b\ua74b\ua74d\ua74d\ua74f\ua74f\ua751"
+ "\ua751\ua753\ua753\ua755\ua755\ua757\ua757\ua759\ua759\ua75b\ua75b\ua75d"
+ "\ua75d\ua75f\ua75f\ua761\ua761\ua763\ua763\ua765\ua765\ua767\ua767\ua769"
+ "\ua769\ua76b\ua76b\ua76d\ua76d\ua76f\ua76f\ua771\ua771\ua773\ua77a\ua77c"
+ "\ua77c\ua77e\ua77e\ua781\ua781\ua783\ua783\ua785\ua785\ua787\ua787\ua789"
+ "\ua789\ua78e\ua78e\ua790\ua790\ua793\ua793\ua795\ua795\ua7a3\ua7a3\ua7a5"
+ "\ua7a5\ua7a7\ua7a7\ua7a9\ua7a9\ua7ab\ua7ab\ua7fc\ua7fc\ufb02\ufb08\ufb15"
+ "\ufb19\uff43\uff5c\65\2\u02b2\u02c3\u02c8\u02d3\u02e2\u02e6\u02ee\u02ee"
+ "\u02f0\u02f0\u0376\u0376\u037c\u037c\u055b\u055b\u0642\u0642\u06e7\u06e8"
+ "\u07f6\u07f7\u07fc\u07fc\u081c\u081c\u0826\u0826\u082a\u082a\u0973\u0973"
+ "\u0e48\u0e48\u0ec8\u0ec8\u10fe\u10fe\u17d9\u17d9\u1845\u1845\u1aa9\u1aa9"
+ "\u1c7a\u1c7f\u1d2e\u1d6c\u1d7a\u1d7a\u1d9d\u1dc1\u2073\u2073\u2081\u2081"
+ "\u2092\u209e\u2c7e\u2c7f\u2d71\u2d71\u2e31\u2e31\u3007\u3007\u3033\u3037"
+ "\u303d\u303d\u309f\u30a0\u30fe\u3100\ua017\ua017\ua4fa\ua4ff\ua60e\ua60e"
+ "\ua681\ua681\ua719\ua721\ua772\ua772\ua78a\ua78a\ua7fa\ua7fb\ua9d1\ua9d1"
+ "\uaa72\uaa72\uaadf\uaadf\uaaf5\uaaf6\uff72\uff72\uffa0\uffa1\u0123\2\u00ac"
+ "\u00ac\u00bc\u00bc\u01bd\u01bd\u01c2\u01c5\u0296\u0296\u05d2\u05ec\u05f2"
+ "\u05f4\u0622\u0641\u0643\u064c\u0670\u0671\u0673\u06d5\u06d7\u06d7\u06f0"
+ "\u06f1\u06fc\u06fe\u0701\u0701\u0712\u0712\u0714\u0731\u074f\u07a7\u07b3"
+ "\u07b3\u07cc\u07ec\u0802\u0817\u0842\u085a\u08a2\u08a2\u08a4\u08ae\u0906"
+ "\u093b\u093f\u093f\u0952\u0952\u095a\u0963\u0974\u0979\u097b\u0981\u0987"
+ "\u098e\u0991\u0992\u0995\u09aa\u09ac\u09b2\u09b4\u09b4\u09b8\u09bb\u09bf"
+ "\u09bf\u09d0\u09d0\u09de\u09df\u09e1\u09e3\u09f2\u09f3\u0a07\u0a0c\u0a11"
+ "\u0a12\u0a15\u0a2a\u0a2c\u0a32\u0a34\u0a35\u0a37\u0a38\u0a3a\u0a3b\u0a5b"
+ "\u0a5e\u0a60\u0a60\u0a74\u0a76\u0a87\u0a8f\u0a91\u0a93\u0a95\u0aaa\u0aac"
+ "\u0ab2\u0ab4\u0ab5\u0ab7\u0abb\u0abf\u0abf\u0ad2\u0ad2\u0ae2\u0ae3\u0b07"
+ "\u0b0e\u0b11\u0b12\u0b15\u0b2a\u0b2c\u0b32\u0b34\u0b35\u0b37\u0b3b\u0b3f"
+ "\u0b3f\u0b5e\u0b5f\u0b61\u0b63\u0b73\u0b73\u0b85\u0b85\u0b87\u0b8c\u0b90"
+ "\u0b92\u0b94\u0b97\u0b9b\u0b9c\u0b9e\u0b9e\u0ba0\u0ba1\u0ba5\u0ba6\u0baa"
+ "\u0bac\u0bb0\u0bbb\u0bd2\u0bd2\u0c07\u0c0e\u0c10\u0c12\u0c14\u0c2a\u0c2c"
+ "\u0c35\u0c37\u0c3b\u0c3f\u0c3f\u0c5a\u0c5b\u0c62\u0c63\u0c87\u0c8e\u0c90"
+ "\u0c92\u0c94\u0caa\u0cac\u0cb5\u0cb7\u0cbb\u0cbf\u0cbf\u0ce0\u0ce0\u0ce2"
+ "\u0ce3\u0cf3\u0cf4\u0d07\u0d0e\u0d10\u0d12\u0d14\u0d3c\u0d3f\u0d3f\u0d50"
+ "\u0d50\u0d62\u0d63\u0d7c\u0d81\u0d87\u0d98\u0d9c\u0db3\u0db5\u0dbd\u0dbf"
+ "\u0dbf\u0dc2\u0dc8\u0e03\u0e32\u0e34\u0e35\u0e42\u0e47\u0e83\u0e84\u0e86"
+ "\u0e86\u0e89\u0e8a\u0e8c\u0e8c\u0e8f\u0e8f\u0e96\u0e99\u0e9b\u0ea1\u0ea3"
+ "\u0ea5\u0ea7\u0ea7\u0ea9\u0ea9\u0eac\u0ead\u0eaf\u0eb2\u0eb4\u0eb5\u0ebf"
+ "\u0ebf\u0ec2\u0ec6\u0ede\u0ee1\u0f02\u0f02\u0f42\u0f49\u0f4b\u0f6e\u0f8a"
+ "\u0f8e\u1002\u102c\u1041\u1041\u1052\u1057\u105c\u105f\u1063\u1063\u1067"
+ "\u1068\u1070\u1072\u1077\u1083\u1090\u1090\u10d2\u10fc\u10ff\u124a\u124c"
+ "\u124f\u1252\u1258\u125a\u125a\u125c\u125f\u1262\u128a\u128c\u128f\u1292"
+ "\u12b2\u12b4\u12b7\u12ba\u12c0\u12c2\u12c2\u12c4\u12c7\u12ca\u12d8\u12da"
+ "\u1312\u1314\u1317\u131a\u135c\u1382\u1391\u13a2\u13f6\u1403\u166e\u1671"
+ "\u1681\u1683\u169c\u16a2\u16ec\u1702\u170e\u1710\u1713\u1722\u1733\u1742"
+ "\u1753\u1762\u176e\u1770\u1772\u1782\u17b5\u17de\u17de\u1822\u1844\u1846"
+ "\u1879\u1882\u18aa\u18ac\u18ac\u18b2\u18f7\u1902\u191e\u1952\u196f\u1972"
+ "\u1976\u1982\u19ad\u19c3\u19c9\u1a02\u1a18\u1a22\u1a56\u1b07\u1b35\u1b47"
+ "\u1b4d\u1b85\u1ba2\u1bb0\u1bb1\u1bbc\u1be7\u1c02\u1c25\u1c4f\u1c51\u1c5c"
+ "\u1c79\u1ceb\u1cee\u1cf0\u1cf3\u1cf7\u1cf8\u2137\u213a\u2d32\u2d69\u2d82"
+ "\u2d98\u2da2\u2da8\u2daa\u2db0\u2db2\u2db8\u2dba\u2dc0\u2dc2\u2dc8\u2dca"
+ "\u2dd0\u2dd2\u2dd8\u2dda\u2de0\u3008\u3008\u303e\u303e\u3043\u3098\u30a1"
+ "\u30a1\u30a3\u30fc\u3101\u3101\u3107\u312f\u3133\u3190\u31a2\u31bc\u31f2"
+ "\u3201\u3402\u3402\u4db7\u4db7\u4e02\u4e02\u9fce\u9fce\ua002\ua016\ua018"
+ "\ua48e\ua4d2\ua4f9\ua502\ua60d\ua612\ua621\ua62c\ua62d\ua670\ua670\ua6a2"
+ "\ua6e7\ua7fd\ua803\ua805\ua807\ua809\ua80c\ua80e\ua824\ua842\ua875\ua884"
+ "\ua8b5\ua8f4\ua8f9\ua8fd\ua8fd\ua90c\ua927\ua932\ua948\ua962\ua97e\ua986"
+ "\ua9b4\uaa02\uaa2a\uaa42\uaa44\uaa46\uaa4d\uaa62\uaa71\uaa73\uaa78\uaa7c"
+ "\uaa7c\uaa82\uaab1\uaab3\uaab3\uaab7\uaab8\uaabb\uaabf\uaac2\uaac2\uaac4"
+ "\uaac4\uaadd\uaade\uaae2\uaaec\uaaf4\uaaf4\uab03\uab08\uab0b\uab10\uab13"
+ "\uab18\uab22\uab28\uab2a\uab30\uabc2\uabe4\uac02\uac02\ud7a5\ud7a5\ud7b2"
+ "\ud7c8\ud7cd\ud7fd\uf902\ufa6f\ufa72\ufadb\ufb1f\ufb1f\ufb21\ufb2a\ufb2c"
+ "\ufb38\ufb3a\ufb3e\ufb40\ufb40\ufb42\ufb43\ufb45\ufb46\ufb48\ufbb3\ufbd5"
+ "\ufd3f\ufd52\ufd91\ufd94\ufdc9\ufdf2\ufdfd\ufe72\ufe76\ufe78\ufefe\uff68"
+ "\uff71\uff73\uff9f\uffa2\uffc0\uffc4\uffc9\uffcc\uffd1\uffd4\uffd9\uffdc"
+ "\uffde\f\2\u01c7\u01c7\u01ca\u01ca\u01cd\u01cd\u01f4\u01f4\u1f8a\u1f91"
+ "\u1f9a\u1fa1\u1faa\u1fb1\u1fbe\u1fbe\u1fce\u1fce\u1ffe\u1ffe\u0242\2C"
+ "\\\u00c2\u00d8\u00da\u00e0\u0102\u0102\u0104\u0104\u0106\u0106\u0108\u0108"
+ "\u010a\u010a\u010c\u010c\u010e\u010e\u0110\u0110\u0112\u0112\u0114\u0114"
+ "\u0116\u0116\u0118\u0118\u011a\u011a\u011c\u011c\u011e\u011e\u0120\u0120"
+ "\u0122\u0122\u0124\u0124\u0126\u0126\u0128\u0128\u012a\u012a\u012c\u012c"
+ "\u012e\u012e\u0130\u0130\u0132\u0132\u0134\u0134\u0136\u0136\u0138\u0138"
+ "\u013b\u013b\u013d\u013d\u013f\u013f\u0141\u0141\u0143\u0143\u0145\u0145"
+ "\u0147\u0147\u0149\u0149\u014c\u014c\u014e\u014e\u0150\u0150\u0152\u0152"
+ "\u0154\u0154\u0156\u0156\u0158\u0158\u015a\u015a\u015c\u015c\u015e\u015e"
+ "\u0160\u0160\u0162\u0162\u0164\u0164\u0166\u0166\u0168\u0168\u016a\u016a"
+ "\u016c\u016c\u016e\u016e\u0170\u0170\u0172\u0172\u0174\u0174\u0176\u0176"
+ "\u0178\u0178\u017a\u017b\u017d\u017d\u017f\u017f\u0183\u0184\u0186\u0186"
+ "\u0188\u0189\u018b\u018d\u0190\u0193\u0195\u0196\u0198\u019a\u019e\u019f"
+ "\u01a1\u01a2\u01a4\u01a4\u01a6\u01a6\u01a8\u01a9\u01ab\u01ab\u01ae\u01ae"
+ "\u01b0\u01b1\u01b3\u01b5\u01b7\u01b7\u01b9\u01ba\u01be\u01be\u01c6\u01c6"
+ "\u01c9\u01c9\u01cc\u01cc\u01cf\u01cf\u01d1\u01d1\u01d3\u01d3\u01d5\u01d5"
+ "\u01d7\u01d7\u01d9\u01d9\u01db\u01db\u01dd\u01dd\u01e0\u01e0\u01e2\u01e2"
+ "\u01e4\u01e4\u01e6\u01e6\u01e8\u01e8\u01ea\u01ea\u01ec\u01ec\u01ee\u01ee"
+ "\u01f0\u01f0\u01f3\u01f3\u01f6\u01f6\u01f8\u01fa\u01fc\u01fc\u01fe\u01fe"
+ "\u0200\u0200\u0202\u0202\u0204\u0204\u0206\u0206\u0208\u0208\u020a\u020a"
+ "\u020c\u020c\u020e\u020e\u0210\u0210\u0212\u0212\u0214\u0214\u0216\u0216"
+ "\u0218\u0218\u021a\u021a\u021c\u021c\u021e\u021e\u0220\u0220\u0222\u0222"
+ "\u0224\u0224\u0226\u0226\u0228\u0228\u022a\u022a\u022c\u022c\u022e\u022e"
+ "\u0230\u0230\u0232\u0232\u0234\u0234\u023c\u023d\u023f\u0240\u0243\u0243"
+ "\u0245\u0248\u024a\u024a\u024c\u024c\u024e\u024e\u0250\u0250\u0372\u0372"
+ "\u0374\u0374\u0378\u0378\u0388\u0388\u038a\u038c\u038e\u038e\u0390\u0391"
+ "\u0393\u03a3\u03a5\u03ad\u03d1\u03d1\u03d4\u03d6\u03da\u03da\u03dc\u03dc"
+ "\u03de\u03de\u03e0\u03e0\u03e2\u03e2\u03e4\u03e4\u03e6\u03e6\u03e8\u03e8"
+ "\u03ea\u03ea\u03ec\u03ec\u03ee\u03ee\u03f0\u03f0\u03f6\u03f6\u03f9\u03f9"
+ "\u03fb\u03fc\u03ff\u0431\u0462\u0462\u0464\u0464\u0466\u0466\u0468\u0468"
+ "\u046a\u046a\u046c\u046c\u046e\u046e\u0470\u0470\u0472\u0472\u0474\u0474"
+ "\u0476\u0476\u0478\u0478\u047a\u047a\u047c\u047c\u047e\u047e\u0480\u0480"
+ "\u0482\u0482\u048c\u048c\u048e\u048e\u0490\u0490\u0492\u0492\u0494\u0494"
+ "\u0496\u0496\u0498\u0498\u049a\u049a\u049c\u049c\u049e\u049e\u04a0\u04a0"
+ "\u04a2\u04a2\u04a4\u04a4\u04a6\u04a6\u04a8\u04a8\u04aa\u04aa\u04ac\u04ac"
+ "\u04ae\u04ae\u04b0\u04b0\u04b2\u04b2\u04b4\u04b4\u04b6\u04b6\u04b8\u04b8"
+ "\u04ba\u04ba\u04bc\u04bc\u04be\u04be\u04c0\u04c0\u04c2\u04c3\u04c5\u04c5"
+ "\u04c7\u04c7\u04c9\u04c9\u04cb\u04cb\u04cd\u04cd\u04cf\u04cf\u04d2\u04d2"
+ "\u04d4\u04d4\u04d6\u04d6\u04d8\u04d8\u04da\u04da\u04dc\u04dc\u04de\u04de"
+ "\u04e0\u04e0\u04e2\u04e2\u04e4\u04e4\u04e6\u04e6\u04e8\u04e8\u04ea\u04ea"
+ "\u04ec\u04ec\u04ee\u04ee\u04f0\u04f0\u04f2\u04f2\u04f4\u04f4\u04f6\u04f6"
+ "\u04f8\u04f8\u04fa\u04fa\u04fc\u04fc\u04fe\u04fe\u0500\u0500\u0502\u0502"
+ "\u0504\u0504\u0506\u0506\u0508\u0508\u050a\u050a\u050c\u050c\u050e\u050e"
+ "\u0510\u0510\u0512\u0512\u0514\u0514\u0516\u0516\u0518\u0518\u051a\u051a"
+ "\u051c\u051c\u051e\u051e\u0520\u0520\u0522\u0522\u0524\u0524\u0526\u0526"
+ "\u0528\u0528\u0533\u0558\u10a2\u10c7\u10c9\u10c9\u10cf\u10cf\u1e02\u1e02"
+ "\u1e04\u1e04\u1e06\u1e06\u1e08\u1e08\u1e0a\u1e0a\u1e0c\u1e0c\u1e0e\u1e0e"
+ "\u1e10\u1e10\u1e12\u1e12\u1e14\u1e14\u1e16\u1e16\u1e18\u1e18\u1e1a\u1e1a"
+ "\u1e1c\u1e1c\u1e1e\u1e1e\u1e20\u1e20\u1e22\u1e22\u1e24\u1e24\u1e26\u1e26"
+ "\u1e28\u1e28\u1e2a\u1e2a\u1e2c\u1e2c\u1e2e\u1e2e\u1e30\u1e30\u1e32\u1e32"
+ "\u1e34\u1e34\u1e36\u1e36\u1e38\u1e38\u1e3a\u1e3a\u1e3c\u1e3c\u1e3e\u1e3e"
+ "\u1e40\u1e40\u1e42\u1e42\u1e44\u1e44\u1e46\u1e46\u1e48\u1e48\u1e4a\u1e4a"
+ "\u1e4c\u1e4c\u1e4e\u1e4e\u1e50\u1e50\u1e52\u1e52\u1e54\u1e54\u1e56\u1e56"
+ "\u1e58\u1e58\u1e5a\u1e5a\u1e5c\u1e5c\u1e5e\u1e5e\u1e60\u1e60\u1e62\u1e62"
+ "\u1e64\u1e64\u1e66\u1e66\u1e68\u1e68\u1e6a\u1e6a\u1e6c\u1e6c\u1e6e\u1e6e"
+ "\u1e70\u1e70\u1e72\u1e72\u1e74\u1e74\u1e76\u1e76\u1e78\u1e78\u1e7a\u1e7a"
+ "\u1e7c\u1e7c\u1e7e\u1e7e\u1e80\u1e80\u1e82\u1e82\u1e84\u1e84\u1e86\u1e86"
+ "\u1e88\u1e88\u1e8a\u1e8a\u1e8c\u1e8c\u1e8e\u1e8e\u1e90\u1e90\u1e92\u1e92"
+ "\u1e94\u1e94\u1e96\u1e96\u1ea0\u1ea0\u1ea2\u1ea2\u1ea4\u1ea4\u1ea6\u1ea6"
+ "\u1ea8\u1ea8\u1eaa\u1eaa\u1eac\u1eac\u1eae\u1eae\u1eb0\u1eb0\u1eb2\u1eb2"
+ "\u1eb4\u1eb4\u1eb6\u1eb6\u1eb8\u1eb8\u1eba\u1eba\u1ebc\u1ebc\u1ebe\u1ebe"
+ "\u1ec0\u1ec0\u1ec2\u1ec2\u1ec4\u1ec4\u1ec6\u1ec6\u1ec8\u1ec8\u1eca\u1eca"
+ "\u1ecc\u1ecc\u1ece\u1ece\u1ed0\u1ed0\u1ed2\u1ed2\u1ed4\u1ed4\u1ed6\u1ed6"
+ "\u1ed8\u1ed8\u1eda\u1eda\u1edc\u1edc\u1ede\u1ede\u1ee0\u1ee0\u1ee2\u1ee2"
+ "\u1ee4\u1ee4\u1ee6\u1ee6\u1ee8\u1ee8\u1eea\u1eea\u1eec\u1eec\u1eee\u1eee"
+ "\u1ef0\u1ef0\u1ef2\u1ef2\u1ef4\u1ef4\u1ef6\u1ef6\u1ef8\u1ef8\u1efa\u1efa"
+ "\u1efc\u1efc\u1efe\u1efe\u1f00\u1f00\u1f0a\u1f11\u1f1a\u1f1f\u1f2a\u1f31"
+ "\u1f3a\u1f41\u1f4a\u1f4f\u1f5b\u1f5b\u1f5d\u1f5d\u1f5f\u1f5f\u1f61\u1f61"
+ "\u1f6a\u1f71\u1fba\u1fbd\u1fca\u1fcd\u1fda\u1fdd\u1fea\u1fee\u1ffa\u1ffd"
+ "\u2104\u2104\u2109\u2109\u210d\u210f\u2112\u2114\u2117\u2117\u211b\u211f"
+ "\u2126\u2126\u2128\u2128\u212a\u212a\u212c\u212f\u2132\u2135\u2140\u2141"
+ "\u2147\u2147\u2185\u2185\u2c02\u2c30\u2c62\u2c62\u2c64\u2c66\u2c69\u2c69"
+ "\u2c6b\u2c6b\u2c6d\u2c6d\u2c6f\u2c72\u2c74\u2c74\u2c77\u2c77\u2c80\u2c82"
+ "\u2c84\u2c84\u2c86\u2c86\u2c88\u2c88\u2c8a\u2c8a\u2c8c\u2c8c\u2c8e\u2c8e"
+ "\u2c90\u2c90\u2c92\u2c92\u2c94\u2c94\u2c96\u2c96\u2c98\u2c98\u2c9a\u2c9a"
+ "\u2c9c\u2c9c\u2c9e\u2c9e\u2ca0\u2ca0\u2ca2\u2ca2\u2ca4\u2ca4\u2ca6\u2ca6"
+ "\u2ca8\u2ca8\u2caa\u2caa\u2cac\u2cac\u2cae\u2cae\u2cb0\u2cb0\u2cb2\u2cb2"
+ "\u2cb4\u2cb4\u2cb6\u2cb6\u2cb8\u2cb8\u2cba\u2cba\u2cbc\u2cbc\u2cbe\u2cbe"
+ "\u2cc0\u2cc0\u2cc2\u2cc2\u2cc4\u2cc4\u2cc6\u2cc6\u2cc8\u2cc8\u2cca\u2cca"
+ "\u2ccc\u2ccc\u2cce\u2cce\u2cd0\u2cd0\u2cd2\u2cd2\u2cd4\u2cd4\u2cd6\u2cd6"
+ "\u2cd8\u2cd8\u2cda\u2cda\u2cdc\u2cdc\u2cde\u2cde\u2ce0\u2ce0\u2ce2\u2ce2"
+ "\u2ce4\u2ce4\u2ced\u2ced\u2cef\u2cef\u2cf4\u2cf4\ua642\ua642\ua644\ua644"
+ "\ua646\ua646\ua648\ua648\ua64a\ua64a\ua64c\ua64c\ua64e\ua64e\ua650\ua650"
+ "\ua652\ua652\ua654\ua654\ua656\ua656\ua658\ua658\ua65a\ua65a\ua65c\ua65c"
+ "\ua65e\ua65e\ua660\ua660\ua662\ua662\ua664\ua664\ua666\ua666\ua668\ua668"
+ "\ua66a\ua66a\ua66c\ua66c\ua66e\ua66e\ua682\ua682\ua684\ua684\ua686\ua686"
+ "\ua688\ua688\ua68a\ua68a\ua68c\ua68c\ua68e\ua68e\ua690\ua690\ua692\ua692"
+ "\ua694\ua694\ua696\ua696\ua698\ua698\ua724\ua724\ua726\ua726\ua728\ua728"
+ "\ua72a\ua72a\ua72c\ua72c\ua72e\ua72e\ua730\ua730\ua734\ua734\ua736\ua736"
+ "\ua738\ua738\ua73a\ua73a\ua73c\ua73c\ua73e\ua73e\ua740\ua740\ua742\ua742"
+ "\ua744\ua744\ua746\ua746\ua748\ua748\ua74a\ua74a\ua74c\ua74c\ua74e\ua74e"
+ "\ua750\ua750\ua752\ua752\ua754\ua754\ua756\ua756\ua758\ua758\ua75a\ua75a"
+ "\ua75c\ua75c\ua75e\ua75e\ua760\ua760\ua762\ua762\ua764\ua764\ua766\ua766"
+ "\ua768\ua768\ua76a\ua76a\ua76c\ua76c\ua76e\ua76e\ua770\ua770\ua77b\ua77b"
+ "\ua77d\ua77d\ua77f\ua780\ua782\ua782\ua784\ua784\ua786\ua786\ua788\ua788"
+ "\ua78d\ua78d\ua78f\ua78f\ua792\ua792\ua794\ua794\ua7a2\ua7a2\ua7a4\ua7a4"
+ "\ua7a6\ua7a6\ua7a8\ua7a8\ua7aa\ua7aa\ua7ac\ua7ac\uff23\uff3c%\2\62;\u0662"
+ "\u066b\u06f2\u06fb\u07c2\u07cb\u0968\u0971\u09e8\u09f1\u0a68\u0a71\u0ae8"
+ "\u0af1\u0b68\u0b71\u0be8\u0bf1\u0c68\u0c71\u0ce8\u0cf1\u0d68\u0d71\u0e52"
+ "\u0e5b\u0ed2\u0edb\u0f22\u0f2b\u1042\u104b\u1092\u109b\u17e2\u17eb\u1812"
+ "\u181b\u1948\u1951\u19d2\u19db\u1a82\u1a8b\u1a92\u1a9b\u1b52\u1b5b\u1bb2"
+ "\u1bbb\u1c42\u1c4b\u1c52\u1c5b\ua622\ua62b\ua8d2\ua8db\ua902\ua90b\ua9d2"
+ "\ua9db\uaa52\uaa5b\uabf2\uabfb\uff12\uff1b\t\2\u16f0\u16f2\u2162\u2184"
+ "\u2187\u218a\u3009\u3009\u3023\u302b\u303a\u303c\ua6e8\ua6f1\5\2$$&&^"
+ "^\2\u0a82\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\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2"
+ "\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2\2\2\61\3\2\2\2"
+ "\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3\2\2\2\2=\3\2\2"
+ "\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2\2\2I\3\2\2\2\2"
+ "K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2U\3\2\2\2\2W\3"
+ "\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3\2\2\2\2c\3\2\2"
+ "\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2m\3\2\2\2\2o\3\2\2\2\2"
+ "q\3\2\2\2\2s\3\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3\2\2\2\2{\3\2\2\2\2}\3"
+ "\2\2\2\2\177\3\2\2\2\2\u0081\3\2\2\2\2\u0083\3\2\2\2\2\u0085\3\2\2\2\2"
+ "\u0087\3\2\2\2\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2\u008d\3\2\2\2\2\u008f"
+ "\3\2\2\2\2\u0091\3\2\2\2\2\u0093\3\2\2\2\2\u0095\3\2\2\2\2\u0097\3\2\2"
+ "\2\2\u0099\3\2\2\2\2\u009b\3\2\2\2\2\u009d\3\2\2\2\2\u009f\3\2\2\2\2\u00a1"
+ "\3\2\2\2\2\u00a3\3\2\2\2\2\u00a5\3\2\2\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2"
+ "\2\2\u00ab\3\2\2\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3"
+ "\3\2\2\2\2\u00b5\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bb\3\2\2"
+ "\2\2\u00bd\3\2\2\2\2\u00bf\3\2\2\2\2\u00c1\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5"
+ "\3\2\2\2\2\u00c7\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2"
+ "\2\2\u00cf\3\2\2\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7"
+ "\3\2\2\2\2\u00d9\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2"
+ "\2\2\u00e1\3\2\2\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9"
+ "\3\2\2\2\2\u00eb\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2"
+ "\2\2\u00f3\3\2\2\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9\3\2\2\2\2\u00fb"
+ "\3\2\2\2\2\u00fd\3\2\2\2\2\u00ff\3\2\2\2\2\u0101\3\2\2\2\2\u0103\3\2\2"
+ "\2\2\u0105\3\2\2\2\2\u0107\3\2\2\2\2\u0109\3\2\2\2\2\u010b\3\2\2\2\2\u010d"
+ "\3\2\2\2\2\u010f\3\2\2\2\2\u0111\3\2\2\2\2\u0113\3\2\2\2\2\u011b\3\2\2"
+ "\2\2\u011f\3\2\2\2\2\u0123\3\2\2\2\2\u0125\3\2\2\2\2\u0127\3\2\2\2\2\u0129"
+ "\3\2\2\2\2\u012b\3\2\2\2\2\u012d\3\2\2\2\2\u012f\3\2\2\2\2\u0139\3\2\2"
+ "\2\2\u013b\3\2\2\2\2\u013d\3\2\2\2\2\u013f\3\2\2\2\2\u0141\3\2\2\2\2\u0143"
+ "\3\2\2\2\2\u0145\3\2\2\2\3\u0147\3\2\2\2\3\u0149\3\2\2\2\3\u014b\3\2\2"
+ "\2\3\u014d\3\2\2\2\3\u014f\3\2\2\2\3\u0151\3\2\2\2\3\u0153\3\2\2\2\3\u0155"
+ "\3\2\2\2\3\u0157\3\2\2\2\3\u0159\3\2\2\2\3\u015b\3\2\2\2\3\u015d\3\2\2"
+ "\2\3\u015f\3\2\2\2\3\u0161\3\2\2\2\3\u0163\3\2\2\2\3\u0165\3\2\2\2\3\u0167"
+ "\3\2\2\2\3\u0169\3\2\2\2\3\u016b\3\2\2\2\3\u016d\3\2\2\2\3\u016f\3\2\2"
+ "\2\3\u0171\3\2\2\2\3\u0173\3\2\2\2\3\u0175\3\2\2\2\3\u0177\3\2\2\2\3\u0179"
+ "\3\2\2\2\3\u017b\3\2\2\2\3\u017d\3\2\2\2\3\u017f\3\2\2\2\3\u0181\3\2\2"
+ "\2\3\u0183\3\2\2\2\3\u0185\3\2\2\2\3\u0187\3\2\2\2\3\u0189\3\2\2\2\3\u018b"
+ "\3\2\2\2\3\u018d\3\2\2\2\3\u018f\3\2\2\2\3\u0191\3\2\2\2\3\u0193\3\2\2"
+ "\2\3\u0195\3\2\2\2\3\u0197\3\2\2\2\3\u0199\3\2\2\2\3\u019b\3\2\2\2\3\u019d"
+ "\3\2\2\2\3\u019f\3\2\2\2\3\u01a1\3\2\2\2\3\u01a3\3\2\2\2\3\u01a5\3\2\2"
+ "\2\3\u01a7\3\2\2\2\3\u01a9\3\2\2\2\3\u01ab\3\2\2\2\3\u01ad\3\2\2\2\3\u01af"
+ "\3\2\2\2\3\u01b1\3\2\2\2\3\u01b3\3\2\2\2\3\u01b5\3\2\2\2\3\u01b7\3\2\2"
+ "\2\3\u01b9\3\2\2\2\3\u01bb\3\2\2\2\3\u01bd\3\2\2\2\3\u01bf\3\2\2\2\3\u01c1"
+ "\3\2\2\2\3\u01c3\3\2\2\2\3\u01c5\3\2\2\2\3\u01c7\3\2\2\2\3\u01c9\3\2\2"
+ "\2\3\u01cb\3\2\2\2\3\u01cd\3\2\2\2\3\u01cf\3\2\2\2\3\u01d1\3\2\2\2\3\u01d3"
+ "\3\2\2\2\3\u01d5\3\2\2\2\3\u01d7\3\2\2\2\3\u01d9\3\2\2\2\3\u01db\3\2\2"
+ "\2\3\u01dd\3\2\2\2\3\u01df\3\2\2\2\3\u01e1\3\2\2\2\3\u01e3\3\2\2\2\3\u01e5"
+ "\3\2\2\2\3\u01e7\3\2\2\2\3\u01e9\3\2\2\2\3\u01eb\3\2\2\2\3\u01ed\3\2\2"
+ "\2\3\u01ef\3\2\2\2\3\u01f1\3\2\2\2\3\u01f3\3\2\2\2\3\u01f5\3\2\2\2\3\u01f7"
+ "\3\2\2\2\3\u01f9\3\2\2\2\3\u01fb\3\2\2\2\3\u01fd\3\2\2\2\3\u01ff\3\2\2"
+ "\2\3\u0201\3\2\2\2\3\u0203\3\2\2\2\3\u0205\3\2\2\2\3\u0207\3\2\2\2\3\u0209"
+ "\3\2\2\2\3\u020b\3\2\2\2\3\u020d\3\2\2\2\3\u020f\3\2\2\2\3\u0211\3\2\2"
+ "\2\3\u0213\3\2\2\2\3\u0215\3\2\2\2\3\u0217\3\2\2\2\3\u0219\3\2\2\2\3\u021b"
+ "\3\2\2\2\3\u021d\3\2\2\2\3\u021f\3\2\2\2\3\u0221\3\2\2\2\3\u0223\3\2\2"
+ "\2\3\u0225\3\2\2\2\3\u0227\3\2\2\2\3\u0229\3\2\2\2\3\u022b\3\2\2\2\3\u022d"
+ "\3\2\2\2\3\u022f\3\2\2\2\3\u0231\3\2\2\2\3\u0233\3\2\2\2\3\u0235\3\2\2"
+ "\2\3\u0237\3\2\2\2\4\u0239\3\2\2\2\4\u023b\3\2\2\2\4\u023d\3\2\2\2\4\u023f"
+ "\3\2\2\2\4\u0241\3\2\2\2\5\u0243\3\2\2\2\5\u0245\3\2\2\2\5\u0247\3\2\2"
+ "\2\5\u0249\3\2\2\2\5\u024b\3\2\2\2\5\u024d\3\2\2\2\5\u024f\3\2\2\2\6\u0251"
+ "\3\2\2\2\6\u0253\3\2\2\2\6\u0255\3\2\2\2\6\u0257\3\2\2\2\6\u0259\3\2\2"
+ "\2\6\u025b\3\2\2\2\6\u025d\3\2\2\2\6\u025f\3\2\2\2\6\u0261\3\2\2\2\6\u0263"
+ "\3\2\2\2\6\u0265\3\2\2\2\6\u0267\3\2\2\2\6\u0269\3\2\2\2\6\u026b\3\2\2"
+ "\2\6\u026d\3\2\2\2\6\u026f\3\2\2\2\6\u0271\3\2\2\2\6\u0273\3\2\2\2\6\u0275"
+ "\3\2\2\2\6\u0277\3\2\2\2\6\u0279\3\2\2\2\6\u027b\3\2\2\2\6\u027d\3\2\2"
+ "\2\6\u027f\3\2\2\2\6\u0281\3\2\2\2\6\u0283\3\2\2\2\6\u0285\3\2\2\2\6\u0287"
+ "\3\2\2\2\6\u0289\3\2\2\2\6\u028b\3\2\2\2\6\u028d\3\2\2\2\6\u028f\3\2\2"
+ "\2\6\u0291\3\2\2\2\6\u0293\3\2\2\2\6\u0295\3\2\2\2\6\u0297\3\2\2\2\6\u0299"
+ "\3\2\2\2\6\u029b\3\2\2\2\6\u029d\3\2\2\2\6\u029f\3\2\2\2\6\u02a1\3\2\2"
+ "\2\6\u02a3\3\2\2\2\6\u02a5\3\2\2\2\6\u02a7\3\2\2\2\6\u02a9\3\2\2\2\6\u02ab"
+ "\3\2\2\2\6\u02ad\3\2\2\2\6\u02af\3\2\2\2\6\u02b1\3\2\2\2\6\u02b3\3\2\2"
+ "\2\6\u02b5\3\2\2\2\6\u02b7\3\2\2\2\6\u02b9\3\2\2\2\6\u02bb\3\2\2\2\6\u02bd"
+ "\3\2\2\2\6\u02bf\3\2\2\2\6\u02c1\3\2\2\2\6\u02c3\3\2\2\2\6\u02c5\3\2\2"
+ "\2\6\u02c7\3\2\2\2\6\u02c9\3\2\2\2\6\u02cb\3\2\2\2\6\u02cd\3\2\2\2\6\u02cf"
+ "\3\2\2\2\6\u02d1\3\2\2\2\6\u02d3\3\2\2\2\6\u02d5\3\2\2\2\7\u02d7\3\2\2"
+ "\2\t\u02e2\3\2\2\2\13\u02f1\3\2\2\2\r\u02fc\3\2\2\2\17\u0303\3\2\2\2\21"
+ "\u0305\3\2\2\2\23\u0309\3\2\2\2\25\u030b\3\2\2\2\27\u030d\3\2\2\2\31\u0311"
+ "\3\2\2\2\33\u0313\3\2\2\2\35\u0317\3\2\2\2\37\u0319\3\2\2\2!\u031b\3\2"
+ "\2\2#\u031d\3\2\2\2%\u031f\3\2\2\2\'\u0321\3\2\2\2)\u0323\3\2\2\2+\u0325"
+ "\3\2\2\2-\u0327\3\2\2\2/\u032a\3\2\2\2\61\u032d\3\2\2\2\63\u0330\3\2\2"
+ "\2\65\u0333\3\2\2\2\67\u0335\3\2\2\29\u0337\3\2\2\2;\u0339\3\2\2\2=\u033b"
+ "\3\2\2\2?\u033e\3\2\2\2A\u0341\3\2\2\2C\u0344\3\2\2\2E\u0347\3\2\2\2G"
+ "\u034a\3\2\2\2I\u034d\3\2\2\2K\u0350\3\2\2\2M\u0353\3\2\2\2O\u0356\3\2"
+ "\2\2Q\u035a\3\2\2\2S\u035d\3\2\2\2U\u035f\3\2\2\2W\u0361\3\2\2\2Y\u0363"
+ "\3\2\2\2[\u0366\3\2\2\2]\u0368\3\2\2\2_\u036a\3\2\2\2a\u036d\3\2\2\2c"
+ "\u0370\3\2\2\2e\u0373\3\2\2\2g\u0377\3\2\2\2i\u037b\3\2\2\2k\u037e\3\2"
+ "\2\2m\u0382\3\2\2\2o\u0384\3\2\2\2q\u038e\3\2\2\2s\u039a\3\2\2\2u\u03a3"
+ "\3\2\2\2w\u03a9\3\2\2\2y\u03b1\3\2\2\2{\u03b8\3\2\2\2}\u03be\3\2\2\2\177"
+ "\u03c8\3\2\2\2\u0081\u03cc\3\2\2\2\u0083\u03d3\3\2\2\2\u0085\u03d7\3\2"
+ "\2\2\u0087\u03db\3\2\2\2\u0089\u03e5\3\2\2\2\u008b\u03f1\3\2\2\2\u008d"
+ "\u03f4\3\2\2\2\u008f\u03fe\3\2\2\2\u0091\u0403\3\2\2\2\u0093\u0408\3\2"
+ "\2\2\u0095\u040e\3\2\2\2\u0097\u0415\3\2\2\2\u0099\u041b\3\2\2\2\u009b"
+ "\u041e\3\2\2\2\u009d\u0423\3\2\2\2\u009f\u0428\3\2\2\2\u00a1\u042c\3\2"
+ "\2\2\u00a3\u0432\3\2\2\2\u00a5\u043a\3\2\2\2\u00a7\u043e\3\2\2\2\u00a9"
+ "\u0441\3\2\2\2\u00ab\u0447\3\2\2\2\u00ad\u044d\3\2\2\2\u00af\u0454\3\2"
+ "\2\2\u00b1\u045d\3\2\2\2\u00b3\u0463\3\2\2\2\u00b5\u0466\3\2\2\2\u00b7"
+ "\u0469\3\2\2\2\u00b9\u046c\3\2\2\2\u00bb\u0476\3\2\2\2\u00bd\u0480\3\2"
+ "\2\2\u00bf\u0484\3\2\2\2\u00c1\u048b\3\2\2\2\u00c3\u0495\3\2\2\2\u00c5"
+ "\u049a\3\2\2\2\u00c7\u049f\3\2\2\2\u00c9\u04a3\3\2\2\2\u00cb\u04a7\3\2"
+ "\2\2\u00cd\u04b1\3\2\2\2\u00cf\u04b8\3\2\2\2\u00d1\u04c2\3\2\2\2\u00d3"
+ "\u04cc\3\2\2\2\u00d5\u04d4\3\2\2\2\u00d7\u04db\3\2\2\2\u00d9\u04e3\3\2"
+ "\2\2\u00db\u04ed\3\2\2\2\u00dd\u04f6\3\2\2\2\u00df\u04fb\3\2\2\2\u00e1"
+ "\u0502\3\2\2\2\u00e3\u050d\3\2\2\2\u00e5\u0512\3\2\2\2\u00e7\u0518\3\2"
+ "\2\2\u00e9\u0520\3\2\2\2\u00eb\u0529\3\2\2\2\u00ed\u0530\3\2\2\2\u00ef"
+ "\u0536\3\2\2\2\u00f1\u053f\3\2\2\2\u00f3\u0547\3\2\2\2\u00f5\u0550\3\2"
+ "\2\2\u00f7\u0559\3\2\2\2\u00f9\u055f\3\2\2\2\u00fb\u0564\3\2\2\2\u00fd"
+ "\u056a\3\2\2\2\u00ff\u0573\3\2\2\2\u0101\u057a\3\2\2\2\u0103\u0583\3\2"
+ "\2\2\u0105\u058f\3\2\2\2\u0107\u0597\3\2\2\2\u0109\u059b\3\2\2\2\u010b"
+ "\u05a3\3\2\2\2\u010d\u05a7\3\2\2\2\u010f\u05c3\3\2\2\2\u0111\u061e\3\2"
+ "\2\2\u0113\u067d\3\2\2\2\u0115\u067f\3\2\2\2\u0117\u0681\3\2\2\2\u0119"
+ "\u0683\3\2\2\2\u011b\u0685\3\2\2\2\u011d\u068f\3\2\2\2\u011f\u0691\3\2"
+ "\2\2\u0121\u069b\3\2\2\2\u0123\u06a6\3\2\2\2\u0125\u06a8\3\2\2\2\u0127"
+ "\u06c0\3\2\2\2\u0129\u06c2\3\2\2\2\u012b\u06c5\3\2\2\2\u012d\u06c8\3\2"
+ "\2\2\u012f\u06cb\3\2\2\2\u0131\u06d4\3\2\2\2\u0133\u06d6\3\2\2\2\u0135"
+ "\u06dd\3\2\2\2\u0137\u06e6\3\2\2\2\u0139\u06e8\3\2\2\2\u013b\u06ea\3\2"
+ "\2\2\u013d\u06ec\3\2\2\2\u013f\u06ee\3\2\2\2\u0141\u06f0\3\2\2\2\u0143"
+ "\u06f2\3\2\2\2\u0145\u06f4\3\2\2\2\u0147\u06f6\3\2\2\2\u0149\u06fb\3\2"
+ "\2\2\u014b\u0700\3\2\2\2\u014d\u0705\3\2\2\2\u014f\u070a\3\2\2\2\u0151"
+ "\u070e\3\2\2\2\u0153\u0712\3\2\2\2\u0155\u0716\3\2\2\2\u0157\u071a\3\2"
+ "\2\2\u0159\u071e\3\2\2\2\u015b\u0722\3\2\2\2\u015d\u0726\3\2\2\2\u015f"
+ "\u072a\3\2\2\2\u0161\u072e\3\2\2\2\u0163\u0732\3\2\2\2\u0165\u0736\3\2"
+ "\2\2\u0167\u073a\3\2\2\2\u0169\u073e\3\2\2\2\u016b\u0742\3\2\2\2\u016d"
+ "\u0746\3\2\2\2\u016f\u074a\3\2\2\2\u0171\u074e\3\2\2\2\u0173\u0752\3\2"
+ "\2\2\u0175\u0756\3\2\2\2\u0177\u075a\3\2\2\2\u0179\u075e\3\2\2\2\u017b"
+ "\u0762\3\2\2\2\u017d\u0766\3\2\2\2\u017f\u076a\3\2\2\2\u0181\u076e\3\2"
+ "\2\2\u0183\u0772\3\2\2\2\u0185\u0776\3\2\2\2\u0187\u077a\3\2\2\2\u0189"
+ "\u077e\3\2\2\2\u018b\u0782\3\2\2\2\u018d\u0786\3\2\2\2\u018f\u078a\3\2"
+ "\2\2\u0191\u078e\3\2\2\2\u0193\u0792\3\2\2\2\u0195\u0796\3\2\2\2\u0197"
+ "\u079a\3\2\2\2\u0199\u079e\3\2\2\2\u019b\u07a2\3\2\2\2\u019d\u07a6\3\2"
+ "\2\2\u019f\u07aa\3\2\2\2\u01a1\u07ae\3\2\2\2\u01a3\u07b2\3\2\2\2\u01a5"
+ "\u07b6\3\2\2\2\u01a7\u07ba\3\2\2\2\u01a9\u07be\3\2\2\2\u01ab\u07c3\3\2"
+ "\2\2\u01ad\u07c8\3\2\2\2\u01af\u07cc\3\2\2\2\u01b1\u07d0\3\2\2\2\u01b3"
+ "\u07d4\3\2\2\2\u01b5\u07d8\3\2\2\2\u01b7\u07dc\3\2\2\2\u01b9\u07e0\3\2"
+ "\2\2\u01bb\u07e4\3\2\2\2\u01bd\u07e8\3\2\2\2\u01bf\u07ec\3\2\2\2\u01c1"
+ "\u07f0\3\2\2\2\u01c3\u07f4\3\2\2\2\u01c5\u07f8\3\2\2\2\u01c7\u07fc\3\2"
+ "\2\2\u01c9\u0800\3\2\2\2\u01cb\u0804\3\2\2\2\u01cd\u0808\3\2\2\2\u01cf"
+ "\u080c\3\2\2\2\u01d1\u0810\3\2\2\2\u01d3\u0814\3\2\2\2\u01d5\u0818\3\2"
+ "\2\2\u01d7\u081c\3\2\2\2\u01d9\u0820\3\2\2\2\u01db\u0824\3\2\2\2\u01dd"
+ "\u0828\3\2\2\2\u01df\u082c\3\2\2\2\u01e1\u0830\3\2\2\2\u01e3\u0834\3\2"
+ "\2\2\u01e5\u0838\3\2\2\2\u01e7\u083c\3\2\2\2\u01e9\u0840\3\2\2\2\u01eb"
+ "\u0844\3\2\2\2\u01ed\u0848\3\2\2\2\u01ef\u084c\3\2\2\2\u01f1\u0850\3\2"
+ "\2\2\u01f3\u0854\3\2\2\2\u01f5\u0858\3\2\2\2\u01f7\u085c\3\2\2\2\u01f9"
+ "\u0860\3\2\2\2\u01fb\u0864\3\2\2\2\u01fd\u0868\3\2\2\2\u01ff\u086c\3\2"
+ "\2\2\u0201\u0870\3\2\2\2\u0203\u0874\3\2\2\2\u0205\u0878\3\2\2\2\u0207"
+ "\u087c\3\2\2\2\u0209\u0880\3\2\2\2\u020b\u0884\3\2\2\2\u020d\u0888\3\2"
+ "\2\2\u020f\u088c\3\2\2\2\u0211\u0890\3\2\2\2\u0213\u0894\3\2\2\2\u0215"
+ "\u0898\3\2\2\2\u0217\u089c\3\2\2\2\u0219\u08a0\3\2\2\2\u021b\u08a4\3\2"
+ "\2\2\u021d\u08a8\3\2\2\2\u021f\u08ac\3\2\2\2\u0221\u08b0\3\2\2\2\u0223"
+ "\u08b4\3\2\2\2\u0225\u08b8\3\2\2\2\u0227\u08bc\3\2\2\2\u0229\u08c0\3\2"
+ "\2\2\u022b\u08c4\3\2\2\2\u022d\u08c8\3\2\2\2\u022f\u08cc\3\2\2\2\u0231"
+ "\u08d0\3\2\2\2\u0233\u08d6\3\2\2\2\u0235\u08da\3\2\2\2\u0237\u08de\3\2"
+ "\2\2\u0239\u08e2\3\2\2\2\u023b\u08e6\3\2\2\2\u023d\u08ee\3\2\2\2\u023f"
+ "\u08f3\3\2\2\2\u0241\u08f5\3\2\2\2\u0243\u08fb\3\2\2\2\u0245\u0904\3\2"
+ "\2\2\u0247\u0908\3\2\2\2\u0249\u0910\3\2\2\2\u024b\u0912\3\2\2\2\u024d"
+ "\u0915\3\2\2\2\u024f\u091a\3\2\2\2\u0251\u091e\3\2\2\2\u0253\u0923\3\2"
+ "\2\2\u0255\u0928\3\2\2\2\u0257\u092d\3\2\2\2\u0259\u0931\3\2\2\2\u025b"
+ "\u0935\3\2\2\2\u025d\u093a\3\2\2\2\u025f\u093e\3\2\2\2\u0261\u0942\3\2"
+ "\2\2\u0263\u0946\3\2\2\2\u0265\u094a\3\2\2\2\u0267\u094e\3\2\2\2\u0269"
+ "\u0952\3\2\2\2\u026b\u0956\3\2\2\2\u026d\u095a\3\2\2\2\u026f\u095e\3\2"
+ "\2\2\u0271\u0962\3\2\2\2\u0273\u0966\3\2\2\2\u0275\u096a\3\2\2\2\u0277"
+ "\u096e\3\2\2\2\u0279\u0972\3\2\2\2\u027b\u0976\3\2\2\2\u027d\u097a\3\2"
+ "\2\2\u027f\u097e\3\2\2\2\u0281\u0982\3\2\2\2\u0283\u0986\3\2\2\2\u0285"
+ "\u098a\3\2\2\2\u0287\u098e\3\2\2\2\u0289\u0992\3\2\2\2\u028b\u0996\3\2"
+ "\2\2\u028d\u099a\3\2\2\2\u028f\u099e\3\2\2\2\u0291\u09a2\3\2\2\2\u0293"
+ "\u09a6\3\2\2\2\u0295\u09aa\3\2\2\2\u0297\u09ae\3\2\2\2\u0299\u09b2\3\2"
+ "\2\2\u029b\u09b6\3\2\2\2\u029d\u09ba\3\2\2\2\u029f\u09be\3\2\2\2\u02a1"
+ "\u09c2\3\2\2\2\u02a3\u09c6\3\2\2\2\u02a5\u09ca\3\2\2\2\u02a7\u09ce\3\2"
+ "\2\2\u02a9\u09d2\3\2\2\2\u02ab\u09d4\3\2\2\2\u02ad\u09d8\3\2\2\2\u02af"
+ "\u09dc\3\2\2\2\u02b1\u09e0\3\2\2\2\u02b3\u09e4\3\2\2\2\u02b5\u09e8\3\2"
+ "\2\2\u02b7\u09ec\3\2\2\2\u02b9\u09f1\3\2\2\2\u02bb\u09f6\3\2\2\2\u02bd"
+ "\u09fa\3\2\2\2\u02bf\u09fe\3\2\2\2\u02c1\u0a02\3\2\2\2\u02c3\u0a06\3\2"
+ "\2\2\u02c5\u0a0a\3\2\2\2\u02c7\u0a0e\3\2\2\2\u02c9\u0a12\3\2\2\2\u02cb"
+ "\u0a16\3\2\2\2\u02cd\u0a1a\3\2\2\2\u02cf\u0a1e\3\2\2\2\u02d1\u0a24\3\2"
+ "\2\2\u02d3\u0a28\3\2\2\2\u02d5\u0a2c\3\2\2\2\u02d7\u02d8\7%\2\2\u02d8"
+ "\u02d9\7#\2\2\u02d9\u02dd\3\2\2\2\u02da\u02dc\n\2\2\2\u02db\u02da\3\2"
+ "\2\2\u02dc\u02df\3\2\2\2\u02dd\u02db\3\2\2\2\u02dd\u02de\3\2\2\2\u02de"
+ "\u02e0\3\2\2\2\u02df\u02dd\3\2\2\2\u02e0\u02e1\b\2\2\2\u02e1\b\3\2\2\2"
+ "\u02e2\u02e3\7\61\2\2\u02e3\u02e4\7,\2\2\u02e4\u02e9\3\2\2\2\u02e5\u02e8"
+ "\5\t\3\2\u02e6\u02e8\13\2\2\2\u02e7\u02e5\3\2\2\2\u02e7\u02e6\3\2\2\2"
+ "\u02e8\u02eb\3\2\2\2\u02e9\u02ea\3\2\2\2\u02e9\u02e7\3\2\2\2\u02ea\u02ec"
+ "\3\2\2\2\u02eb\u02e9\3\2\2\2\u02ec\u02ed\7,\2\2\u02ed\u02ee\7\61\2\2\u02ee"
+ "\u02ef\3\2\2\2\u02ef\u02f0\b\3\2\2\u02f0\n\3\2\2\2\u02f1\u02f2\7\61\2"
+ "\2\u02f2\u02f3\7\61\2\2\u02f3\u02f7\3\2\2\2\u02f4\u02f6\n\2\2\2\u02f5"
+ "\u02f4\3\2\2\2\u02f6\u02f9\3\2\2\2\u02f7\u02f5\3\2\2\2\u02f7\u02f8\3\2"
+ "\2\2\u02f8\u02fa\3\2\2\2\u02f9\u02f7\3\2\2\2\u02fa\u02fb\b\4\2\2\u02fb"
+ "\f\3\2\2\2\u02fc\u02fd\t\3\2\2\u02fd\u02fe\3\2\2\2\u02fe\u02ff\b\5\3\2"
+ "\u02ff\16\3\2\2\2\u0300\u0304\7\f\2\2\u0301\u0302\7\17\2\2\u0302\u0304"
+ "\7\f\2\2\u0303\u0300\3\2\2\2\u0303\u0301\3\2\2\2\u0304\20\3\2\2\2\u0305"
+ "\u0306\7\60\2\2\u0306\u0307\7\60\2\2\u0307\u0308\7\60\2\2\u0308\22\3\2"
+ "\2\2\u0309\u030a\7\60\2\2\u030a\24\3\2\2\2\u030b\u030c\7.\2\2\u030c\26"
+ "\3\2\2\2\u030d\u030e\7*\2\2\u030e\u030f\3\2\2\2\u030f\u0310\b\n\4\2\u0310"
+ "\30\3\2\2\2\u0311\u0312\7+\2\2\u0312\32\3\2\2\2\u0313\u0314\7]\2\2\u0314"
+ "\u0315\3\2\2\2\u0315\u0316\b\f\4\2\u0316\34\3\2\2\2\u0317\u0318\7_\2\2"
+ "\u0318\36\3\2\2\2\u0319\u031a\7}\2\2\u031a \3\2\2\2\u031b\u031c\7\177"
+ "\2\2\u031c\"\3\2\2\2\u031d\u031e\7,\2\2\u031e$\3\2\2\2\u031f\u0320\7\'"
+ "\2\2\u0320&\3\2\2\2\u0321\u0322\7\61\2\2\u0322(\3\2\2\2\u0323\u0324\7"
+ "-\2\2\u0324*\3\2\2\2\u0325\u0326\7/\2\2\u0326,\3\2\2\2\u0327\u0328\7-"
+ "\2\2\u0328\u0329\7-\2\2\u0329.\3\2\2\2\u032a\u032b\7/\2\2\u032b\u032c"
+ "\7/\2\2\u032c\60\3\2\2\2\u032d\u032e\7(\2\2\u032e\u032f\7(\2\2\u032f\62"
+ "\3\2\2\2\u0330\u0331\7~\2\2\u0331\u0332\7~\2\2\u0332\64\3\2\2\2\u0333"
+ "\u0334\7#\2\2\u0334\66\3\2\2\2\u0335\u0336\7<\2\2\u03368\3\2\2\2\u0337"
+ "\u0338\7=\2\2\u0338:\3\2\2\2\u0339\u033a\7?\2\2\u033a<\3\2\2\2\u033b\u033c"
+ "\7-\2\2\u033c\u033d\7?\2\2\u033d>\3\2\2\2\u033e\u033f\7/\2\2\u033f\u0340"
+ "\7?\2\2\u0340@\3\2\2\2\u0341\u0342\7,\2\2\u0342\u0343\7?\2\2\u0343B\3"
+ "\2\2\2\u0344\u0345\7\61\2\2\u0345\u0346\7?\2\2\u0346D\3\2\2\2\u0347\u0348"
+ "\7\'\2\2\u0348\u0349\7?\2\2\u0349F\3\2\2\2\u034a\u034b\7/\2\2\u034b\u034c"
+ "\7@\2\2\u034cH\3\2\2\2\u034d\u034e\7?\2\2\u034e\u034f\7@\2\2\u034fJ\3"
+ "\2\2\2\u0350\u0351\7\60\2\2\u0351\u0352\7\60\2\2\u0352L\3\2\2\2\u0353"
+ "\u0354\7<\2\2\u0354\u0355\7<\2\2\u0355N\3\2\2\2\u0356\u0357\7A\2\2\u0357"
+ "\u0358\7<\2\2\u0358\u0359\7<\2\2\u0359P\3\2\2\2\u035a\u035b\7=\2\2\u035b"
+ "\u035c\7=\2\2\u035cR\3\2\2\2\u035d\u035e\7%\2\2\u035eT\3\2\2\2\u035f\u0360"
+ "\7B\2\2\u0360V\3\2\2\2\u0361\u0362\7A\2\2\u0362X\3\2\2\2\u0363\u0364\7"
+ "A\2\2\u0364\u0365\7<\2\2\u0365Z\3\2\2\2\u0366\u0367\7>\2\2\u0367\\\3\2"
+ "\2\2\u0368\u0369\7@\2\2\u0369^\3\2\2\2\u036a\u036b\7>\2\2\u036b\u036c"
+ "\7?\2\2\u036c`\3\2\2\2\u036d\u036e\7@\2\2\u036e\u036f\7?\2\2\u036fb\3"
+ "\2\2\2\u0370\u0371\7#\2\2\u0371\u0372\7?\2\2\u0372d\3\2\2\2\u0373\u0374"
+ "\7#\2\2\u0374\u0375\7?\2\2\u0375\u0376\7?\2\2\u0376f\3\2\2\2\u0377\u0378"
+ "\7c\2\2\u0378\u0379\7u\2\2\u0379\u037a\7A\2\2\u037ah\3\2\2\2\u037b\u037c"
+ "\7?\2\2\u037c\u037d\7?\2\2\u037dj\3\2\2\2\u037e\u037f\7?\2\2\u037f\u0380"
+ "\7?\2\2\u0380\u0381\7?\2\2\u0381l\3\2\2\2\u0382\u0383\7)\2\2\u0383n\3"
+ "\2\2\2\u0384\u0385\7t\2\2\u0385\u0386\7g\2\2\u0386\u0387\7v\2\2\u0387"
+ "\u0388\7w\2\2\u0388\u0389\7t\2\2\u0389\u038a\7p\2\2\u038a\u038b\7B\2\2"
+ "\u038b\u038c\3\2\2\2\u038c\u038d\5\u0127\u0092\2\u038dp\3\2\2\2\u038e"
+ "\u038f\7e\2\2\u038f\u0390\7q\2\2\u0390\u0391\7p\2\2\u0391\u0392\7v\2\2"
+ "\u0392\u0393\7k\2\2\u0393\u0394\7p\2\2\u0394\u0395\7w\2\2\u0395\u0396"
+ "\7g\2\2\u0396\u0397\7B\2\2\u0397\u0398\3\2\2\2\u0398\u0399\5\u0127\u0092"
+ "\2\u0399r\3\2\2\2\u039a\u039b\7d\2\2\u039b\u039c\7t\2\2\u039c\u039d\7"
+ "g\2\2\u039d\u039e\7c\2\2\u039e\u039f\7m\2\2\u039f\u03a0\7B\2\2\u03a0\u03a1"
+ "\3\2\2\2\u03a1\u03a2\5\u0127\u0092\2\u03a2t\3\2\2\2\u03a3\u03a4\7B\2\2"
+ "\u03a4\u03a5\7h\2\2\u03a5\u03a6\7k\2\2\u03a6\u03a7\7n\2\2\u03a7\u03a8"
+ "\7g\2\2\u03a8v\3\2\2\2\u03a9\u03aa\7r\2\2\u03aa\u03ab\7c\2\2\u03ab\u03ac"
+ "\7e\2\2\u03ac\u03ad\7m\2\2\u03ad\u03ae\7c\2\2\u03ae\u03af\7i\2\2\u03af"
+ "\u03b0\7g\2\2\u03b0x\3\2\2\2\u03b1\u03b2\7k\2\2\u03b2\u03b3\7o\2\2\u03b3"
+ "\u03b4\7r\2\2\u03b4\u03b5\7q\2\2\u03b5\u03b6\7t\2\2\u03b6\u03b7\7v\2\2"
+ "\u03b7z\3\2\2\2\u03b8\u03b9\7e\2\2\u03b9\u03ba\7n\2\2\u03ba\u03bb\7c\2"
+ "\2\u03bb\u03bc\7u\2\2\u03bc\u03bd\7u\2\2\u03bd|\3\2\2\2\u03be\u03bf\7"
+ "k\2\2\u03bf\u03c0\7p\2\2\u03c0\u03c1\7v\2\2\u03c1\u03c2\7g\2\2\u03c2\u03c3"
+ "\7t\2\2\u03c3\u03c4\7h\2\2\u03c4\u03c5\7c\2\2\u03c5\u03c6\7e\2\2\u03c6"
+ "\u03c7\7g\2\2\u03c7~\3\2\2\2\u03c8\u03c9\7h\2\2\u03c9\u03ca\7w\2\2\u03ca"
+ "\u03cb\7p\2\2\u03cb\u0080\3\2\2\2\u03cc\u03cd\7q\2\2\u03cd\u03ce\7d\2"
+ "\2\u03ce\u03cf\7l\2\2\u03cf\u03d0\7g\2\2\u03d0\u03d1\7e\2\2\u03d1\u03d2"
+ "\7v\2\2\u03d2\u0082\3\2\2\2\u03d3\u03d4\7x\2\2\u03d4\u03d5\7c\2\2\u03d5"
+ "\u03d6\7n\2\2\u03d6\u0084\3\2\2\2\u03d7\u03d8\7x\2\2\u03d8\u03d9\7c\2"
+ "\2\u03d9\u03da\7t\2\2\u03da\u0086\3\2\2\2\u03db\u03dc\7v\2\2\u03dc\u03dd"
+ "\7{\2\2\u03dd\u03de\7r\2\2\u03de\u03df\7g\2\2\u03df\u03e0\7c\2\2\u03e0"
+ "\u03e1\7n\2\2\u03e1\u03e2\7k\2\2\u03e2\u03e3\7c\2\2\u03e3\u03e4\7u\2\2"
+ "\u03e4\u0088\3\2\2\2\u03e5\u03e6\7e\2\2\u03e6\u03e7\7q\2\2\u03e7\u03e8"
+ "\7p\2\2\u03e8\u03e9\7u\2\2\u03e9\u03ea\7v\2\2\u03ea\u03eb\7t\2\2\u03eb"
+ "\u03ec\7w\2\2\u03ec\u03ed\7e\2\2\u03ed\u03ee\7v\2\2\u03ee\u03ef\7q\2\2"
+ "\u03ef\u03f0\7t\2\2\u03f0\u008a\3\2\2\2\u03f1\u03f2\7d\2\2\u03f2\u03f3"
+ "\7{\2\2\u03f3\u008c\3\2\2\2\u03f4\u03f5\7e\2\2\u03f5\u03f6\7q\2\2\u03f6"
+ "\u03f7\7o\2\2\u03f7\u03f8\7r\2\2\u03f8\u03f9\7c\2\2\u03f9\u03fa\7p\2\2"
+ "\u03fa\u03fb\7k\2\2\u03fb\u03fc\7q\2\2\u03fc\u03fd\7p\2\2\u03fd\u008e"
+ "\3\2\2\2\u03fe\u03ff\7k\2\2\u03ff\u0400\7p\2\2\u0400\u0401\7k\2\2\u0401"
+ "\u0402\7v\2\2\u0402\u0090\3\2\2\2\u0403\u0404\7v\2\2\u0404\u0405\7j\2"
+ "\2\u0405\u0406\7k\2\2\u0406\u0407\7u\2\2\u0407\u0092\3\2\2\2\u0408\u0409"
+ "\7u\2\2\u0409\u040a\7w\2\2\u040a\u040b\7r\2\2\u040b\u040c\7g\2\2\u040c"
+ "\u040d\7t\2\2\u040d\u0094\3\2\2\2\u040e\u040f\7v\2\2\u040f\u0410\7{\2"
+ "\2\u0410\u0411\7r\2\2\u0411\u0412\7g\2\2\u0412\u0413\7q\2\2\u0413\u0414"
+ "\7h\2\2\u0414\u0096\3\2\2\2\u0415\u0416\7y\2\2\u0416\u0417\7j\2\2\u0417"
+ "\u0418\7g\2\2\u0418\u0419\7t\2\2\u0419\u041a\7g\2\2\u041a\u0098\3\2\2"
+ "\2\u041b\u041c\7k\2\2\u041c\u041d\7h\2\2\u041d\u009a\3\2\2\2\u041e\u041f"
+ "\7g\2\2\u041f\u0420\7n\2\2\u0420\u0421\7u\2\2\u0421\u0422\7g\2\2\u0422"
+ "\u009c\3\2\2\2\u0423\u0424\7y\2\2\u0424\u0425\7j\2\2\u0425\u0426\7g\2"
+ "\2\u0426\u0427\7p\2\2\u0427\u009e\3\2\2\2\u0428\u0429\7v\2\2\u0429\u042a"
+ "\7t\2\2\u042a\u042b\7{\2\2\u042b\u00a0\3\2\2\2\u042c\u042d\7e\2\2\u042d"
+ "\u042e\7c\2\2\u042e\u042f\7v\2\2\u042f\u0430\7e\2\2\u0430\u0431\7j\2\2"
+ "\u0431\u00a2\3\2\2\2\u0432\u0433\7h\2\2\u0433\u0434\7k\2\2\u0434\u0435"
+ "\7p\2\2\u0435\u0436\7c\2\2\u0436\u0437\7n\2\2\u0437\u0438\7n\2\2\u0438"
+ "\u0439\7{\2\2\u0439\u00a4\3\2\2\2\u043a\u043b\7h\2\2\u043b\u043c\7q\2"
+ "\2\u043c\u043d\7t\2\2\u043d\u00a6\3\2\2\2\u043e\u043f\7f\2\2\u043f\u0440"
+ "\7q\2\2\u0440\u00a8\3\2\2\2\u0441\u0442\7y\2\2\u0442\u0443\7j\2\2\u0443"
+ "\u0444\7k\2\2\u0444\u0445\7n\2\2\u0445\u0446\7g\2\2\u0446\u00aa\3\2\2"
+ "\2\u0447\u0448\7v\2\2\u0448\u0449\7j\2\2\u0449\u044a\7t\2\2\u044a\u044b"
+ "\7q\2\2\u044b\u044c\7y\2\2\u044c\u00ac\3\2\2\2\u044d\u044e\7t\2\2\u044e"
+ "\u044f\7g\2\2\u044f\u0450\7v\2\2\u0450\u0451\7w\2\2\u0451\u0452\7t\2\2"
+ "\u0452\u0453\7p\2\2\u0453\u00ae\3\2\2\2\u0454\u0455\7e\2\2\u0455\u0456"
+ "\7q\2\2\u0456\u0457\7p\2\2\u0457\u0458\7v\2\2\u0458\u0459\7k\2\2\u0459"
+ "\u045a\7p\2\2\u045a\u045b\7w\2\2\u045b\u045c\7g\2\2\u045c\u00b0\3\2\2"
+ "\2\u045d\u045e\7d\2\2\u045e\u045f\7t\2\2\u045f\u0460\7g\2\2\u0460\u0461"
+ "\7c\2\2\u0461\u0462\7m\2\2\u0462\u00b2\3\2\2\2\u0463\u0464\7c\2\2\u0464"
+ "\u0465\7u\2\2\u0465\u00b4\3\2\2\2\u0466\u0467\7k\2\2\u0467\u0468\7u\2"
+ "\2\u0468\u00b6\3\2\2\2\u0469\u046a\7k\2\2\u046a\u046b\7p\2\2\u046b\u00b8"
+ "\3\2\2\2\u046c\u046d\7#\2\2\u046d\u046e\7k\2\2\u046e\u046f\7u\2\2\u046f"
+ "\u0472\3\2\2\2\u0470\u0473\5\r\5\2\u0471\u0473\5\17\6\2\u0472\u0470\3"
+ "\2\2\2\u0472\u0471\3\2\2\2\u0473\u0474\3\2\2\2\u0474\u0472\3\2\2\2\u0474"
+ "\u0475\3\2\2\2\u0475\u00ba\3\2\2\2\u0476\u0477\7#\2\2\u0477\u0478\7k\2"
+ "\2\u0478\u0479\7p\2\2\u0479\u047c\3\2\2\2\u047a\u047d\5\r\5\2\u047b\u047d"
+ "\5\17\6\2\u047c\u047a\3\2\2\2\u047c\u047b\3\2\2\2\u047d\u047e\3\2\2\2"
+ "\u047e\u047c\3\2\2\2\u047e\u047f\3\2\2\2\u047f\u00bc\3\2\2\2\u0480\u0481"
+ "\7q\2\2\u0481\u0482\7w\2\2\u0482\u0483\7v\2\2\u0483\u00be\3\2\2\2\u0484"
+ "\u0485\7B\2\2\u0485\u0486\7h\2\2\u0486\u0487\7k\2\2\u0487\u0488\7g\2\2"
+ "\u0488\u0489\7n\2\2\u0489\u048a\7f\2\2\u048a\u00c0\3\2\2\2\u048b\u048c"
+ "\7B\2\2\u048c\u048d\7r\2\2\u048d\u048e\7t\2\2\u048e\u048f\7q\2\2\u048f"
+ "\u0490\7r\2\2\u0490\u0491\7g\2\2\u0491\u0492\7t\2\2\u0492\u0493\7v\2\2"
+ "\u0493\u0494\7{\2\2\u0494\u00c2\3\2\2\2\u0495\u0496\7B\2\2\u0496\u0497"
+ "\7i\2\2\u0497\u0498\7g\2\2\u0498\u0499\7v\2\2\u0499\u00c4\3\2\2\2\u049a"
+ "\u049b\7B\2\2\u049b\u049c\7u\2\2\u049c\u049d\7g\2\2\u049d\u049e\7v\2\2"
+ "\u049e\u00c6\3\2\2\2\u049f\u04a0\7i\2\2\u04a0\u04a1\7g\2\2\u04a1\u04a2"
+ "\7v\2\2\u04a2\u00c8\3\2\2\2\u04a3\u04a4\7u\2\2\u04a4\u04a5\7g\2\2\u04a5"
+ "\u04a6\7v\2\2\u04a6\u00ca\3\2\2\2\u04a7\u04a8\7B\2\2\u04a8\u04a9\7t\2"
+ "\2\u04a9\u04aa\7g\2\2\u04aa\u04ab\7e\2\2\u04ab\u04ac\7g\2\2\u04ac\u04ad"
+ "\7k\2\2\u04ad\u04ae\7x\2\2\u04ae\u04af\7g\2\2\u04af\u04b0\7t\2\2\u04b0"
+ "\u00cc\3\2\2\2\u04b1\u04b2\7B\2\2\u04b2\u04b3\7r\2\2\u04b3\u04b4\7c\2"
+ "\2\u04b4\u04b5\7t\2\2\u04b5\u04b6\7c\2\2\u04b6\u04b7\7o\2\2\u04b7\u00ce"
+ "\3\2\2\2\u04b8\u04b9\7B\2\2\u04b9\u04ba\7u\2\2\u04ba\u04bb\7g\2\2\u04bb"
+ "\u04bc\7v\2\2\u04bc\u04bd\7r\2\2\u04bd\u04be\7c\2\2\u04be\u04bf\7t\2\2"
+ "\u04bf\u04c0\7c\2\2\u04c0\u04c1\7o\2\2\u04c1\u00d0\3\2\2\2\u04c2\u04c3"
+ "\7B\2\2\u04c3\u04c4\7f\2\2\u04c4\u04c5\7g\2\2\u04c5\u04c6\7n\2\2\u04c6"
+ "\u04c7\7g\2\2\u04c7\u04c8\7i\2\2\u04c8\u04c9\7c\2\2\u04c9\u04ca\7v\2\2"
+ "\u04ca\u04cb\7g\2\2\u04cb\u00d2\3\2\2\2\u04cc\u04cd\7f\2\2\u04cd\u04ce"
+ "\7{\2\2\u04ce\u04cf\7p\2\2\u04cf\u04d0\7c\2\2\u04d0\u04d1\7o\2\2\u04d1"
+ "\u04d2\7k\2\2\u04d2\u04d3\7e\2\2\u04d3\u00d4\3\2\2\2\u04d4\u04d5\7r\2"
+ "\2\u04d5\u04d6\7w\2\2\u04d6\u04d7\7d\2\2\u04d7\u04d8\7n\2\2\u04d8\u04d9"
+ "\7k\2\2\u04d9\u04da\7e\2\2\u04da\u00d6\3\2\2\2\u04db\u04dc\7r\2\2\u04dc"
+ "\u04dd\7t\2\2\u04dd\u04de\7k\2\2\u04de\u04df\7x\2\2\u04df\u04e0\7c\2\2"
+ "\u04e0\u04e1\7v\2\2\u04e1\u04e2\7g\2\2\u04e2\u00d8\3\2\2\2\u04e3\u04e4"
+ "\7r\2\2\u04e4\u04e5\7t\2\2\u04e5\u04e6\7q\2\2\u04e6\u04e7\7v\2\2\u04e7"
+ "\u04e8\7g\2\2\u04e8\u04e9\7e\2\2\u04e9\u04ea\7v\2\2\u04ea\u04eb\7g\2\2"
+ "\u04eb\u04ec\7f\2\2\u04ec\u00da\3\2\2\2\u04ed\u04ee\7k\2\2\u04ee\u04ef"
+ "\7p\2\2\u04ef\u04f0\7v\2\2\u04f0\u04f1\7g\2\2\u04f1\u04f2\7t\2\2\u04f2"
+ "\u04f3\7p\2\2\u04f3\u04f4\7c\2\2\u04f4\u04f5\7n\2\2\u04f5\u00dc\3\2\2"
+ "\2\u04f6\u04f7\7g\2\2\u04f7\u04f8\7p\2\2\u04f8\u04f9\7w\2\2\u04f9\u04fa"
+ "\7o\2\2\u04fa\u00de\3\2\2\2\u04fb\u04fc\7u\2\2\u04fc\u04fd\7g\2\2\u04fd"
+ "\u04fe\7c\2\2\u04fe\u04ff\7n\2\2\u04ff\u0500\7g\2\2\u0500\u0501\7f\2\2"
+ "\u0501\u00e0\3\2\2\2\u0502\u0503\7c\2\2\u0503\u0504\7p\2\2\u0504\u0505"
+ "\7p\2\2\u0505\u0506\7q\2\2\u0506\u0507\7v\2\2\u0507\u0508\7c\2\2\u0508"
+ "\u0509\7v\2\2\u0509\u050a\7k\2\2\u050a\u050b\7q\2\2\u050b\u050c\7p\2\2"
+ "\u050c\u00e2\3\2\2\2\u050d\u050e\7f\2\2\u050e\u050f\7c\2\2\u050f\u0510"
+ "\7v\2\2\u0510\u0511\7c\2\2\u0511\u00e4\3\2\2\2\u0512\u0513\7k\2\2\u0513"
+ "\u0514\7p\2\2\u0514\u0515\7p\2\2\u0515\u0516\7g\2\2\u0516\u0517\7t\2\2"
+ "\u0517\u00e6\3\2\2\2\u0518\u0519\7v\2\2\u0519\u051a\7c\2\2\u051a\u051b"
+ "\7k\2\2\u051b\u051c\7n\2\2\u051c\u051d\7t\2\2\u051d\u051e\7g\2\2\u051e"
+ "\u051f\7e\2\2\u051f\u00e8\3\2\2\2\u0520\u0521\7q\2\2\u0521\u0522\7r\2"
+ "\2\u0522\u0523\7g\2\2\u0523\u0524\7t\2\2\u0524\u0525\7c\2\2\u0525\u0526"
+ "\7v\2\2\u0526\u0527\7q\2\2\u0527\u0528\7t\2\2\u0528\u00ea\3\2\2\2\u0529"
+ "\u052a\7k\2\2\u052a\u052b\7p\2\2\u052b\u052c\7n\2\2\u052c\u052d\7k\2\2"
+ "\u052d\u052e\7p\2\2\u052e\u052f\7g\2\2\u052f\u00ec\3\2\2\2\u0530\u0531"
+ "\7k\2\2\u0531\u0532\7p\2\2\u0532\u0533\7h\2\2\u0533\u0534\7k\2\2\u0534"
+ "\u0535\7z\2\2\u0535\u00ee\3\2\2\2\u0536\u0537\7g\2\2\u0537\u0538\7z\2"
+ "\2\u0538\u0539\7v\2\2\u0539\u053a\7g\2\2\u053a\u053b\7t\2\2\u053b\u053c"
+ "\7p\2\2\u053c\u053d\7c\2\2\u053d\u053e\7n\2\2\u053e\u00f0\3\2\2\2\u053f"
+ "\u0540\7u\2\2\u0540\u0541\7w\2\2\u0541\u0542\7u\2\2\u0542\u0543\7r\2\2"
+ "\u0543\u0544\7g\2\2\u0544\u0545\7p\2\2\u0545\u0546\7f\2\2\u0546\u00f2"
+ "\3\2\2\2\u0547\u0548\7q\2\2\u0548\u0549\7x\2\2\u0549\u054a\7g\2\2\u054a"
+ "\u054b\7t\2\2\u054b\u054c\7t\2\2\u054c\u054d\7k\2\2\u054d\u054e\7f\2\2"
+ "\u054e\u054f\7g\2\2\u054f\u00f4\3\2\2\2\u0550\u0551\7c\2\2\u0551\u0552"
+ "\7d\2\2\u0552\u0553\7u\2\2\u0553\u0554\7v\2\2\u0554\u0555\7t\2\2\u0555"
+ "\u0556\7c\2\2\u0556\u0557\7e\2\2\u0557\u0558\7v\2\2\u0558\u00f6\3\2\2"
+ "\2\u0559\u055a\7h\2\2\u055a\u055b\7k\2\2\u055b\u055c\7p\2\2\u055c\u055d"
+ "\7c\2\2\u055d\u055e\7n\2\2\u055e\u00f8\3\2\2\2\u055f\u0560\7q\2\2\u0560"
+ "\u0561\7r\2\2\u0561\u0562\7g\2\2\u0562\u0563\7p\2\2\u0563\u00fa\3\2\2"
+ "\2\u0564\u0565\7e\2\2\u0565\u0566\7q\2\2\u0566\u0567\7p\2\2\u0567\u0568"
+ "\7u\2\2\u0568\u0569\7v\2\2\u0569\u00fc\3\2\2\2\u056a\u056b\7n\2\2\u056b"
+ "\u056c\7c\2\2\u056c\u056d\7v\2\2\u056d\u056e\7g\2\2\u056e\u056f\7k\2\2"
+ "\u056f\u0570\7p\2\2\u0570\u0571\7k\2\2\u0571\u0572\7v\2\2\u0572\u00fe"
+ "\3\2\2\2\u0573\u0574\7x\2\2\u0574\u0575\7c\2\2\u0575\u0576\7t\2\2\u0576"
+ "\u0577\7c\2\2\u0577\u0578\7t\2\2\u0578\u0579\7i\2\2\u0579\u0100\3\2\2"
+ "\2\u057a\u057b\7p\2\2\u057b\u057c\7q\2\2\u057c\u057d\7k\2\2\u057d\u057e"
+ "\7p\2\2\u057e\u057f\7n\2\2\u057f\u0580\7k\2\2\u0580\u0581\7p\2\2\u0581"
+ "\u0582\7g\2\2\u0582\u0102\3\2\2\2\u0583\u0584\7e\2\2\u0584\u0585\7t\2"
+ "\2\u0585\u0586\7q\2\2\u0586\u0587\7u\2\2\u0587\u0588\7u\2\2\u0588\u0589"
+ "\7k\2\2\u0589\u058a\7p\2\2\u058a\u058b\7n\2\2\u058b\u058c\7k\2\2\u058c"
+ "\u058d\7p\2\2\u058d\u058e\7g\2\2\u058e\u0104\3\2\2\2\u058f\u0590\7t\2"
+ "\2\u0590\u0591\7g\2\2\u0591\u0592\7k\2\2\u0592\u0593\7h\2\2\u0593\u0594"
+ "\7k\2\2\u0594\u0595\7g\2\2\u0595\u0596\7f\2\2\u0596\u0106\3\2\2\2\u0597"
+ "\u0598\7$\2\2\u0598\u0599\3\2\2\2\u0599\u059a\b\u0082\5\2\u059a\u0108"
+ "\3\2\2\2\u059b\u059c\7$\2\2\u059c\u059d\7$\2\2\u059d\u059e\7$\2\2\u059e"
+ "\u059f\3\2\2\2\u059f\u05a0\b\u0083\6\2\u05a0\u010a\3\2\2\2\u05a1\u05a4"
+ "\5\u010d\u0085\2\u05a2\u05a4\5\u010f\u0086\2\u05a3\u05a1\3\2\2\2\u05a3"
+ "\u05a2\3\2\2\2\u05a4\u010c\3\2\2\2\u05a5\u05a8\5\u010f\u0086\2\u05a6\u05a8"
+ "\5\u0113\u0088\2\u05a7\u05a5\3\2\2\2\u05a7\u05a6\3\2\2\2\u05a8\u05a9\3"
+ "\2\2\2\u05a9\u05aa\t\4\2\2\u05aa\u010e\3\2\2\2\u05ab\u05af\5\u0117\u008a"
+ "\2\u05ac\u05ae\5\u0115\u0089\2\u05ad\u05ac\3\2\2\2\u05ae\u05b1\3\2\2\2"
+ "\u05af\u05ad\3\2\2\2\u05af\u05b0\3\2\2\2\u05b0\u05b4\3\2\2\2\u05b1\u05af"
+ "\3\2\2\2\u05b2\u05b4\7\62\2\2\u05b3\u05ab\3\2\2\2\u05b3\u05b2\3\2\2\2"
+ "\u05b3\u05b4\3\2\2\2\u05b4\u05b5\3\2\2\2\u05b5\u05c4\7\60\2\2\u05b6\u05bb"
+ "\5\u0117\u008a\2\u05b7\u05ba\5\u0115\u0089\2\u05b8\u05ba\7a\2\2\u05b9"
+ "\u05b7\3\2\2\2\u05b9\u05b8\3\2\2\2\u05ba\u05bd\3\2\2\2\u05bb\u05b9\3\2"
+ "\2\2\u05bb\u05bc\3\2\2\2\u05bc\u05be\3\2\2\2\u05bd\u05bb\3\2\2\2\u05be"
+ "\u05bf\5\u0115\u0089\2\u05bf\u05c1\3\2\2\2\u05c0\u05b6\3\2\2\2\u05c0\u05c1"
+ "\3\2\2\2\u05c1\u05c2\3\2\2\2\u05c2\u05c4\7\60\2\2\u05c3\u05b3\3\2\2\2"
+ "\u05c3\u05c0\3\2\2\2\u05c4\u0619\3\2\2\2\u05c5\u05c7\5\u0115\u0089\2\u05c6"
+ "\u05c5\3\2\2\2\u05c7\u05c8\3\2\2\2\u05c8\u05c6\3\2\2\2\u05c8\u05c9\3\2"
+ "\2\2\u05c9\u061a\3\2\2\2\u05ca\u05cd\5\u0115\u0089\2\u05cb\u05ce\5\u0115"
+ "\u0089\2\u05cc\u05ce\7a\2\2\u05cd\u05cb\3\2\2\2\u05cd\u05cc\3\2\2\2\u05ce"
+ "\u05cf\3\2\2\2\u05cf\u05cd\3\2\2\2\u05cf\u05d0\3\2\2\2\u05d0\u05d1\3\2"
+ "\2\2\u05d1\u05d2\5\u0115\u0089\2\u05d2\u061a\3\2\2\2\u05d3\u05d5\5\u0115"
+ "\u0089\2\u05d4\u05d3\3\2\2\2\u05d5\u05d6\3\2\2\2\u05d6\u05d4\3\2\2\2\u05d6"
+ "\u05d7\3\2\2\2\u05d7\u05d8\3\2\2\2\u05d8\u05da\t\5\2\2\u05d9\u05db\t\6"
+ "\2\2\u05da\u05d9\3\2\2\2\u05da\u05db\3\2\2\2\u05db\u05dd\3\2\2\2\u05dc"
+ "\u05de\5\u0115\u0089\2\u05dd\u05dc\3\2\2\2\u05de\u05df\3\2\2\2\u05df\u05dd"
+ "\3\2\2\2\u05df\u05e0\3\2\2\2\u05e0\u061a\3\2\2\2\u05e1\u05e3\5\u0115\u0089"
+ "\2\u05e2\u05e1\3\2\2\2\u05e3\u05e4\3\2\2\2\u05e4\u05e2\3\2\2\2\u05e4\u05e5"
+ "\3\2\2\2\u05e5\u05e6\3\2\2\2\u05e6\u05e8\t\5\2\2\u05e7\u05e9\t\6\2\2\u05e8"
+ "\u05e7\3\2\2\2\u05e8\u05e9\3\2\2\2\u05e9\u05ea\3\2\2\2\u05ea\u05ed\5\u0115"
+ "\u0089\2\u05eb\u05ee\5\u0115\u0089\2\u05ec\u05ee\7a\2\2\u05ed\u05eb\3"
+ "\2\2\2\u05ed\u05ec\3\2\2\2\u05ee\u05ef\3\2\2\2\u05ef\u05ed\3\2\2\2\u05ef"
+ "\u05f0\3\2\2\2\u05f0\u05f1\3\2\2\2\u05f1\u05f2\5\u0115\u0089\2\u05f2\u061a"
+ "\3\2\2\2\u05f3\u05f6\5\u0115\u0089\2\u05f4\u05f7\5\u0115\u0089\2\u05f5"
+ "\u05f7\7a\2\2\u05f6\u05f4\3\2\2\2\u05f6\u05f5\3\2\2\2\u05f7\u05f8\3\2"
+ "\2\2\u05f8\u05f6\3\2\2\2\u05f8\u05f9\3\2\2\2\u05f9\u05fa\3\2\2\2\u05fa"
+ "\u05fb\5\u0115\u0089\2\u05fb\u05fd\t\5\2\2\u05fc\u05fe\t\6\2\2\u05fd\u05fc"
+ "\3\2\2\2\u05fd\u05fe\3\2\2\2\u05fe\u0600\3\2\2\2\u05ff\u0601\5\u0115\u0089"
+ "\2\u0600\u05ff\3\2\2\2\u0601\u0602\3\2\2\2\u0602\u0600\3\2\2\2\u0602\u0603"
+ "\3\2\2\2\u0603\u061a\3\2\2\2\u0604\u0607\5\u0115\u0089\2\u0605\u0608\5"
+ "\u0115\u0089\2\u0606\u0608\7a\2\2\u0607\u0605\3\2\2\2\u0607\u0606\3\2"
+ "\2\2\u0608\u0609\3\2\2\2\u0609\u0607\3\2\2\2\u0609\u060a\3\2\2\2\u060a"
+ "\u060b\3\2\2\2\u060b\u060c\5\u0115\u0089\2\u060c\u060e\t\5\2\2\u060d\u060f"
+ "\t\6\2\2\u060e\u060d\3\2\2\2\u060e\u060f\3\2\2\2\u060f\u0610\3\2\2\2\u0610"
+ "\u0613\5\u0115\u0089\2\u0611\u0614\5\u0115\u0089\2\u0612\u0614\7a\2\2"
+ "\u0613\u0611\3\2\2\2\u0613\u0612\3\2\2\2\u0614\u0615\3\2\2\2\u0615\u0613"
+ "\3\2\2\2\u0615\u0616\3\2\2\2\u0616\u0617\3\2\2\2\u0617\u0618\5\u0115\u0089"
+ "\2\u0618\u061a\3\2\2\2\u0619\u05c6\3\2\2\2\u0619\u05ca\3\2\2\2\u0619\u05d4"
+ "\3\2\2\2\u0619\u05e2\3\2\2\2\u0619\u05f3\3\2\2\2\u0619\u0604\3\2\2\2\u061a"
+ "\u0110\3\2\2\2\u061b\u061f\5\u0113\u0088\2\u061c\u061f\5\u011b\u008c\2"
+ "\u061d\u061f\5\u011f\u008e\2\u061e\u061b\3\2\2\2\u061e\u061c\3\2\2\2\u061e"
+ "\u061d\3\2\2\2\u061f\u0620\3\2\2\2\u0620\u0621\7N\2\2\u0621\u0112\3\2"
+ "\2\2\u0622\u067e\7\62\2\2\u0623\u0627\5\u0117\u008a\2\u0624\u0626\5\u0115"
+ "\u0089\2\u0625\u0624\3\2\2\2\u0626\u0629\3\2\2\2\u0627\u0625\3\2\2\2\u0627"
+ "\u0628\3\2\2\2\u0628\u067e\3\2\2\2\u0629\u0627\3\2\2\2\u062a\u062d\5\u0117"
+ "\u008a\2\u062b\u062e\5\u0115\u0089\2\u062c\u062e\7a\2\2\u062d\u062b\3"
+ "\2\2\2\u062d\u062c\3\2\2\2\u062e\u062f\3\2\2\2\u062f\u062d\3\2\2\2\u062f"
+ "\u0630\3\2\2\2\u0630\u0631\3\2\2\2\u0631\u0632\5\u0115\u0089\2\u0632\u067e"
+ "\3\2\2\2\u0633\u0637\5\u0117\u008a\2\u0634\u0636\5\u0115\u0089\2\u0635"
+ "\u0634\3\2\2\2\u0636\u0639\3\2\2\2\u0637\u0635\3\2\2\2\u0637\u0638\3\2"
+ "\2\2\u0638\u063a\3\2\2\2\u0639\u0637\3\2\2\2\u063a\u063c\t\5\2\2\u063b"
+ "\u063d\t\6\2\2\u063c\u063b\3\2\2\2\u063c\u063d\3\2\2\2\u063d\u063f\3\2"
+ "\2\2\u063e\u0640\5\u0115\u0089\2\u063f\u063e\3\2\2\2\u0640\u0641\3\2\2"
+ "\2\u0641\u063f\3\2\2\2\u0641\u0642\3\2\2\2\u0642\u067e\3\2\2\2\u0643\u0647"
+ "\5\u0117\u008a\2\u0644\u0646\5\u0115\u0089\2\u0645\u0644\3\2\2\2\u0646"
+ "\u0649\3\2\2\2\u0647\u0645\3\2\2\2\u0647\u0648\3\2\2\2\u0648\u064a\3\2"
+ "\2\2\u0649\u0647\3\2\2\2\u064a\u064c\t\5\2\2\u064b\u064d\t\6\2\2\u064c"
+ "\u064b\3\2\2\2\u064c\u064d\3\2\2\2\u064d\u064e\3\2\2\2\u064e\u0651\5\u0115"
+ "\u0089\2\u064f\u0652\5\u0115\u0089\2\u0650\u0652\7a\2\2\u0651\u064f\3"
+ "\2\2\2\u0651\u0650\3\2\2\2\u0652\u0653\3\2\2\2\u0653\u0651\3\2\2\2\u0653"
+ "\u0654\3\2\2\2\u0654\u0655\3\2\2\2\u0655\u0656\5\u0115\u0089\2\u0656\u067e"
+ "\3\2\2\2\u0657\u065a\5\u0117\u008a\2\u0658\u065b\5\u0115\u0089\2\u0659"
+ "\u065b\7a\2\2\u065a\u0658\3\2\2\2\u065a\u0659\3\2\2\2\u065b\u065c\3\2"
+ "\2\2\u065c\u065a\3\2\2\2\u065c\u065d\3\2\2\2\u065d\u065e\3\2\2\2\u065e"
+ "\u065f\5\u0115\u0089\2\u065f\u0661\t\5\2\2\u0660\u0662\t\6\2\2\u0661\u0660"
+ "\3\2\2\2\u0661\u0662\3\2\2\2\u0662\u0664\3\2\2\2\u0663\u0665\5\u0115\u0089"
+ "\2\u0664\u0663\3\2\2\2\u0665\u0666\3\2\2\2\u0666\u0664\3\2\2\2\u0666\u0667"
+ "\3\2\2\2\u0667\u067e\3\2\2\2\u0668\u066b\5\u0117\u008a\2\u0669\u066c\5"
+ "\u0115\u0089\2\u066a\u066c\7a\2\2\u066b\u0669\3\2\2\2\u066b\u066a\3\2"
+ "\2\2\u066c\u066d\3\2\2\2\u066d\u066b\3\2\2\2\u066d\u066e\3\2\2\2\u066e"
+ "\u066f\3\2\2\2\u066f\u0670\5\u0115\u0089\2\u0670\u0672\t\5\2\2\u0671\u0673"
+ "\t\6\2\2\u0672\u0671\3\2\2\2\u0672\u0673\3\2\2\2\u0673\u0674\3\2\2\2\u0674"
+ "\u0677\5\u0115\u0089\2\u0675\u0678\5\u0115\u0089\2\u0676\u0678\7a\2\2"
+ "\u0677\u0675\3\2\2\2\u0677\u0676\3\2\2\2\u0678\u0679\3\2\2\2\u0679\u0677"
+ "\3\2\2\2\u0679\u067a\3\2\2\2\u067a\u067b\3\2\2\2\u067b\u067c\5\u0115\u0089"
+ "\2\u067c\u067e\3\2\2\2\u067d\u0622\3\2\2\2\u067d\u0623\3\2\2\2\u067d\u062a"
+ "\3\2\2\2\u067d\u0633\3\2\2\2\u067d\u0643\3\2\2\2\u067d\u0657\3\2\2\2\u067d"
+ "\u0668\3\2\2\2\u067e\u0114\3\2\2\2\u067f\u0680\5\u0143\u00a0\2\u0680\u0116"
+ "\3\2\2\2\u0681\u0682\5\u0119\u008b\2\u0682\u0118\3\2\2\2\u0683\u0684\t"
+ "\7\2\2\u0684\u011a\3\2\2\2\u0685\u0686\7\62\2\2\u0686\u0687\t\b\2\2\u0687"
+ "\u068c\5\u011d\u008d\2\u0688\u068b\5\u011d\u008d\2\u0689\u068b\7a\2\2"
+ "\u068a\u0688\3\2\2\2\u068a\u0689\3\2\2\2\u068b\u068e\3\2\2\2\u068c\u068a"
+ "\3\2\2\2\u068c\u068d\3\2\2\2\u068d\u011c\3\2\2\2\u068e\u068c\3\2\2\2\u068f"
+ "\u0690\t\t\2\2\u0690\u011e\3\2\2\2\u0691\u0692\7\62\2\2\u0692\u0693\t"
+ "\n\2\2\u0693\u0698\5\u0121\u008f\2\u0694\u0697\5\u0121\u008f\2\u0695\u0697"
+ "\7a\2\2\u0696\u0694\3\2\2\2\u0696\u0695\3\2\2\2\u0697\u069a\3\2\2\2\u0698"
+ "\u0696\3\2\2\2\u0698\u0699\3\2\2\2\u0699\u0120\3\2\2\2\u069a\u0698\3\2"
+ "\2\2\u069b\u069c\t\13\2\2\u069c\u0122\3\2\2\2\u069d\u069e\7v\2\2\u069e"
+ "\u069f\7t\2\2\u069f\u06a0\7w\2\2\u06a0\u06a7\7g\2\2\u06a1\u06a2\7h\2\2"
+ "\u06a2\u06a3\7c\2\2\u06a3\u06a4\7n\2\2\u06a4\u06a5\7u\2\2\u06a5\u06a7"
+ "\7g\2\2\u06a6\u069d\3\2\2\2\u06a6\u06a1\3\2\2\2\u06a7\u0124\3\2\2\2\u06a8"
+ "\u06a9\7p\2\2\u06a9\u06aa\7w\2\2\u06aa\u06ab\7n\2\2\u06ab\u06ac\7n\2\2"
+ "\u06ac\u0126\3\2\2\2\u06ad\u06b0\5\u0137\u009a\2\u06ae\u06b0\7a\2\2\u06af"
+ "\u06ad\3\2\2\2\u06af\u06ae\3\2\2\2\u06b0\u06b6\3\2\2\2\u06b1\u06b5\5\u0137"
+ "\u009a\2\u06b2\u06b5\7a\2\2\u06b3\u06b5\5\u0115\u0089\2\u06b4\u06b1\3"
+ "\2\2\2\u06b4\u06b2\3\2\2\2\u06b4\u06b3\3\2\2\2\u06b5\u06b8\3\2\2\2\u06b6"
+ "\u06b4\3\2\2\2\u06b6\u06b7\3\2\2\2\u06b7\u06c1\3\2\2\2\u06b8\u06b6\3\2"
+ "\2\2\u06b9\u06bb\7b\2\2\u06ba\u06bc\n\f\2\2\u06bb\u06ba\3\2\2\2\u06bc"
+ "\u06bd\3\2\2\2\u06bd\u06bb\3\2\2\2\u06bd\u06be\3\2\2\2\u06be\u06bf\3\2"
+ "\2\2\u06bf\u06c1\7b\2\2\u06c0\u06af\3\2\2\2\u06c0\u06b9\3\2\2\2\u06c1"
+ "\u0128\3\2\2\2\u06c2\u06c3\7B\2\2\u06c3\u06c4\5\u0127\u0092\2\u06c4\u012a"
+ "\3\2\2\2\u06c5\u06c6\5\u0127\u0092\2\u06c6\u06c7\7B\2\2\u06c7\u012c\3"
+ "\2\2\2\u06c8\u06c9\7&\2\2\u06c9\u06ca\5\u0127\u0092\2\u06ca\u012e\3\2"
+ "\2\2\u06cb\u06ce\7)\2\2\u06cc\u06cf\5\u0131\u0097\2\u06cd\u06cf\13\2\2"
+ "\2\u06ce\u06cc\3\2\2\2\u06ce\u06cd\3\2\2\2\u06cf\u06d0\3\2\2\2\u06d0\u06d1"
+ "\7)\2\2\u06d1\u0130\3\2\2\2\u06d2\u06d5\5\u0133\u0098\2\u06d3\u06d5\5"
+ "\u0135\u0099\2\u06d4\u06d2\3\2\2\2\u06d4\u06d3\3\2\2\2\u06d5\u0132\3\2"
+ "\2\2\u06d6\u06d7\7^\2\2\u06d7\u06d8\7w\2\2\u06d8\u06d9\5\u011d\u008d\2"
+ "\u06d9\u06da\5\u011d\u008d\2\u06da\u06db\5\u011d\u008d\2\u06db\u06dc\5"
+ "\u011d\u008d\2\u06dc\u0134\3\2\2\2\u06dd\u06de\7^\2\2\u06de\u06df\t\r"
+ "\2\2\u06df\u0136\3\2\2\2\u06e0\u06e7\5\u0139\u009b\2\u06e1\u06e7\5\u013b"
+ "\u009c\2\u06e2\u06e7\5\u013d\u009d\2\u06e3\u06e7\5\u013f\u009e\2\u06e4"
+ "\u06e7\5\u0141\u009f\2\u06e5\u06e7\5\u0145\u00a1\2\u06e6\u06e0\3\2\2\2"
+ "\u06e6\u06e1\3\2\2\2\u06e6\u06e2\3\2\2\2\u06e6\u06e3\3\2\2\2\u06e6\u06e4"
+ "\3\2\2\2\u06e6\u06e5\3\2\2\2\u06e7\u0138\3\2\2\2\u06e8\u06e9\t\16\2\2"
+ "\u06e9\u013a\3\2\2\2\u06ea\u06eb\t\17\2\2\u06eb\u013c\3\2\2\2\u06ec\u06ed"
+ "\t\20\2\2\u06ed\u013e\3\2\2\2\u06ee\u06ef\t\21\2\2\u06ef\u0140\3\2\2\2"
+ "\u06f0\u06f1\t\22\2\2\u06f1\u0142\3\2\2\2\u06f2\u06f3\t\23\2\2\u06f3\u0144"
+ "\3\2\2\2\u06f4\u06f5\t\24\2\2\u06f5\u0146\3\2\2\2\u06f6\u06f7\7+\2\2\u06f7"
+ "\u06f8\3\2\2\2\u06f8\u06f9\b\u00a2\7\2\u06f9\u06fa\b\u00a2\b\2\u06fa\u0148"
+ "\3\2\2\2\u06fb\u06fc\7_\2\2\u06fc\u06fd\3\2\2\2\u06fd\u06fe\b\u00a3\7"
+ "\2\u06fe\u06ff\b\u00a3\t\2\u06ff\u014a\3\2\2\2\u0700\u0701\5\27\n\2\u0701"
+ "\u0702\3\2\2\2\u0702\u0703\b\u00a4\4\2\u0703\u0704\b\u00a4\n\2\u0704\u014c"
+ "\3\2\2\2\u0705\u0706\5\33\f\2\u0706\u0707\3\2\2\2\u0707\u0708\b\u00a5"
+ "\4\2\u0708\u0709\b\u00a5\13\2\u0709\u014e\3\2\2\2\u070a\u070b\5\37\16"
+ "\2\u070b\u070c\3\2\2\2\u070c\u070d\b\u00a6\f\2\u070d\u0150\3\2\2\2\u070e"
+ "\u070f\5!\17\2\u070f\u0710\3\2\2\2\u0710\u0711\b\u00a7\r\2\u0711\u0152"
+ "\3\2\2\2\u0712\u0713\5\23\b\2\u0713\u0714\3\2\2\2\u0714\u0715\b\u00a8"
+ "\16\2\u0715\u0154\3\2\2\2\u0716\u0717\5\25\t\2\u0717\u0718\3\2\2\2\u0718"
+ "\u0719\b\u00a9\17\2\u0719\u0156\3\2\2\2\u071a\u071b\5#\20\2\u071b\u071c"
+ "\3\2\2\2\u071c\u071d\b\u00aa\20\2\u071d\u0158\3\2\2\2\u071e\u071f\5%\21"
+ "\2\u071f\u0720\3\2\2\2\u0720\u0721\b\u00ab\21\2\u0721\u015a\3\2\2\2\u0722"
+ "\u0723\5\'\22\2\u0723\u0724\3\2\2\2\u0724\u0725\b\u00ac\22\2\u0725\u015c"
+ "\3\2\2\2\u0726\u0727\5)\23\2\u0727\u0728\3\2\2\2\u0728\u0729\b\u00ad\23"
+ "\2\u0729\u015e\3\2\2\2\u072a\u072b\5+\24\2\u072b\u072c\3\2\2\2\u072c\u072d"
+ "\b\u00ae\24\2\u072d\u0160\3\2\2\2\u072e\u072f\5-\25\2\u072f\u0730\3\2"
+ "\2\2\u0730\u0731\b\u00af\25\2\u0731\u0162\3\2\2\2\u0732\u0733\5/\26\2"
+ "\u0733\u0734\3\2\2\2\u0734\u0735\b\u00b0\26\2\u0735\u0164\3\2\2\2\u0736"
+ "\u0737\5\61\27\2\u0737\u0738\3\2\2\2\u0738\u0739\b\u00b1\27\2\u0739\u0166"
+ "\3\2\2\2\u073a\u073b\5\63\30\2\u073b\u073c\3\2\2\2\u073c\u073d\b\u00b2"
+ "\30\2\u073d\u0168\3\2\2\2\u073e\u073f\5\65\31\2\u073f\u0740\3\2\2\2\u0740"
+ "\u0741\b\u00b3\31\2\u0741\u016a\3\2\2\2\u0742\u0743\5\67\32\2\u0743\u0744"
+ "\3\2\2\2\u0744\u0745\b\u00b4\32\2\u0745\u016c\3\2\2\2\u0746\u0747\59\33"
+ "\2\u0747\u0748\3\2\2\2\u0748\u0749\b\u00b5\33\2\u0749\u016e\3\2\2\2\u074a"
+ "\u074b\5;\34\2\u074b\u074c\3\2\2\2\u074c\u074d\b\u00b6\34\2\u074d\u0170"
+ "\3\2\2\2\u074e\u074f\5=\35\2\u074f\u0750\3\2\2\2\u0750\u0751\b\u00b7\35"
+ "\2\u0751\u0172\3\2\2\2\u0752\u0753\5?\36\2\u0753\u0754\3\2\2\2\u0754\u0755"
+ "\b\u00b8\36\2\u0755\u0174\3\2\2\2\u0756\u0757\5A\37\2\u0757\u0758\3\2"
+ "\2\2\u0758\u0759\b\u00b9\37\2\u0759\u0176\3\2\2\2\u075a\u075b\5C \2\u075b"
+ "\u075c\3\2\2\2\u075c\u075d\b\u00ba \2\u075d\u0178\3\2\2\2\u075e\u075f"
+ "\5E!\2\u075f\u0760\3\2\2\2\u0760\u0761\b\u00bb!\2\u0761\u017a\3\2\2\2"
+ "\u0762\u0763\5G\"\2\u0763\u0764\3\2\2\2\u0764\u0765\b\u00bc\"\2\u0765"
+ "\u017c\3\2\2\2\u0766\u0767\5I#\2\u0767\u0768\3\2\2\2\u0768\u0769\b\u00bd"
+ "#\2\u0769\u017e\3\2\2\2\u076a\u076b\5K$\2\u076b\u076c\3\2\2\2\u076c\u076d"
+ "\b\u00be$\2\u076d\u0180\3\2\2\2\u076e\u076f\5\21\7\2\u076f\u0770\3\2\2"
+ "\2\u0770\u0771\b\u00bf%\2\u0771\u0182\3\2\2\2\u0772\u0773\5M%\2\u0773"
+ "\u0774\3\2\2\2\u0774\u0775\b\u00c0&\2\u0775\u0184\3\2\2\2\u0776\u0777"
+ "\5O&\2\u0777\u0778\3\2\2\2\u0778\u0779\b\u00c1\'\2\u0779\u0186\3\2\2\2"
+ "\u077a\u077b\5Q\'\2\u077b\u077c\3\2\2\2\u077c\u077d\b\u00c2(\2\u077d\u0188"
+ "\3\2\2\2\u077e\u077f\5S(\2\u077f\u0780\3\2\2\2\u0780\u0781\b\u00c3)\2"
+ "\u0781\u018a\3\2\2\2\u0782\u0783\5U)\2\u0783\u0784\3\2\2\2\u0784\u0785"
+ "\b\u00c4*\2\u0785\u018c\3\2\2\2\u0786\u0787\5W*\2\u0787\u0788\3\2\2\2"
+ "\u0788\u0789\b\u00c5+\2\u0789\u018e\3\2\2\2\u078a\u078b\5Y+\2\u078b\u078c"
+ "\3\2\2\2\u078c\u078d\b\u00c6,\2\u078d\u0190\3\2\2\2\u078e\u078f\5[,\2"
+ "\u078f\u0790\3\2\2\2\u0790\u0791\b\u00c7-\2\u0791\u0192\3\2\2\2\u0792"
+ "\u0793\5]-\2\u0793\u0794\3\2\2\2\u0794\u0795\b\u00c8.\2\u0795\u0194\3"
+ "\2\2\2\u0796\u0797\5_.\2\u0797\u0798\3\2\2\2\u0798\u0799\b\u00c9/\2\u0799"
+ "\u0196\3\2\2\2\u079a\u079b\5a/\2\u079b\u079c\3\2\2\2\u079c\u079d\b\u00ca"
+ "\60\2\u079d\u0198\3\2\2\2\u079e\u079f\5c\60\2\u079f\u07a0\3\2\2\2\u07a0"
+ "\u07a1\b\u00cb\61\2\u07a1\u019a\3\2\2\2\u07a2\u07a3\5e\61\2\u07a3\u07a4"
+ "\3\2\2\2\u07a4\u07a5\b\u00cc\62\2\u07a5\u019c\3\2\2\2\u07a6\u07a7\5\u00b9"
+ "[\2\u07a7\u07a8\3\2\2\2\u07a8\u07a9\b\u00cd\63\2\u07a9\u019e\3\2\2\2\u07aa"
+ "\u07ab\5\u00bb\\\2\u07ab\u07ac\3\2\2\2\u07ac\u07ad\b\u00ce\64\2\u07ad"
+ "\u01a0\3\2\2\2\u07ae\u07af\5g\62\2\u07af\u07b0\3\2\2\2\u07b0\u07b1\b\u00cf"
+ "\65\2\u07b1\u01a2\3\2\2\2\u07b2\u07b3\5i\63\2\u07b3\u07b4\3\2\2\2\u07b4"
+ "\u07b5\b\u00d0\66\2\u07b5\u01a4\3\2\2\2\u07b6\u07b7\5k\64\2\u07b7\u07b8"
+ "\3\2\2\2\u07b8\u07b9\b\u00d1\67\2\u07b9\u01a6\3\2\2\2\u07ba\u07bb\5m\65"
+ "\2\u07bb\u07bc\3\2\2\2\u07bc\u07bd\b\u00d28\2\u07bd\u01a8\3\2\2\2\u07be"
+ "\u07bf\5\u0107\u0082\2\u07bf\u07c0\3\2\2\2\u07c0\u07c1\b\u00d3\5\2\u07c1"
+ "\u07c2\b\u00d39\2\u07c2\u01aa\3\2\2\2\u07c3\u07c4\5\u0109\u0083\2\u07c4"
+ "\u07c5\3\2\2\2\u07c5\u07c6\b\u00d4\6\2\u07c6\u07c7\b\u00d4:\2\u07c7\u01ac"
+ "\3\2\2\2\u07c8\u07c9\5\u0083@\2\u07c9\u07ca\3\2\2\2\u07ca\u07cb\b\u00d5"
+ ";\2\u07cb\u01ae\3\2\2\2\u07cc\u07cd\5\u0085A\2\u07cd\u07ce\3\2\2\2\u07ce"
+ "\u07cf\b\u00d6<\2\u07cf\u01b0\3\2\2\2\u07d0\u07d1\5\u0081?\2\u07d1\u07d2"
+ "\3\2\2\2\u07d2\u07d3\b\u00d7=\2\u07d3\u01b2\3\2\2\2\u07d4\u07d5\5\u0093"
+ "H\2\u07d5\u07d6\3\2\2\2\u07d6\u07d7\b\u00d8>\2\u07d7\u01b4\3\2\2\2\u07d8"
+ "\u07d9\5\u00b7Z\2\u07d9\u07da\3\2\2\2\u07da\u07db\b\u00d9?\2\u07db\u01b6"
+ "\3\2\2\2\u07dc\u07dd\5\u00bd]\2\u07dd\u07de\3\2\2\2\u07de\u07df\b\u00da"
+ "@";
private static final String _serializedATNSegment1 =
"\2\u07df\u01b8\3\2\2\2\u07e0\u07e1\5\u00bf^\2\u07e1\u07e2\3\2\2\2\u07e2"
+ "\u07e3\b\u00dbA\2\u07e3\u01ba\3\2\2\2\u07e4\u07e5\5u9\2\u07e5\u07e6\3"
+ "\2\2\2\u07e6\u07e7\b\u00dcB\2\u07e7\u01bc\3\2\2\2\u07e8\u07e9\5\u00c1"
+ "_\2\u07e9\u07ea\3\2\2\2\u07ea\u07eb\b\u00ddC\2\u07eb\u01be\3\2\2\2\u07ec"
+ "\u07ed\5\u00c3`\2\u07ed\u07ee\3\2\2\2\u07ee\u07ef\b\u00deD\2\u07ef\u01c0"
+ "\3\2\2\2\u07f0\u07f1\5\u00c5a\2\u07f1\u07f2\3\2\2\2\u07f2\u07f3\b\u00df"
+ "E\2\u07f3\u01c2\3\2\2\2\u07f4\u07f5\5\u00cbd\2\u07f5\u07f6\3\2\2\2\u07f6"
+ "\u07f7\b\u00e0F\2\u07f7\u01c4\3\2\2\2\u07f8\u07f9\5\u00cde\2\u07f9\u07fa"
+ "\3\2\2\2\u07fa\u07fb\b\u00e1G\2\u07fb\u01c6\3\2\2\2\u07fc\u07fd\5\u00cf"
+ "f\2\u07fd\u07fe\3\2\2\2\u07fe\u07ff\b\u00e2H\2\u07ff\u01c8\3\2\2\2\u0800"
+ "\u0801\5\u00d1g\2\u0801\u0802\3\2\2\2\u0802\u0803\b\u00e3I\2\u0803\u01ca"
+ "\3\2\2\2\u0804\u0805\5\u00abT\2\u0805\u0806\3\2\2\2\u0806\u0807\b\u00e4"
+ "J\2\u0807\u01cc\3\2\2\2\u0808\u0809\5\u00adU\2\u0809\u080a\3\2\2\2\u080a"
+ "\u080b\b\u00e5K\2\u080b\u01ce\3\2\2\2\u080c\u080d\5\u00afV\2\u080d\u080e"
+ "\3\2\2\2\u080e\u080f\b\u00e6L\2\u080f\u01d0\3\2\2\2\u0810\u0811\5\u00b1"
+ "W\2\u0811\u0812\3\2\2\2\u0812\u0813\b\u00e7M\2\u0813\u01d2\3\2\2\2\u0814"
+ "\u0815\5o\66\2\u0815\u0816\3\2\2\2\u0816\u0817\b\u00e8N\2\u0817\u01d4"
+ "\3\2\2\2\u0818\u0819\5q\67\2\u0819\u081a\3\2\2\2\u081a\u081b\b\u00e9O"
+ "\2\u081b\u01d6\3\2\2\2\u081c\u081d\5s8\2\u081d\u081e\3\2\2\2\u081e\u081f"
+ "\b\u00eaP\2\u081f\u01d8\3\2\2\2\u0820\u0821\5\u0099K\2\u0821\u0822\3\2"
+ "\2\2\u0822\u0823\b\u00ebQ\2\u0823\u01da\3\2\2\2\u0824\u0825\5\u009bL\2"
+ "\u0825\u0826\3\2\2\2\u0826\u0827\b\u00ecR\2\u0827\u01dc\3\2\2\2\u0828"
+ "\u0829\5\u009dM\2\u0829\u082a\3\2\2\2\u082a\u082b\b\u00edS\2\u082b\u01de"
+ "\3\2\2\2\u082c\u082d\5\u009fN\2\u082d\u082e\3\2\2\2\u082e\u082f\b\u00ee"
+ "T\2\u082f\u01e0\3\2\2\2\u0830\u0831\5\u00a1O\2\u0831\u0832\3\2\2\2\u0832"
+ "\u0833\b\u00efU\2\u0833\u01e2\3\2\2\2\u0834\u0835\5\u00a3P\2\u0835\u0836"
+ "\3\2\2\2\u0836\u0837\b\u00f0V\2\u0837\u01e4\3\2\2\2\u0838\u0839\5\u00a5"
+ "Q\2\u0839\u083a\3\2\2\2\u083a\u083b\b\u00f1W\2\u083b\u01e6\3\2\2\2\u083c"
+ "\u083d\5\u00a7R\2\u083d\u083e\3\2\2\2\u083e\u083f\b\u00f2X\2\u083f\u01e8"
+ "\3\2\2\2\u0840\u0841\5\u00a9S\2\u0841\u0842\3\2\2\2\u0842\u0843\b\u00f3"
+ "Y\2\u0843\u01ea\3\2\2\2\u0844\u0845\5\u00d5i\2\u0845\u0846\3\2\2\2\u0846"
+ "\u0847\b\u00f4Z\2\u0847\u01ec\3\2\2\2\u0848\u0849\5\u00d7j\2\u0849\u084a"
+ "\3\2\2\2\u084a\u084b\b\u00f5[\2\u084b\u01ee\3\2\2\2\u084c\u084d\5\u00d9"
+ "k\2\u084d\u084e\3\2\2\2\u084e\u084f\b\u00f6\\\2\u084f\u01f0\3\2\2\2\u0850"
+ "\u0851\5\u00dbl\2\u0851\u0852\3\2\2\2\u0852\u0853\b\u00f7]\2\u0853\u01f2"
+ "\3\2\2\2\u0854\u0855\5\u00ddm\2\u0855\u0856\3\2\2\2\u0856\u0857\b\u00f8"
+ "^\2\u0857\u01f4\3\2\2\2\u0858\u0859\5\u00dfn\2\u0859\u085a\3\2\2\2\u085a"
+ "\u085b\b\u00f9_\2\u085b\u01f6\3\2\2\2\u085c\u085d\5\u00e1o\2\u085d\u085e"
+ "\3\2\2\2\u085e\u085f\b\u00fa`\2\u085f\u01f8\3\2\2\2\u0860\u0861\5\u00e3"
+ "p\2\u0861\u0862\3\2\2\2\u0862\u0863\b\u00fba\2\u0863\u01fa\3\2\2\2\u0864"
+ "\u0865\5\u00e5q\2\u0865\u0866\3\2\2\2\u0866\u0867\b\u00fcb\2\u0867\u01fc"
+ "\3\2\2\2\u0868\u0869\5\u00e7r\2\u0869\u086a\3\2\2\2\u086a\u086b\b\u00fd"
+ "c\2\u086b\u01fe\3\2\2\2\u086c\u086d\5\u00e9s\2\u086d\u086e\3\2\2\2\u086e"
+ "\u086f\b\u00fed\2\u086f\u0200\3\2\2\2\u0870\u0871\5\u00ebt\2\u0871\u0872"
+ "\3\2\2\2\u0872\u0873\b\u00ffe\2\u0873\u0202\3\2\2\2\u0874\u0875\5\u00ed"
+ "u\2\u0875\u0876\3\2\2\2\u0876\u0877\b\u0100f\2\u0877\u0204\3\2\2\2\u0878"
+ "\u0879\5\u00efv\2\u0879\u087a\3\2\2\2\u087a\u087b\b\u0101g\2\u087b\u0206"
+ "\3\2\2\2\u087c\u087d\5\u00f1w\2\u087d\u087e\3\2\2\2\u087e\u087f\b\u0102"
+ "h\2\u087f\u0208\3\2\2\2\u0880\u0881\5\u00f3x\2\u0881\u0882\3\2\2\2\u0882"
+ "\u0883\b\u0103i\2\u0883\u020a\3\2\2\2\u0884\u0885\5\u00f5y\2\u0885\u0886"
+ "\3\2\2\2\u0886\u0887\b\u0104j\2\u0887\u020c\3\2\2\2\u0888\u0889\5\u00f7"
+ "z\2\u0889\u088a\3\2\2\2\u088a\u088b\b\u0105k\2\u088b\u020e\3\2\2\2\u088c"
+ "\u088d\5\u00f9{\2\u088d\u088e\3\2\2\2\u088e\u088f\b\u0106l\2\u088f\u0210"
+ "\3\2\2\2\u0890\u0891\5\u00fb|\2\u0891\u0892\3\2\2\2\u0892\u0893\b\u0107"
+ "m\2\u0893\u0212\3\2\2\2\u0894\u0895\5\u00fd}\2\u0895\u0896\3\2\2\2\u0896"
+ "\u0897\b\u0108n\2\u0897\u0214\3\2\2\2\u0898\u0899\5\u00ff~\2\u0899\u089a"
+ "\3\2\2\2\u089a\u089b\b\u0109o\2\u089b\u0216\3\2\2\2\u089c\u089d\5\u0101"
+ "\177\2\u089d\u089e\3\2\2\2\u089e\u089f\b\u010ap\2\u089f\u0218\3\2\2\2"
+ "\u08a0\u08a1\5\u0103\u0080\2\u08a1\u08a2\3\2\2\2\u08a2\u08a3\b\u010bq"
+ "\2\u08a3\u021a\3\2\2\2\u08a4\u08a5\5\u0105\u0081\2\u08a5\u08a6\3\2\2\2"
+ "\u08a6\u08a7\b\u010cr\2\u08a7\u021c\3\2\2\2\u08a8\u08a9\5\u0123\u0090"
+ "\2\u08a9\u08aa\3\2\2\2\u08aa\u08ab\b\u010ds\2\u08ab\u021e\3\2\2\2\u08ac"
+ "\u08ad\5\u0113\u0088\2\u08ad\u08ae\3\2\2\2\u08ae\u08af\b\u010et\2\u08af"
+ "\u0220\3\2\2\2\u08b0\u08b1\5\u011b\u008c\2\u08b1\u08b2\3\2\2\2\u08b2\u08b3"
+ "\b\u010fu\2\u08b3\u0222\3\2\2\2\u08b4\u08b5\5\u011f\u008e\2\u08b5\u08b6"
+ "\3\2\2\2\u08b6\u08b7\b\u0110v\2\u08b7\u0224\3\2\2\2\u08b8\u08b9\5\u012f"
+ "\u0096\2\u08b9\u08ba\3\2\2\2\u08ba\u08bb\b\u0111w\2\u08bb\u0226\3\2\2"
+ "\2\u08bc\u08bd\5\u010b\u0084\2\u08bd\u08be\3\2\2\2\u08be\u08bf\b\u0112"
+ "x\2\u08bf\u0228\3\2\2\2\u08c0\u08c1\5\u0125\u0091\2\u08c1\u08c2\3\2\2"
+ "\2\u08c2\u08c3\b\u0113y\2\u08c3\u022a\3\2\2\2\u08c4\u08c5\5\u0111\u0087"
+ "\2\u08c5\u08c6\3\2\2\2\u08c6\u08c7\b\u0114z\2\u08c7\u022c\3\2\2\2\u08c8"
+ "\u08c9\5\u0127\u0092\2\u08c9\u08ca\3\2\2\2\u08ca\u08cb\b\u0115{\2\u08cb"
+ "\u022e\3\2\2\2\u08cc\u08cd\5\u0129\u0093\2\u08cd\u08ce\3\2\2\2\u08ce\u08cf"
+ "\b\u0116|\2\u08cf\u0230\3\2\2\2\u08d0\u08d1\5\u012b\u0094\2\u08d1\u08d2"
+ "\3\2\2\2\u08d2\u08d3\b\u0117}\2\u08d3\u0232\3\2\2\2\u08d4\u08d7\5\13\4"
+ "\2\u08d5\u08d7\5\t\3\2\u08d6\u08d4\3\2\2\2\u08d6\u08d5\3\2\2\2\u08d7\u08d8"
+ "\3\2\2\2\u08d8\u08d9\b\u0118\2\2\u08d9\u0234\3\2\2\2\u08da\u08db\5\r\5"
+ "\2\u08db\u08dc\3\2\2\2\u08dc\u08dd\b\u0119\3\2\u08dd\u0236\3\2\2\2\u08de"
+ "\u08df\5\17\6\2\u08df\u08e0\3\2\2\2\u08e0\u08e1\b\u011a\3\2\u08e1\u0238"
+ "\3\2\2\2\u08e2\u08e3\7$\2\2\u08e3\u08e4\3\2\2\2\u08e4\u08e5\b\u011b\7"
+ "\2\u08e5\u023a\3\2\2\2\u08e6\u08e7\5\u012d\u0095\2\u08e7\u023c\3\2\2\2"
+ "\u08e8\u08ea\n\25\2\2\u08e9\u08e8\3\2\2\2\u08ea\u08eb\3\2\2\2\u08eb\u08e9"
+ "\3\2\2\2\u08eb\u08ec\3\2\2\2\u08ec\u08ef\3\2\2\2\u08ed\u08ef\7&\2\2\u08ee"
+ "\u08e9\3\2\2\2\u08ee\u08ed\3\2\2\2\u08ef\u023e\3\2\2\2\u08f0\u08f1\7^"
+ "\2\2\u08f1\u08f4\13\2\2\2\u08f2\u08f4\5\u0133\u0098\2\u08f3\u08f0\3\2"
+ "\2\2\u08f3\u08f2\3\2\2\2\u08f4\u0240\3\2\2\2\u08f5\u08f6\7&\2\2\u08f6"
+ "\u08f7\7}\2\2\u08f7\u08f8\3\2\2\2\u08f8\u08f9\b\u011f~\2\u08f9\u0242\3"
+ "\2\2\2\u08fa\u08fc\5\u0245\u0121\2\u08fb\u08fa\3\2\2\2\u08fb\u08fc\3\2"
+ "\2\2\u08fc\u08fd\3\2\2\2\u08fd\u08fe\7$\2\2\u08fe\u08ff\7$\2\2\u08ff\u0900"
+ "\7$\2\2\u0900\u0901\3\2\2\2\u0901\u0902\b\u0120\7\2\u0902\u0244\3\2\2"
+ "\2\u0903\u0905\7$\2\2\u0904\u0903\3\2\2\2\u0905\u0906\3\2\2\2\u0906\u0904"
+ "\3\2\2\2\u0906\u0907\3\2\2\2\u0907\u0246\3\2\2\2\u0908\u0909\5\u012d\u0095"
+ "\2\u0909\u0248\3\2\2\2\u090a\u090c\n\25\2\2\u090b\u090a\3\2\2\2\u090c"
+ "\u090d\3\2\2\2\u090d\u090b\3\2\2\2\u090d\u090e\3\2\2\2\u090e\u0911\3\2"
+ "\2\2\u090f\u0911\7&\2\2\u0910\u090b\3\2\2\2\u0910\u090f\3\2\2\2\u0911"
+ "\u024a\3\2\2\2\u0912\u0913\7^\2\2\u0913\u0914\13\2\2\2\u0914\u024c\3\2"
+ "\2\2\u0915\u0916\7&\2\2\u0916\u0917\7}\2\2\u0917\u0918\3\2\2\2\u0918\u0919"
+ "\b\u0125~\2\u0919\u024e\3\2\2\2\u091a\u091b\5\17\6\2\u091b\u091c\3\2\2"
+ "\2\u091c\u091d\b\u0126\3\2\u091d\u0250\3\2\2\2\u091e\u091f\5!\17\2\u091f"
+ "\u0920\3\2\2\2\u0920\u0921\b\u0127\7\2\u0921\u0922\b\u0127\r\2\u0922\u0252"
+ "\3\2\2\2\u0923\u0924\5\27\n\2\u0924\u0925\3\2\2\2\u0925\u0926\b\u0128"
+ "\4\2\u0926\u0927\b\u0128\n\2\u0927\u0254\3\2\2\2\u0928\u0929\5\33\f\2"
+ "\u0929\u092a\3\2\2\2\u092a\u092b\b\u0129\4\2\u092b\u092c\b\u0129\13\2"
+ "\u092c\u0256\3\2\2\2\u092d\u092e\7+\2\2\u092e\u092f\3\2\2\2\u092f\u0930"
+ "\b\u012a\b\2\u0930\u0258\3\2\2\2\u0931\u0932\7_\2\2\u0932\u0933\3\2\2"
+ "\2\u0933\u0934\b\u012b\t\2\u0934\u025a\3\2\2\2\u0935\u0936\5\37\16\2\u0936"
+ "\u0937\3\2\2\2\u0937\u0938\b\u012c~\2\u0938\u0939\b\u012c\f\2\u0939\u025c"
+ "\3\2\2\2\u093a\u093b\5\23\b\2\u093b\u093c\3\2\2\2\u093c\u093d\b\u012d"
+ "\16\2\u093d\u025e\3\2\2\2\u093e\u093f\5\25\t\2\u093f\u0940\3\2\2\2\u0940"
+ "\u0941\b\u012e\17\2\u0941\u0260\3\2\2\2\u0942\u0943\5#\20\2\u0943\u0944"
+ "\3\2\2\2\u0944\u0945\b\u012f\20\2\u0945\u0262\3\2\2\2\u0946\u0947\5%\21"
+ "\2\u0947\u0948\3\2\2\2\u0948\u0949\b\u0130\21\2\u0949\u0264\3\2\2\2\u094a"
+ "\u094b\5\'\22\2\u094b\u094c\3\2\2\2\u094c\u094d\b\u0131\22\2\u094d\u0266"
+ "\3\2\2\2\u094e\u094f\5)\23\2\u094f\u0950\3\2\2\2\u0950\u0951\b\u0132\23"
+ "\2\u0951\u0268\3\2\2\2\u0952\u0953\5+\24\2\u0953\u0954\3\2\2\2\u0954\u0955"
+ "\b\u0133\24\2\u0955\u026a\3\2\2\2\u0956\u0957\5-\25\2\u0957\u0958\3\2"
+ "\2\2\u0958\u0959\b\u0134\25\2\u0959\u026c\3\2\2\2\u095a\u095b\5/\26\2"
+ "\u095b\u095c\3\2\2\2\u095c\u095d\b\u0135\26\2\u095d\u026e\3\2\2\2\u095e"
+ "\u095f\5\61\27\2\u095f\u0960\3\2\2\2\u0960\u0961\b\u0136\27\2\u0961\u0270"
+ "\3\2\2\2\u0962\u0963\5\63\30\2\u0963\u0964\3\2\2\2\u0964\u0965\b\u0137"
+ "\30\2\u0965\u0272\3\2\2\2\u0966\u0967\5\65\31\2\u0967\u0968\3\2\2\2\u0968"
+ "\u0969\b\u0138\31\2\u0969\u0274\3\2\2\2\u096a\u096b\5\67\32\2\u096b\u096c"
+ "\3\2\2\2\u096c\u096d\b\u0139\32\2\u096d\u0276\3\2\2\2\u096e\u096f\59\33"
+ "\2\u096f\u0970\3\2\2\2\u0970\u0971\b\u013a\33\2\u0971\u0278\3\2\2\2\u0972"
+ "\u0973\5;\34\2\u0973\u0974\3\2\2\2\u0974\u0975\b\u013b\34\2\u0975\u027a"
+ "\3\2\2\2\u0976\u0977\5=\35\2\u0977\u0978\3\2\2\2\u0978\u0979\b\u013c\35"
+ "\2\u0979\u027c\3\2\2\2\u097a\u097b\5?\36\2\u097b\u097c\3\2\2\2\u097c\u097d"
+ "\b\u013d\36\2\u097d\u027e\3\2\2\2\u097e\u097f\5A\37\2\u097f\u0980\3\2"
+ "\2\2\u0980\u0981\b\u013e\37\2\u0981\u0280\3\2\2\2\u0982\u0983\5C \2\u0983"
+ "\u0984\3\2\2\2\u0984\u0985\b\u013f \2\u0985\u0282\3\2\2\2\u0986\u0987"
+ "\5E!\2\u0987\u0988\3\2\2\2\u0988\u0989\b\u0140!\2\u0989\u0284\3\2\2\2"
+ "\u098a\u098b\5G\"\2\u098b\u098c\3\2\2\2\u098c\u098d\b\u0141\"\2\u098d"
+ "\u0286\3\2\2\2\u098e\u098f\5I#\2\u098f\u0990\3\2\2\2\u0990\u0991\b\u0142"
+ "#\2\u0991\u0288\3\2\2\2\u0992\u0993\5K$\2\u0993\u0994\3\2\2\2\u0994\u0995"
+ "\b\u0143$\2\u0995\u028a\3\2\2\2\u0996\u0997\5M%\2\u0997\u0998\3\2\2\2"
+ "\u0998\u0999\b\u0144&\2\u0999\u028c\3\2\2\2\u099a\u099b\5O&\2\u099b\u099c"
+ "\3\2\2\2\u099c\u099d\b\u0145\'\2\u099d\u028e\3\2\2\2\u099e\u099f\5Q\'"
+ "\2\u099f\u09a0\3\2\2\2\u09a0\u09a1\b\u0146(\2\u09a1\u0290\3\2\2\2\u09a2"
+ "\u09a3\5S(\2\u09a3\u09a4\3\2\2\2\u09a4\u09a5\b\u0147)\2\u09a5\u0292\3"
+ "\2\2\2\u09a6\u09a7\5U)\2\u09a7\u09a8\3\2\2\2\u09a8\u09a9\b\u0148*\2\u09a9"
+ "\u0294\3\2\2\2\u09aa\u09ab\5W*\2\u09ab\u09ac\3\2\2\2\u09ac\u09ad\b\u0149"
+ "+\2\u09ad\u0296\3\2\2\2\u09ae\u09af\5Y+\2\u09af\u09b0\3\2\2\2\u09b0\u09b1"
+ "\b\u014a,\2\u09b1\u0298\3\2\2\2\u09b2\u09b3\5[,\2\u09b3\u09b4\3\2\2\2"
+ "\u09b4\u09b5\b\u014b-\2\u09b5\u029a\3\2\2\2\u09b6\u09b7\5]-\2\u09b7\u09b8"
+ "\3\2\2\2\u09b8\u09b9\b\u014c.\2\u09b9\u029c\3\2\2\2\u09ba\u09bb\5_.\2"
+ "\u09bb\u09bc\3\2\2\2\u09bc\u09bd\b\u014d/\2\u09bd\u029e\3\2\2\2\u09be"
+ "\u09bf\5a/\2\u09bf\u09c0\3\2\2\2\u09c0\u09c1\b\u014e\60\2\u09c1\u02a0"
+ "\3\2\2\2\u09c2\u09c3\5c\60\2\u09c3\u09c4\3\2\2\2\u09c4\u09c5\b\u014f\61"
+ "\2\u09c5\u02a2\3\2\2\2\u09c6\u09c7\5e\61\2\u09c7\u09c8\3\2\2\2\u09c8\u09c9"
+ "\b\u0150\62\2\u09c9\u02a4\3\2\2\2\u09ca\u09cb\5\u00b3X\2\u09cb\u09cc\3"
+ "\2\2\2\u09cc\u09cd\b\u0151\177\2\u09cd\u02a6\3\2\2\2\u09ce\u09cf\5\u00b5"
+ "Y\2\u09cf\u09d0\3\2\2\2\u09d0\u09d1\b\u0152?\2\u09d1\u02a8\3\2\2\2\u09d2"
+ "\u09d3\5\u00b7Z\2\u09d3\u02aa\3\2\2\2\u09d4\u09d5\5\u00b9[\2\u09d5\u09d6"
+ "\3\2\2\2\u09d6\u09d7\b\u0154\63\2\u09d7\u02ac\3\2\2\2\u09d8\u09d9\5\u00bb"
+ "\\\2\u09d9\u09da\3\2\2\2\u09da\u09db\b\u0155\64\2\u09db\u02ae\3\2\2\2"
+ "\u09dc\u09dd\5g\62\2\u09dd\u09de\3\2\2\2\u09de\u09df\b\u0156\65\2\u09df"
+ "\u02b0\3\2\2\2\u09e0\u09e1\5i\63\2\u09e1\u09e2\3\2\2\2\u09e2\u09e3\b\u0157"
+ "\66\2\u09e3\u02b2\3\2\2\2\u09e4\u09e5\5k\64\2\u09e5\u09e6\3\2\2\2\u09e6"
+ "\u09e7\b\u0158\67\2\u09e7\u02b4\3\2\2\2\u09e8\u09e9\5m\65\2\u09e9\u09ea"
+ "\3\2\2\2\u09ea\u09eb\b\u01598\2\u09eb\u02b6\3\2\2\2\u09ec\u09ed\5\u0107"
+ "\u0082\2\u09ed\u09ee\3\2\2\2\u09ee\u09ef\b\u015a\5\2\u09ef\u09f0\b\u015a"
+ "9\2\u09f0\u02b8\3\2\2\2\u09f1\u09f2\5\u0109\u0083\2\u09f2\u09f3\3\2\2"
+ "\2\u09f3\u09f4\b\u015b\6\2\u09f4\u09f5\b\u015b:\2\u09f5\u02ba\3\2\2\2"
+ "\u09f6\u09f7\5\u0123\u0090\2\u09f7\u09f8\3\2\2\2\u09f8\u09f9\b\u015cs"
+ "\2\u09f9\u02bc\3\2\2\2\u09fa\u09fb\5\u0113\u0088\2\u09fb\u09fc\3\2\2\2"
+ "\u09fc\u09fd\b\u015dt\2\u09fd\u02be\3\2\2\2\u09fe\u09ff\5\u011b\u008c"
+ "\2\u09ff\u0a00\3\2\2\2\u0a00\u0a01\b\u015eu\2\u0a01\u02c0\3\2\2\2\u0a02"
+ "\u0a03\5\u011f\u008e\2\u0a03\u0a04\3\2\2\2\u0a04\u0a05\b\u015fv\2\u0a05"
+ "\u02c2\3\2\2\2\u0a06\u0a07\5\u012f\u0096\2\u0a07\u0a08\3\2\2\2\u0a08\u0a09"
+ "\b\u0160w\2\u0a09\u02c4\3\2\2\2\u0a0a\u0a0b\5\u010b\u0084\2\u0a0b\u0a0c"
+ "\3\2\2\2\u0a0c\u0a0d\b\u0161x\2\u0a0d\u02c6\3\2\2\2\u0a0e\u0a0f\5\u0125"
+ "\u0091\2\u0a0f\u0a10\3\2\2\2\u0a10\u0a11\b\u0162y\2\u0a11\u02c8\3\2\2"
+ "\2\u0a12\u0a13\5\u0111\u0087\2\u0a13\u0a14\3\2\2\2\u0a14\u0a15\b\u0163"
+ "z\2\u0a15\u02ca\3\2\2\2\u0a16\u0a17\5\u0127\u0092\2\u0a17\u0a18\3\2\2"
+ "\2\u0a18\u0a19\b\u0164{\2\u0a19\u02cc\3\2\2\2\u0a1a\u0a1b\5\u0129\u0093"
+ "\2\u0a1b\u0a1c\3\2\2\2\u0a1c\u0a1d\b\u0165|\2\u0a1d\u02ce\3\2\2\2\u0a1e"
+ "\u0a1f\5\u012b\u0094\2\u0a1f\u0a20\3\2\2\2\u0a20\u0a21\b\u0166}\2\u0a21"
+ "\u02d0\3\2\2\2\u0a22\u0a25\5\13\4\2\u0a23\u0a25\5\t\3\2\u0a24\u0a22\3"
+ "\2\2\2\u0a24\u0a23\3\2\2\2\u0a25\u0a26\3\2\2\2\u0a26\u0a27\b\u0167\2\2"
+ "\u0a27\u02d2\3\2\2\2\u0a28\u0a29\5\r\5\2\u0a29\u0a2a\3\2\2\2\u0a2a\u0a2b"
+ "\b\u0168\3\2\u0a2b\u02d4\3\2\2\2\u0a2c\u0a2d\5\17\6\2\u0a2d\u0a2e\3\2"
+ "\2\2\u0a2e\u0a2f\b\u0169\3\2\u0a2f\u02d6\3\2\2\2W\2\3\4\5\6\u02dd\u02e7"
+ "\u02e9\u02f7\u0303\u0472\u0474\u047c\u047e\u05a3\u05a7\u05af\u05b3\u05b9"
+ "\u05bb\u05c0\u05c3\u05c8\u05cd\u05cf\u05d6\u05da\u05df\u05e4\u05e8\u05ed"
+ "\u05ef\u05f6\u05f8\u05fd\u0602\u0607\u0609\u060e\u0613\u0615\u0619\u061e"
+ "\u0627\u062d\u062f\u0637\u063c\u0641\u0647\u064c\u0651\u0653\u065a\u065c"
+ "\u0661\u0666\u066b\u066d\u0672\u0677\u0679\u067d\u068a\u068c\u0696\u0698"
+ "\u06a6\u06af\u06b4\u06b6\u06bd\u06c0\u06ce\u06d4\u06e6\u08d6\u08eb\u08ee"
+ "\u08f3\u08fb\u0906\u090d\u0910\u0a24\u0080\2\3\2\b\2\2\7\3\2\7\4\2\7\5"
+ "\2\6\2\2\t\f\2\t\16\2\t\13\2\t\r\2\t\17\2\t\20\2\t\t\2\t\n\2\t\21\2\t"
+ "\22\2\t\23\2\t\24\2\t\25\2\t\26\2\t\27\2\t\30\2\t\31\2\t\32\2\t\33\2\t"
+ "\34\2\t\35\2\t\36\2\t\37\2\t \2\t!\2\t\"\2\t#\2\t$\2\t%\2\t\b\2\t&\2\t"
+ "\'\2\t(\2\t)\2\t*\2\t+\2\t,\2\t-\2\t.\2\t/\2\t\60\2\t\61\2\t\62\2\t\\"
+ "\2\t]\2\t\63\2\t\64\2\t\65\2\t\66\2\t\u0083\2\t\u0084\2\tA\2\tB\2\t@\2"
+ "\tI\2\t[\2\t^\2\t_\2\t:\2\t`\2\ta\2\tb\2\te\2\tf\2\tg\2\th\2\tU\2\tV\2"
+ "\tW\2\tX\2\t\67\2\t8\2\t9\2\tL\2\tM\2\tN\2\tO\2\tP\2\tQ\2\tR\2\tS\2\t"
+ "T\2\tj\2\tk\2\tl\2\tm\2\tn\2\to\2\tp\2\tq\2\tr\2\ts\2\tt\2\tu\2\tv\2\t"
+ "w\2\tx\2\ty\2\tz\2\t{\2\t|\2\t}\2\t~\2\t\177\2\t\u0080\2\t\u0081\2\t\u0082"
+ "\2\t\u008c\2\t\u0089\2\t\u008a\2\t\u008b\2\t\u0092\2\t\u0085\2\t\u008d"
+ "\2\t\u0088\2\t\u008e\2\t\u008f\2\t\u0090\2\7\6\2\tZ\2";
public static final String _serializedATN =
Utils.join(new String[] {_serializedATNSegment0, _serializedATNSegment1}, "");
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);
}
}
}
| 133,195 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
KotlinLanguage.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/kotlin/KotlinLanguage.java | package com.tyron.code.language.kotlin;
import android.content.res.AssetManager;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.tyron.code.ApplicationLoader;
import com.tyron.code.language.CompletionItemWrapper;
import com.tyron.completion.model.CompletionItem;
import com.tyron.completion.model.CompletionList;
import com.tyron.editor.Editor;
import io.github.rosemoe.sora.lang.Language;
import io.github.rosemoe.sora.lang.analysis.AnalyzeManager;
import io.github.rosemoe.sora.lang.completion.CompletionCancelledException;
import io.github.rosemoe.sora.lang.completion.CompletionHelper;
import io.github.rosemoe.sora.lang.completion.CompletionPublisher;
import io.github.rosemoe.sora.lang.smartEnter.NewlineHandleResult;
import io.github.rosemoe.sora.lang.smartEnter.NewlineHandler;
import io.github.rosemoe.sora.text.CharPosition;
import io.github.rosemoe.sora.text.ContentReference;
import io.github.rosemoe.sora.text.TextUtils;
import io.github.rosemoe.sora.util.MyCharacter;
import io.github.rosemoe.sora.widget.SymbolPairMatch;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;
import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.Token;
public class KotlinLanguage implements Language {
private final Editor mEditor;
private final KotlinAnalyzer mAnalyzer;
public KotlinLanguage(Editor editor) {
mEditor = editor;
AssetManager assetManager = ApplicationLoader.applicationContext.getAssets();
mAnalyzer = KotlinAnalyzer.create(editor);
}
@NonNull
@Override
public AnalyzeManager getAnalyzeManager() {
return mAnalyzer;
}
@Override
public int getInterruptionLevel() {
return INTERRUPTION_LEVEL_SLIGHT;
}
@Override
public void requireAutoComplete(
@NonNull ContentReference content,
@NonNull CharPosition position,
@NonNull CompletionPublisher publisher,
@NonNull Bundle extraArguments)
throws CompletionCancelledException {
char c = content.charAt(position.getIndex() - 1);
if (!isAutoCompleteChar(c)) {
return;
}
String prefix = CompletionHelper.computePrefix(content, position, this::isAutoCompleteChar);
KotlinAutoCompleteProvider provider = new KotlinAutoCompleteProvider(mEditor);
CompletionList list =
provider.getCompletionList(prefix, position.getLine(), position.getColumn());
if (list != null) {
for (CompletionItem item : list.items) {
CompletionItemWrapper wrapper = new CompletionItemWrapper(item);
publisher.addItem(wrapper);
}
}
}
public boolean isAutoCompleteChar(char p1) {
return p1 == '.' || MyCharacter.isJavaIdentifierPart(p1);
}
@Override
public int getIndentAdvance(@NonNull ContentReference content, int line, int column) {
String text = content.getLine(line).substring(0, column);
return getIndentAdvance(text);
}
public int getIndentAdvance(String p1) {
KotlinLexer lexer = new KotlinLexer(CharStreams.fromString(p1));
Token token;
int advance = 0;
while ((token = lexer.nextToken()) != null) {
if (token.getType() == KotlinLexer.EOF) {
break;
}
if (token.getType() == KotlinLexer.LCURL) {
advance++;
/*case RBRACE:
advance--;
break;*/
}
}
advance = Math.max(0, advance);
return advance * 4;
}
@Override
public boolean useTab() {
return true;
}
@Override
public CharSequence format(CharSequence text) {
CharSequence formatted = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayOutputStream err = new ByteArrayOutputStream();
com.facebook.ktfmt.cli.Main main =
new com.facebook.ktfmt.cli.Main(
new ByteArrayInputStream(text.toString().getBytes(StandardCharsets.UTF_8)),
new PrintStream(out),
new PrintStream(err),
new String[] {"-"});
int exitCode = main.run();
formatted = out.toString();
if (exitCode != 0) {
formatted = text;
}
if (formatted == null) {
formatted = text;
}
return formatted;
}
@Override
public SymbolPairMatch getSymbolPairs() {
return new SymbolPairMatch.DefaultSymbolPairs();
}
@Override
public NewlineHandler[] getNewlineHandlers() {
return handlers;
}
@Override
public void destroy() {}
private final NewlineHandler[] handlers = new NewlineHandler[] {new BraceHandler()};
class BraceHandler implements NewlineHandler {
@Override
public boolean matchesRequirement(String beforeText, String afterText) {
return beforeText.endsWith("{") && afterText.startsWith("}");
}
@Override
public NewlineHandleResult handleNewline(String beforeText, String afterText, int tabSize) {
int count = TextUtils.countLeadingSpaceCount(beforeText, tabSize);
int advanceBefore = getIndentAdvance(beforeText);
int advanceAfter = getIndentAdvance(afterText);
String text;
StringBuilder sb =
new StringBuilder("\n")
.append(TextUtils.createIndent(count + advanceBefore, tabSize, useTab()))
.append('\n')
.append(text = TextUtils.createIndent(count + advanceAfter, tabSize, useTab()));
int shiftLeft = text.length() + 1;
return new NewlineHandleResult(sb, shiftLeft);
}
}
private List<String> listFiles(Path directory, String extension) throws IOException {
return Files.walk(directory)
.filter(Files::isRegularFile)
.filter(path -> path.toString().endsWith(extension))
.map(Path::toString)
.collect(Collectors.toList());
}
}
| 5,875 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Kotlin.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/kotlin/Kotlin.java | package com.tyron.code.language.kotlin;
import com.tyron.code.language.Language;
import com.tyron.editor.Editor;
import java.io.File;
public class Kotlin implements Language {
@Override
public boolean isApplicable(File ext) {
return ext.getName().endsWith(".kt");
}
@Override
public io.github.rosemoe.sora.lang.Language get(Editor editor) {
return new KotlinLanguage(editor);
}
}
| 403 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
KotlinAutoCompleteProvider.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/kotlin/KotlinAutoCompleteProvider.java | package com.tyron.code.language.kotlin;
import android.content.SharedPreferences;
import androidx.annotation.Nullable;
import com.tyron.builder.project.Project;
import com.tyron.builder.project.api.AndroidModule;
import com.tyron.builder.project.api.KotlinModule;
import com.tyron.builder.project.api.Module;
import com.tyron.code.ApplicationLoader;
import com.tyron.code.language.AbstractAutoCompleteProvider;
import com.tyron.code.ui.project.ProjectManager;
import com.tyron.common.SharedPreferenceKeys;
import com.tyron.completion.model.CompletionList;
import com.tyron.editor.Editor;
import com.tyron.kotlin.completion.core.model.KotlinEnvironment;
import com.tyron.kotlin_completion.CompletionEngine;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
import org.json.JSONObject;
public class KotlinAutoCompleteProvider extends AbstractAutoCompleteProvider {
private static final String TAG = KotlinAutoCompleteProvider.class.getSimpleName();
private final Editor mEditor;
private final SharedPreferences mPreferences;
private KotlinCoreEnvironment environment;
public KotlinAutoCompleteProvider(Editor editor) {
mEditor = editor;
mPreferences = ApplicationLoader.getDefaultPreferences();
}
@Nullable
@Override
public CompletionList getCompletionList(String prefix, int line, int column) {
if (!mPreferences.getBoolean(SharedPreferenceKeys.KOTLIN_COMPLETIONS, false)) {
return null;
}
if (com.tyron.completion.java.provider.CompletionEngine.isIndexing()) {
return null;
}
if (!mPreferences.getBoolean(SharedPreferenceKeys.KOTLIN_COMPLETIONS, false)) {
return null;
}
Project project = ProjectManager.getInstance().getCurrentProject();
if (project == null) {
return null;
}
Module currentModule = project.getModule(mEditor.getCurrentFile());
if (!(currentModule instanceof AndroidModule)) {
return null;
}
if (environment == null) {
environment = KotlinEnvironment.getEnvironment((KotlinModule) currentModule);
}
if (mEditor.getCurrentFile() == null) {
return null;
}
CompletionEngine engine = CompletionEngine.getInstance((AndroidModule) currentModule);
if (engine.isIndexing()) {
return null;
}
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject != null) {
Module module = currentProject.getModule(mEditor.getCurrentFile());
if (module instanceof AndroidModule) {
try {
File buildSettings =
new File(
module.getProjectDir(),
".idea/" + module.getRootFile().getName() + "_compiler_settings.json");
String json = new String(Files.readAllBytes(Paths.get(buildSettings.getAbsolutePath())));
JSONObject buildSettingsJson = new JSONObject(json);
boolean isKotlinCompletionV2 =
Boolean.parseBoolean(
buildSettingsJson
.optJSONObject("kotlin")
.optString("isKotlinCompletionV2", "false"));
// waiting for code editor to support async code completions
if (!isKotlinCompletionV2) {
return engine.complete(
mEditor.getCurrentFile(),
String.valueOf(mEditor.getContent()),
prefix,
line,
column,
mEditor.getCaret().getStart());
} else {
return engine.completeV2(
mEditor.getCurrentFile(),
String.valueOf(mEditor.getContent()),
prefix,
line,
column,
mEditor.getCaret().getStart());
}
} catch (Exception e) {
}
}
}
return null;
}
}
| 3,912 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
XMLColorScheme.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/xml/XMLColorScheme.java | package com.tyron.code.language.xml;
import io.github.rosemoe.sora.widget.schemes.EditorColorScheme;
public class XMLColorScheme extends EditorColorScheme {
public XMLColorScheme() {
super();
}
@Override
public void applyDefault() {
for (int i = START_COLOR_ID; i <= END_COLOR_ID; i++) {
applyDefault(i);
}
}
private void applyDefault(int color) {
super.applyDefault();
}
}
| 415 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
LanguageXML.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/xml/LanguageXML.java | package com.tyron.code.language.xml;
import android.content.res.AssetManager;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.tyron.builder.compiler.manifest.xml.XmlFormatPreferences;
import com.tyron.builder.compiler.manifest.xml.XmlFormatStyle;
import com.tyron.builder.compiler.manifest.xml.XmlPrettyPrinter;
import com.tyron.code.ApplicationLoader;
import com.tyron.code.analyzer.BaseTextmateAnalyzer;
import com.tyron.code.ui.editor.impl.text.rosemoe.CodeEditorView;
import com.tyron.code.util.ProjectUtils;
import com.tyron.completion.xml.lexer.XMLLexer;
import com.tyron.editor.Editor;
import io.github.rosemoe.sora.lang.Language;
import io.github.rosemoe.sora.lang.analysis.AnalyzeManager;
import io.github.rosemoe.sora.lang.completion.CompletionCancelledException;
import io.github.rosemoe.sora.lang.completion.CompletionHelper;
import io.github.rosemoe.sora.lang.completion.CompletionItem;
import io.github.rosemoe.sora.lang.completion.CompletionPublisher;
import io.github.rosemoe.sora.lang.smartEnter.NewlineHandleResult;
import io.github.rosemoe.sora.lang.smartEnter.NewlineHandler;
import io.github.rosemoe.sora.langs.textmate.theme.TextMateColorScheme;
import io.github.rosemoe.sora.text.CharPosition;
import io.github.rosemoe.sora.text.ContentReference;
import io.github.rosemoe.sora.text.TextUtils;
import io.github.rosemoe.sora.util.MyCharacter;
import io.github.rosemoe.sora.widget.SymbolPairMatch;
import java.io.File;
import java.io.InputStreamReader;
import java.util.List;
public class LanguageXML implements Language {
private final Editor mEditor;
private final BaseTextmateAnalyzer mAnalyzer;
public LanguageXML(Editor editor) {
mEditor = editor;
try {
AssetManager assetManager = ApplicationLoader.applicationContext.getAssets();
mAnalyzer =
new XMLAnalyzer(
editor,
"xml.tmLanguage.json",
assetManager.open("textmate/xml" + "/syntaxes/xml" + ".tmLanguage.json"),
new InputStreamReader(assetManager.open("textmate/java/language-configuration.json")),
((TextMateColorScheme) ((CodeEditorView) editor).getColorScheme()).getRawTheme());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public boolean isAutoCompleteChar(char ch) {
return MyCharacter.isJavaIdentifierPart(ch) || ch == '<' || ch == '/' || ch == ':' || ch == '.';
}
@Override
public boolean useTab() {
return true;
}
@Override
public CharSequence format(CharSequence text) {
XmlFormatPreferences preferences = XmlFormatPreferences.defaults();
File file = mEditor.getCurrentFile();
CharSequence formatted = null;
if ("AndroidManifest.xml".equals(file.getName())) {
formatted =
XmlPrettyPrinter.prettyPrint(
String.valueOf(text), preferences, XmlFormatStyle.MANIFEST, "\n");
} else {
if (ProjectUtils.isLayoutXMLFile(file)) {
formatted =
XmlPrettyPrinter.prettyPrint(
String.valueOf(text), preferences, XmlFormatStyle.LAYOUT, "\n");
} else if (ProjectUtils.isResourceXMLFile(file)) {
formatted =
XmlPrettyPrinter.prettyPrint(
String.valueOf(text), preferences, XmlFormatStyle.RESOURCE, "\n");
}
}
if (formatted == null) {
formatted = text;
}
return formatted;
}
@Override
public SymbolPairMatch getSymbolPairs() {
return new SymbolPairMatch.DefaultSymbolPairs();
}
@Override
public NewlineHandler[] getNewlineHandlers() {
return new NewlineHandler[] {
new StartTagHandler(), new EndTagHandler(), new EndTagAttributeHandler()
};
}
@Override
public void destroy() {}
@NonNull
@Override
public AnalyzeManager getAnalyzeManager() {
return mAnalyzer;
}
@Override
public int getInterruptionLevel() {
return INTERRUPTION_LEVEL_SLIGHT;
}
@Override
public void requireAutoComplete(
@NonNull ContentReference content,
@NonNull CharPosition position,
@NonNull CompletionPublisher publisher,
@NonNull Bundle extraArguments)
throws CompletionCancelledException {
String prefix = CompletionHelper.computePrefix(content, position, this::isAutoCompleteChar);
List<CompletionItem> items =
new XMLAutoCompleteProvider(mEditor)
.getAutoCompleteItems(prefix, position.getLine(), position.getColumn());
if (items == null) {
return;
}
for (CompletionItem item : items) {
publisher.addItem(item);
}
}
@Override
public int getIndentAdvance(@NonNull ContentReference content, int line, int column) {
String text = content.getLine(line).substring(0, column);
return getIndentAdvance(text);
}
public int getIndentAdvance(String content) {
return getIndentAdvance(content, XMLLexer.DEFAULT_MODE, true);
}
public int getIndentAdvance(String content, int mode, boolean ignore) {
return 0;
// XMLLexer lexer = new XMLLexer(CharStreams.fromString(content));
// lexer.pushMode(mode);
//
// int advance = 0;
// while (lexer.nextToken()
// .getType() != Lexer.EOF) {
// switch (lexer.getToken()
// .getType()) {
// case XMLLexer.OPEN:
// advance++;
// break;
// case XMLLexer.CLOSE:
// case XMLLexer.SLASH_CLOSE:
// advance--;
// break;
// }
// }
//
// if (advance == 0 && mode != XMLLexer.INSIDE) {
// return getIndentAdvance(content, XMLLexer.INSIDE, ignore);
// }
//
// return advance * mEditor.getTabCount();
}
public int getFormatIndent(String line) {
return getIndentAdvance(line, XMLLexer.DEFAULT_MODE, false);
}
private class EndTagHandler implements NewlineHandler {
@Override
public boolean matchesRequirement(String beforeText, String afterText) {
String trim = beforeText.trim();
if (!trim.startsWith("<")) {
return false;
}
if (!trim.endsWith(">")) {
return false;
}
return afterText.trim().startsWith("</");
}
@Override
public NewlineHandleResult handleNewline(String beforeText, String afterText, int tabSize) {
int count = TextUtils.countLeadingSpaceCount(beforeText, tabSize);
String middle;
StringBuilder sb = new StringBuilder();
sb.append('\n');
sb.append(TextUtils.createIndent(count + tabSize, tabSize, useTab()));
sb.append('\n');
sb.append(middle = TextUtils.createIndent(count, tabSize, useTab()));
return new NewlineHandleResult(sb, middle.length() + 1);
}
}
private class EndTagAttributeHandler implements NewlineHandler {
@Override
public boolean matchesRequirement(String beforeText, String afterText) {
return beforeText.trim().endsWith(">") && afterText.trim().startsWith("</");
}
@Override
public NewlineHandleResult handleNewline(String beforeText, String afterText, int tabSize) {
int count = TextUtils.countLeadingSpaceCount(beforeText, tabSize);
String middle;
StringBuilder sb = new StringBuilder();
sb.append('\n');
sb.append(TextUtils.createIndent(count, tabSize, useTab()));
sb.append('\n');
sb.append(middle = TextUtils.createIndent(count - tabSize, tabSize, useTab()));
return new NewlineHandleResult(sb, middle.length() + 1);
}
}
private class StartTagHandler implements NewlineHandler {
@Override
public boolean matchesRequirement(String beforeText, String afterText) {
String trim = beforeText.trim();
return trim.startsWith("<") && !trim.endsWith(">");
}
@Override
public NewlineHandleResult handleNewline(String beforeText, String afterText, int tabSize) {
int count = TextUtils.countLeadingSpaceCount(beforeText, tabSize);
String text;
StringBuilder sb =
new StringBuilder()
.append("\n")
.append(TextUtils.createIndent(count + tabSize, tabSize, useTab()));
return new NewlineHandleResult(sb, 0);
}
}
}
| 8,314 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
XMLAnalyzer.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/xml/XMLAnalyzer.java | package com.tyron.code.language.xml;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.tyron.builder.compiler.BuildType;
import com.tyron.builder.compiler.incremental.resource.IncrementalAapt2Task;
import com.tyron.builder.exception.CompilationFailedException;
import com.tyron.builder.log.ILogger;
import com.tyron.builder.model.DiagnosticWrapper;
import com.tyron.builder.project.Project;
import com.tyron.builder.project.api.AndroidModule;
import com.tyron.builder.project.api.Module;
import com.tyron.code.analyzer.DiagnosticTextmateAnalyzer;
import com.tyron.code.ui.project.ProjectManager;
import com.tyron.code.util.ProjectUtils;
import com.tyron.common.util.Debouncer;
import com.tyron.completion.index.CompilerService;
import com.tyron.completion.java.JavaCompilerProvider;
import com.tyron.completion.java.compiler.CompilerContainer;
import com.tyron.completion.java.compiler.JavaCompilerService;
import com.tyron.completion.progress.ProgressManager;
import com.tyron.completion.xml.task.InjectResourcesTask;
import com.tyron.editor.Editor;
import com.tyron.viewbinding.task.InjectViewBindingTask;
import io.github.rosemoe.sora.textmate.core.theme.IRawTheme;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.lang.ref.WeakReference;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.stream.Collectors;
import kotlin.Unit;
import org.apache.commons.io.FileUtils;
import org.codeassist.unofficial.BuildConfig;
public class XMLAnalyzer extends DiagnosticTextmateAnalyzer {
private boolean mAnalyzerEnabled = false;
private static final Debouncer sDebouncer =
new Debouncer(
Duration.ofMillis(900L),
Executors.newScheduledThreadPool(
1,
new ThreadFactory() {
@Override
public Thread newThread(Runnable runnable) {
ThreadGroup threadGroup = Looper.getMainLooper().getThread().getThreadGroup();
return new Thread(threadGroup, runnable, "XmlAnalyzer");
}
}));
private final WeakReference<Editor> mEditorReference;
public XMLAnalyzer(
Editor editor,
String grammarName,
InputStream grammarIns,
Reader languageConfiguration,
IRawTheme theme)
throws Exception {
super(editor, grammarName, grammarIns, languageConfiguration, theme);
mEditorReference = new WeakReference<>(editor);
}
@Override
public void analyzeInBackground(CharSequence contents) {
Editor editor = mEditorReference.get();
if (editor == null) {
return;
}
if (!mAnalyzerEnabled) {
Project project = editor.getProject();
if (project == null) {
return;
}
ProgressManager.getInstance().runLater(() -> editor.setAnalyzing(true));
sDebouncer.cancel();
sDebouncer.schedule(
cancel -> {
AndroidModule mainModule = (AndroidModule) project.getMainModule();
try {
InjectResourcesTask.inject(project, mainModule);
InjectViewBindingTask.inject(project, mainModule);
ProgressManager.getInstance().runLater(() -> editor.setAnalyzing(false), 300);
} catch (IOException e) {
e.printStackTrace();
}
return Unit.INSTANCE;
});
return;
}
File currentFile = editor.getCurrentFile();
if (currentFile == null) {
return;
}
List<DiagnosticWrapper> diagnosticWrappers = new ArrayList<>();
sDebouncer.cancel();
sDebouncer.schedule(
cancel -> {
compile(
currentFile,
contents.toString(),
new ILogger() {
@Override
public void info(DiagnosticWrapper wrapper) {
addMaybe(wrapper);
}
@Override
public void debug(DiagnosticWrapper wrapper) {
addMaybe(wrapper);
}
@Override
public void warning(DiagnosticWrapper wrapper) {
addMaybe(wrapper);
}
@Override
public void error(DiagnosticWrapper wrapper) {
addMaybe(wrapper);
}
private void addMaybe(DiagnosticWrapper wrapper) {
if (currentFile.equals(wrapper.getSource())) {
diagnosticWrappers.add(wrapper);
}
}
});
if (!cancel.invoke()) {
ProgressManager.getInstance()
.runLater(
() -> {
editor.setDiagnostics(
diagnosticWrappers.stream()
.filter(it -> it.getLineNumber() > 0)
.collect(Collectors.toList()));
});
}
return Unit.INSTANCE;
});
}
private final Handler handler = new Handler();
long delay = 1000L;
long lastTime;
private void compile(File file, String contents, ILogger logger) {
boolean isResource = ProjectUtils.isResourceXMLFile(file);
if (isResource) {
Project project = ProjectManager.getInstance().getCurrentProject();
if (project != null) {
Module module = project.getModule(file);
if (module instanceof AndroidModule) {
try {
doGenerate(project, (AndroidModule) module, file, contents, logger);
} catch (IOException | CompilationFailedException e) {
if (BuildConfig.DEBUG) {
Log.e("XMLAnalyzer", "Failed compiling", e);
}
}
}
}
}
}
private void doGenerate(
Project project, AndroidModule module, File file, String contents, ILogger logger)
throws IOException, CompilationFailedException {
if (!file.canWrite() || !file.canRead()) {
return;
}
if (!module.getFileManager().isOpened(file)) {
Log.e("XMLAnalyzer", "File is not yet opened!");
return;
}
Optional<CharSequence> fileContent = module.getFileManager().getFileContent(file);
if (!fileContent.isPresent()) {
Log.e("XMLAnalyzer", "No snapshot for file found.");
return;
}
contents = fileContent.get().toString();
FileUtils.writeStringToFile(file, contents, StandardCharsets.UTF_8);
IncrementalAapt2Task task = new IncrementalAapt2Task(project, module, logger, false);
try {
task.prepare(BuildType.DEBUG);
task.run();
} catch (CompilationFailedException e) {
throw e;
}
// work around to refresh R.java file
File resourceClass = module.getJavaFile(module.getNameSpace() + ".R");
if (resourceClass != null) {
JavaCompilerProvider provider =
CompilerService.getInstance().getIndex(JavaCompilerProvider.KEY);
JavaCompilerService service = provider.getCompiler(project, module);
CompilerContainer container = service.compile(resourceClass.toPath());
container.run(__ -> {});
}
}
}
| 7,358 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
XMLAutoCompleteProvider.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/xml/XMLAutoCompleteProvider.java | package com.tyron.code.language.xml;
import com.tyron.builder.project.Project;
import com.tyron.builder.project.api.AndroidModule;
import com.tyron.builder.project.api.Module;
import com.tyron.code.language.AbstractAutoCompleteProvider;
import com.tyron.code.ui.project.ProjectManager;
import com.tyron.completion.main.CompletionEngine;
import com.tyron.completion.model.CompletionList;
import com.tyron.editor.Editor;
import java.io.File;
public class XMLAutoCompleteProvider extends AbstractAutoCompleteProvider {
private final Editor mEditor;
public XMLAutoCompleteProvider(Editor editor) {
mEditor = editor;
}
@Override
public CompletionList getCompletionList(String prefix, int line, int column) {
Project currentProject = ProjectManager.getInstance().getCurrentProject();
if (currentProject == null) {
return null;
}
Module module = currentProject.getModule(mEditor.getCurrentFile());
if (!(module instanceof AndroidModule)) {
return null;
}
File currentFile = mEditor.getCurrentFile();
if (currentFile == null) {
return null;
}
return CompletionEngine.getInstance()
.complete(
currentProject,
module,
mEditor,
currentFile,
mEditor.getContent().toString(),
prefix,
line,
column,
mEditor.getCaret().getStart());
}
}
| 1,417 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Xml.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/xml/Xml.java | package com.tyron.code.language.xml;
import com.tyron.code.language.Language;
import com.tyron.editor.Editor;
import java.io.File;
public class Xml implements Language {
@Override
public boolean isApplicable(File file) {
return file.getName().endsWith(".xml");
}
@Override
public io.github.rosemoe.sora.lang.Language get(Editor editor) {
return new LanguageXML(editor);
}
}
| 398 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
GroovyLexer.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/groovy/GroovyLexer.java | // Generated from
// C:/Users/bounc/AndroidStudioProjects/CodeAssist/app/src/main/java/com/tyron/code/ui/editor/language/groovy\GroovyLexer.g4 by ANTLR 4.9.1
package com.tyron.code.language.groovy;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.HashSet;
import java.util.Set;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.CharStream;
import org.antlr.v4.runtime.Lexer;
import org.antlr.v4.runtime.Token;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class GroovyLexer extends Lexer {
static {
RuntimeMetaData.checkVersion("4.9.1", RuntimeMetaData.VERSION);
}
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache = new PredictionContextCache();
public static final int SHEBANG_COMMENT = 1,
WS = 2,
LPAREN = 3,
RPAREN = 4,
LBRACK = 5,
RBRACK = 6,
LCURVE = 7,
RCURVE = 8,
STRING = 9,
GSTRING_START = 10,
GSTRING_END = 11,
GSTRING_PART = 12,
GSTRING_PATH_PART = 13,
ROLLBACK_ONE = 14,
DECIMAL = 15,
INTEGER = 16,
KW_CLASS = 17,
KW_INTERFACE = 18,
KW_TRAIT = 19,
KW_ENUM = 20,
KW_PACKAGE = 21,
KW_IMPORT = 22,
KW_EXTENDS = 23,
KW_IMPLEMENTS = 24,
KW_DEF = 25,
KW_NULL = 26,
KW_TRUE = 27,
KW_FALSE = 28,
KW_NEW = 29,
KW_SUPER = 30,
KW_THIS = 31,
KW_IN = 32,
KW_FOR = 33,
KW_IF = 34,
KW_ELSE = 35,
KW_DO = 36,
KW_WHILE = 37,
KW_SWITCH = 38,
KW_CASE = 39,
KW_DEFAULT = 40,
KW_CONTINUE = 41,
KW_BREAK = 42,
KW_RETURN = 43,
KW_TRY = 44,
KW_CATCH = 45,
KW_FINALLY = 46,
KW_THROW = 47,
KW_THROWS = 48,
KW_ASSERT = 49,
KW_CONST = 50,
KW_GOTO = 51,
RUSHIFT_ASSIGN = 52,
RSHIFT_ASSIGN = 53,
LSHIFT_ASSIGN = 54,
SPACESHIP = 55,
ELVIS = 56,
SAFE_DOT = 57,
STAR_DOT = 58,
ATTR_DOT = 59,
MEMBER_POINTER = 60,
LTE = 61,
GTE = 62,
CLOSURE_ARG_SEPARATOR = 63,
DECREMENT = 64,
INCREMENT = 65,
POWER = 66,
LSHIFT = 67,
RANGE = 68,
ORANGE = 69,
EQUAL = 70,
UNEQUAL = 71,
MATCH = 72,
FIND = 73,
AND = 74,
OR = 75,
PLUS_ASSIGN = 76,
MINUS_ASSIGN = 77,
MULT_ASSIGN = 78,
DIV_ASSIGN = 79,
MOD_ASSIGN = 80,
BAND_ASSIGN = 81,
XOR_ASSIGN = 82,
BOR_ASSIGN = 83,
SEMICOLON = 84,
DOT = 85,
COMMA = 86,
AT = 87,
ASSIGN = 88,
LT = 89,
GT = 90,
COLON = 91,
BOR = 92,
NOT = 93,
BNOT = 94,
MULT = 95,
DIV = 96,
MOD = 97,
PLUS = 98,
MINUS = 99,
BAND = 100,
XOR = 101,
QUESTION = 102,
ELLIPSIS = 103,
KW_AS = 104,
KW_INSTANCEOF = 105,
BUILT_IN_TYPE = 106,
VISIBILITY_MODIFIER = 107,
KW_ABSTRACT = 108,
KW_STATIC = 109,
KW_FINAL = 110,
KW_TRANSIENT = 111,
KW_NATIVE = 112,
KW_VOLATILE = 113,
KW_SYNCHRONIZED = 114,
KW_STRICTFP = 115,
KW_THREADSAFE = 116,
IGNORE_NEWLINE = 117,
NL = 118,
IDENTIFIER = 119;
public static final int TRIPLE_QUOTED_GSTRING_MODE = 1,
DOUBLE_QUOTED_GSTRING_MODE = 2,
SLASHY_GSTRING_MODE = 3,
DOLLAR_SLASHY_GSTRING_MODE = 4,
GSTRING_TYPE_SELECTOR_MODE = 5,
GSTRING_PATH = 6;
public static String[] channelNames = {"DEFAULT_TOKEN_CHANNEL", "HIDDEN"};
public static String[] modeNames = {
"DEFAULT_MODE", "TRIPLE_QUOTED_GSTRING_MODE", "DOUBLE_QUOTED_GSTRING_MODE",
"SLASHY_GSTRING_MODE", "DOLLAR_SLASHY_GSTRING_MODE", "GSTRING_TYPE_SELECTOR_MODE",
"GSTRING_PATH"
};
private static String[] makeRuleNames() {
return new String[] {
"LINE_COMMENT",
"DOC_COMMENT",
"BLOCK_COMMENT",
"SHEBANG_COMMENT",
"WS",
"LPAREN",
"RPAREN",
"LBRACK",
"RBRACK",
"LCURVE",
"RCURVE",
"MULTILINE_STRING",
"MULTILINE_GSTRING_START",
"STRING",
"SLASHY_STRING",
"DOLLAR_SLASHY_STRING",
"GSTRING_START",
"SLASHY_GSTRING_START",
"DOLLAR_SLASHY_GSTRING_START",
"SLASHY_STRING_ELEMENT",
"DOLLAR_SLASHY_STRING_ELEMENT",
"TSQ_STRING_ELEMENT",
"SQ_STRING_ELEMENT",
"TDQ_STRING_ELEMENT",
"DQ_STRING_ELEMENT",
"TSQ",
"TDQ",
"LDS",
"RDS",
"IDENTIFIER_IN_GSTRING",
"MULTILINE_GSTRING_END",
"MULTILINE_GSTRING_PART",
"MULTILINE_GSTRING_ELEMENT",
"GSTRING_END",
"GSTRING_PART",
"GSTRING_ELEMENT",
"SLASHY_GSTRING_END",
"SLASHY_GSTRING_PART",
"SLASHY_GSTRING_ELEMENT",
"DOLLAR_SLASHY_GSTRING_END",
"DOLLAR_SLASHY_GSTRING_PART",
"DOLLAR_SLASHY_GSTRING_ELEMENT",
"GSTRING_BRACE_L",
"GSTRING_ID",
"GSTRING_PATH_PART",
"ROLLBACK_ONE",
"SLASHY_ESCAPE",
"DOLLAR_ESCAPE",
"JOIN_LINE_ESCAPE",
"ESC_SEQUENCE",
"OCTAL_ESC_SEQ",
"UNICODE_ESCAPE",
"DECIMAL",
"INTEGER",
"DIGITS",
"DEC_DIGITS",
"OCT_DIGITS",
"ZERO_TO_SEVEN",
"HEX_DIGITS",
"HEX_DIGIT",
"BIN_DIGITS",
"BIN_DIGIT",
"SIGN",
"EXP_PART",
"DIGIT",
"INTEGER_TYPE_MODIFIER",
"DECIMAL_TYPE_MODIFIER",
"DECIMAL_ONLY_TYPE_MODIFIER",
"KW_CLASS",
"KW_INTERFACE",
"KW_TRAIT",
"KW_ENUM",
"KW_PACKAGE",
"KW_IMPORT",
"KW_EXTENDS",
"KW_IMPLEMENTS",
"KW_DEF",
"KW_NULL",
"KW_TRUE",
"KW_FALSE",
"KW_NEW",
"KW_SUPER",
"KW_THIS",
"KW_IN",
"KW_FOR",
"KW_IF",
"KW_ELSE",
"KW_DO",
"KW_WHILE",
"KW_SWITCH",
"KW_CASE",
"KW_DEFAULT",
"KW_CONTINUE",
"KW_BREAK",
"KW_RETURN",
"KW_TRY",
"KW_CATCH",
"KW_FINALLY",
"KW_THROW",
"KW_THROWS",
"KW_ASSERT",
"KW_CONST",
"KW_GOTO",
"RUSHIFT_ASSIGN",
"RSHIFT_ASSIGN",
"LSHIFT_ASSIGN",
"SPACESHIP",
"ELVIS",
"SAFE_DOT",
"STAR_DOT",
"ATTR_DOT",
"MEMBER_POINTER",
"LTE",
"GTE",
"CLOSURE_ARG_SEPARATOR",
"DECREMENT",
"INCREMENT",
"POWER",
"LSHIFT",
"RANGE",
"ORANGE",
"EQUAL",
"UNEQUAL",
"MATCH",
"FIND",
"AND",
"OR",
"PLUS_ASSIGN",
"MINUS_ASSIGN",
"MULT_ASSIGN",
"DIV_ASSIGN",
"MOD_ASSIGN",
"BAND_ASSIGN",
"XOR_ASSIGN",
"BOR_ASSIGN",
"SEMICOLON",
"DOT",
"COMMA",
"AT",
"ASSIGN",
"LT",
"GT",
"COLON",
"BOR",
"NOT",
"BNOT",
"MULT",
"DIV",
"MOD",
"PLUS",
"MINUS",
"BAND",
"XOR",
"QUESTION",
"ELLIPSIS",
"KW_AS",
"KW_INSTANCEOF",
"BUILT_IN_TYPE",
"VISIBILITY_MODIFIER",
"KW_PUBLIC",
"KW_PROTECTED",
"KW_PRIVATE",
"KW_ABSTRACT",
"KW_STATIC",
"KW_FINAL",
"KW_TRANSIENT",
"KW_NATIVE",
"KW_VOLATILE",
"KW_SYNCHRONIZED",
"KW_STRICTFP",
"KW_THREADSAFE",
"IGNORE_NEWLINE",
"NL",
"IDENTIFIER",
"JavaLetter",
"JavaLetterOrDigit",
"JavaLetterInGString",
"JavaLetterOrDigitInGString",
"JavaUnicodeChar"
};
}
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,
"'class'",
"'interface'",
"'trait'",
"'enum'",
"'package'",
"'import'",
"'extends'",
"'implements'",
"'def'",
"'null'",
"'true'",
"'false'",
"'new'",
"'super'",
"'this'",
"'in'",
"'for'",
"'if'",
"'else'",
"'do'",
"'while'",
"'switch'",
"'case'",
"'default'",
"'continue'",
"'break'",
"'return'",
"'try'",
"'catch'",
"'finally'",
"'throw'",
"'throws'",
"'assert'",
"'const'",
"'goto'",
"'>>>='",
"'>>='",
"'<<='",
"'<=>'",
"'?:'",
"'?.'",
"'*.'",
"'.@'",
"'.&'",
"'<='",
"'>='",
"'->'",
"'--'",
"'++'",
"'**'",
"'<<'",
"'..'",
"'..<'",
"'=='",
"'!='",
"'==~'",
"'=~'",
"'&&'",
"'||'",
"'+='",
"'-='",
"'*='",
"'/='",
"'%='",
"'&='",
"'^='",
"'|='",
"';'",
"'.'",
"','",
"'@'",
"'='",
"'<'",
"'>'",
"':'",
"'|'",
"'!'",
"'~'",
"'*'",
"'/'",
"'%'",
"'+'",
"'-'",
"'&'",
"'^'",
"'?'",
"'...'",
"'as'",
"'instanceof'",
null,
null,
"'abstract'",
"'static'",
"'final'",
"'transient'",
"'native'",
"'volatile'",
"'synchronized'",
"'strictfp'",
"'threadsafe'"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null,
"SHEBANG_COMMENT",
"WS",
"LPAREN",
"RPAREN",
"LBRACK",
"RBRACK",
"LCURVE",
"RCURVE",
"STRING",
"GSTRING_START",
"GSTRING_END",
"GSTRING_PART",
"GSTRING_PATH_PART",
"ROLLBACK_ONE",
"DECIMAL",
"INTEGER",
"KW_CLASS",
"KW_INTERFACE",
"KW_TRAIT",
"KW_ENUM",
"KW_PACKAGE",
"KW_IMPORT",
"KW_EXTENDS",
"KW_IMPLEMENTS",
"KW_DEF",
"KW_NULL",
"KW_TRUE",
"KW_FALSE",
"KW_NEW",
"KW_SUPER",
"KW_THIS",
"KW_IN",
"KW_FOR",
"KW_IF",
"KW_ELSE",
"KW_DO",
"KW_WHILE",
"KW_SWITCH",
"KW_CASE",
"KW_DEFAULT",
"KW_CONTINUE",
"KW_BREAK",
"KW_RETURN",
"KW_TRY",
"KW_CATCH",
"KW_FINALLY",
"KW_THROW",
"KW_THROWS",
"KW_ASSERT",
"KW_CONST",
"KW_GOTO",
"RUSHIFT_ASSIGN",
"RSHIFT_ASSIGN",
"LSHIFT_ASSIGN",
"SPACESHIP",
"ELVIS",
"SAFE_DOT",
"STAR_DOT",
"ATTR_DOT",
"MEMBER_POINTER",
"LTE",
"GTE",
"CLOSURE_ARG_SEPARATOR",
"DECREMENT",
"INCREMENT",
"POWER",
"LSHIFT",
"RANGE",
"ORANGE",
"EQUAL",
"UNEQUAL",
"MATCH",
"FIND",
"AND",
"OR",
"PLUS_ASSIGN",
"MINUS_ASSIGN",
"MULT_ASSIGN",
"DIV_ASSIGN",
"MOD_ASSIGN",
"BAND_ASSIGN",
"XOR_ASSIGN",
"BOR_ASSIGN",
"SEMICOLON",
"DOT",
"COMMA",
"AT",
"ASSIGN",
"LT",
"GT",
"COLON",
"BOR",
"NOT",
"BNOT",
"MULT",
"DIV",
"MOD",
"PLUS",
"MINUS",
"BAND",
"XOR",
"QUESTION",
"ELLIPSIS",
"KW_AS",
"KW_INSTANCEOF",
"BUILT_IN_TYPE",
"VISIBILITY_MODIFIER",
"KW_ABSTRACT",
"KW_STATIC",
"KW_FINAL",
"KW_TRANSIENT",
"KW_NATIVE",
"KW_VOLATILE",
"KW_SYNCHRONIZED",
"KW_STRICTFP",
"KW_THREADSAFE",
"IGNORE_NEWLINE",
"NL",
"IDENTIFIER"
};
}
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;
}
private static final Set<Integer> ALLOWED_OP_SET =
new HashSet<Integer>(
Arrays.asList(
COMMA,
NOT,
BNOT,
PLUS,
ASSIGN,
PLUS_ASSIGN,
LT,
GT,
LTE,
GTE,
EQUAL,
UNEQUAL,
FIND,
MATCH,
DOT,
SAFE_DOT,
STAR_DOT,
ATTR_DOT,
MEMBER_POINTER,
ELVIS,
QUESTION,
COLON,
AND,
OR,
KW_ASSERT,
KW_RETURN)); // the allowed ops before slashy string. e.g. p1=/ab/; p2=~/ab/; p3=!/ab/
private static enum Brace {
ROUND,
SQUARE,
CURVE
};
private Deque<Brace> braceStack = new ArrayDeque<Brace>();
private Brace topBrace = null;
private int lastTokenType = 0;
private long tokenIndex = 0;
private long tlePos = 0;
@Override
public void emit(Token token) {
tokenIndex++;
int tokenType = token.getType();
if (NL != tokenType) { // newline should be ignored
lastTokenType = tokenType;
}
// System.out.println("EM: " + tokenNames[lastTokenType != -1 ? lastTokenType : 0] + ": " +
// lastTokenType + " TLE = " + (tlePos == tokenIndex) + " " + tlePos + "/" + tokenIndex + " " +
// token.getText());
if (tokenType == ROLLBACK_ONE) {
this.rollbackOneChar();
}
super.emit(token);
}
// just a hook, which will be overrided by GroovyLangLexer
protected void rollbackOneChar() {}
private void pushBrace(Brace b) {
braceStack.push(b);
topBrace = braceStack.peekFirst();
// System.out.println("> " + topBrace);
}
private void popBrace() {
braceStack.pop();
topBrace = braceStack.peekFirst();
// System.out.println("> " + topBrace);
}
private boolean isSlashyStringAllowed() {
// System.out.println("SP: " + " TLECheck = " + (tlePos == tokenIndex) + " " + tlePos + "/" +
// tokenIndex);
boolean isLastTokenOp = ALLOWED_OP_SET.contains(Integer.valueOf(lastTokenType));
boolean res = isLastTokenOp || tlePos == tokenIndex;
// System.out.println("SP: " + tokenNames[lastTokenType] + ": " + lastTokenType + " res " + res
// + (res ? ( isLastTokenOp ? " op" : " tle") : ""));
return res;
}
public GroovyLexer(CharStream input) {
super(input);
_interp = new LexerATNSimulator(this, _ATN, _decisionToDFA, _sharedContextCache);
}
@Override
public String getGrammarFileName() {
return "GroovyLexer.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;
}
@Override
public void action(RuleContext _localctx, int ruleIndex, int actionIndex) {
switch (ruleIndex) {
case 5:
LPAREN_action((RuleContext) _localctx, actionIndex);
break;
case 6:
RPAREN_action((RuleContext) _localctx, actionIndex);
break;
case 7:
LBRACK_action((RuleContext) _localctx, actionIndex);
break;
case 8:
RBRACK_action((RuleContext) _localctx, actionIndex);
break;
case 9:
LCURVE_action((RuleContext) _localctx, actionIndex);
break;
case 10:
RCURVE_action((RuleContext) _localctx, actionIndex);
break;
case 42:
GSTRING_BRACE_L_action((RuleContext) _localctx, actionIndex);
break;
}
}
private void LPAREN_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 0:
pushBrace(Brace.ROUND);
tlePos = tokenIndex + 1;
break;
}
}
private void RPAREN_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 1:
popBrace();
break;
}
}
private void LBRACK_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 2:
pushBrace(Brace.SQUARE);
tlePos = tokenIndex + 1;
break;
}
}
private void RBRACK_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 3:
popBrace();
break;
}
}
private void LCURVE_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 4:
pushBrace(Brace.CURVE);
tlePos = tokenIndex + 1;
break;
}
}
private void RCURVE_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 5:
popBrace();
break;
}
}
private void GSTRING_BRACE_L_action(RuleContext _localctx, int actionIndex) {
switch (actionIndex) {
case 6:
pushBrace(Brace.CURVE);
tlePos = tokenIndex + 1;
break;
}
}
@Override
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch (ruleIndex) {
case 3:
return SHEBANG_COMMENT_sempred((RuleContext) _localctx, predIndex);
case 14:
return SLASHY_STRING_sempred((RuleContext) _localctx, predIndex);
case 15:
return DOLLAR_SLASHY_STRING_sempred((RuleContext) _localctx, predIndex);
case 17:
return SLASHY_GSTRING_START_sempred((RuleContext) _localctx, predIndex);
case 18:
return DOLLAR_SLASHY_GSTRING_START_sempred((RuleContext) _localctx, predIndex);
case 19:
return SLASHY_STRING_ELEMENT_sempred((RuleContext) _localctx, predIndex);
case 20:
return DOLLAR_SLASHY_STRING_ELEMENT_sempred((RuleContext) _localctx, predIndex);
case 21:
return TSQ_STRING_ELEMENT_sempred((RuleContext) _localctx, predIndex);
case 23:
return TDQ_STRING_ELEMENT_sempred((RuleContext) _localctx, predIndex);
case 171:
return IGNORE_NEWLINE_sempred((RuleContext) _localctx, predIndex);
case 178:
return JavaUnicodeChar_sempred((RuleContext) _localctx, predIndex);
}
return true;
}
private boolean SHEBANG_COMMENT_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 0:
return tokenIndex == 0;
}
return true;
}
private boolean SLASHY_STRING_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 1:
return isSlashyStringAllowed();
}
return true;
}
private boolean DOLLAR_SLASHY_STRING_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 2:
return isSlashyStringAllowed();
}
return true;
}
private boolean SLASHY_GSTRING_START_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 3:
return isSlashyStringAllowed();
}
return true;
}
private boolean DOLLAR_SLASHY_GSTRING_START_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 4:
return isSlashyStringAllowed();
}
return true;
}
private boolean SLASHY_STRING_ELEMENT_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 5:
return false;
}
return true;
}
private boolean DOLLAR_SLASHY_STRING_ELEMENT_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 6:
return _input.LA(1) != '$';
case 7:
return false;
}
return true;
}
private boolean TSQ_STRING_ELEMENT_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 8:
return !(_input.LA(1) == '\'' && _input.LA(2) == '\'');
}
return true;
}
private boolean TDQ_STRING_ELEMENT_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 9:
return !(_input.LA(1) == '"' && _input.LA(2) == '"');
}
return true;
}
private boolean IGNORE_NEWLINE_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 10:
return topBrace == Brace.ROUND || topBrace == Brace.SQUARE;
}
return true;
}
private boolean JavaUnicodeChar_sempred(RuleContext _localctx, int predIndex) {
switch (predIndex) {
case 11:
return Character.isJavaIdentifierPart(_input.LA(-1));
case 12:
return Character.isJavaIdentifierPart(
Character.toCodePoint((char) _input.LA(-2), (char) _input.LA(-1)));
}
return true;
}
public static final String _serializedATN =
"\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2y\u05a8\b\1\b\1\b"
+ "\1\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!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4"
+ "(\t(\4)\t)\4*\t*\4+\t+\4,\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62"
+ "\t\62\4\63\t\63\4\64\t\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4"
+ ":\t:\4;\t;\4<\t<\4=\t=\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\t"
+ "E\4F\tF\4G\tG\4H\tH\4I\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4"
+ "Q\tQ\4R\tR\4S\tS\4T\tT\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\4Z\tZ\4[\t[\4\\\t"
+ "\\\4]\t]\4^\t^\4_\t_\4`\t`\4a\ta\4b\tb\4c\tc\4d\td\4e\te\4f\tf\4g\tg\4"
+ "h\th\4i\ti\4j\tj\4k\tk\4l\tl\4m\tm\4n\tn\4o\to\4p\tp\4q\tq\4r\tr\4s\t"
+ "s\4t\tt\4u\tu\4v\tv\4w\tw\4x\tx\4y\ty\4z\tz\4{\t{\4|\t|\4}\t}\4~\t~\4"
+ "\177\t\177\4\u0080\t\u0080\4\u0081\t\u0081\4\u0082\t\u0082\4\u0083\t\u0083"
+ "\4\u0084\t\u0084\4\u0085\t\u0085\4\u0086\t\u0086\4\u0087\t\u0087\4\u0088"
+ "\t\u0088\4\u0089\t\u0089\4\u008a\t\u008a\4\u008b\t\u008b\4\u008c\t\u008c"
+ "\4\u008d\t\u008d\4\u008e\t\u008e\4\u008f\t\u008f\4\u0090\t\u0090\4\u0091"
+ "\t\u0091\4\u0092\t\u0092\4\u0093\t\u0093\4\u0094\t\u0094\4\u0095\t\u0095"
+ "\4\u0096\t\u0096\4\u0097\t\u0097\4\u0098\t\u0098\4\u0099\t\u0099\4\u009a"
+ "\t\u009a\4\u009b\t\u009b\4\u009c\t\u009c\4\u009d\t\u009d\4\u009e\t\u009e"
+ "\4\u009f\t\u009f\4\u00a0\t\u00a0\4\u00a1\t\u00a1\4\u00a2\t\u00a2\4\u00a3"
+ "\t\u00a3\4\u00a4\t\u00a4\4\u00a5\t\u00a5\4\u00a6\t\u00a6\4\u00a7\t\u00a7"
+ "\4\u00a8\t\u00a8\4\u00a9\t\u00a9\4\u00aa\t\u00aa\4\u00ab\t\u00ab\4\u00ac"
+ "\t\u00ac\4\u00ad\t\u00ad\4\u00ae\t\u00ae\4\u00af\t\u00af\4\u00b0\t\u00b0"
+ "\4\u00b1\t\u00b1\4\u00b2\t\u00b2\4\u00b3\t\u00b3\4\u00b4\t\u00b4\3\2\3"
+ "\2\3\2\3\2\7\2\u0174\n\2\f\2\16\2\u0177\13\2\3\2\5\2\u017a\n\2\3\2\3\2"
+ "\3\3\3\3\3\3\3\3\3\3\7\3\u0183\n\3\f\3\16\3\u0186\13\3\3\3\3\3\3\3\3\3"
+ "\3\3\3\4\3\4\3\4\3\4\7\4\u0191\n\4\f\4\16\4\u0194\13\4\3\4\3\4\3\4\3\4"
+ "\3\4\3\5\3\5\3\5\3\5\3\5\7\5\u01a0\n\5\f\5\16\5\u01a3\13\5\3\5\3\5\3\5"
+ "\3\5\3\6\6\6\u01aa\n\6\r\6\16\6\u01ab\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\b"
+ "\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13"
+ "\3\13\3\13\3\f\3\f\3\f\3\f\3\f\3\r\3\r\7\r\u01d0\n\r\f\r\16\r\u01d3\13"
+ "\r\3\r\3\r\3\r\3\r\7\r\u01d9\n\r\f\r\16\r\u01dc\13\r\3\r\3\r\5\r\u01e0"
+ "\n\r\3\r\3\r\3\16\3\16\7\16\u01e6\n\16\f\16\16\16\u01e9\13\16\3\16\3\16"
+ "\3\16\3\16\3\16\3\16\3\17\3\17\7\17\u01f3\n\17\f\17\16\17\u01f6\13\17"
+ "\3\17\3\17\3\17\7\17\u01fb\n\17\f\17\16\17\u01fe\13\17\3\17\5\17\u0201"
+ "\n\17\3\20\3\20\3\20\6\20\u0206\n\20\r\20\16\20\u0207\3\20\3\20\3\20\3"
+ "\20\3\21\3\21\3\21\7\21\u0211\n\21\f\21\16\21\u0214\13\21\3\21\3\21\3"
+ "\21\3\21\3\22\3\22\7\22\u021c\n\22\f\22\16\22\u021f\13\22\3\22\3\22\3"
+ "\22\3\22\3\22\3\23\3\23\3\23\7\23\u0229\n\23\f\23\16\23\u022c\13\23\3"
+ "\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\7\24\u0237\n\24\f\24\16\24"
+ "\u023a\13\24\3\24\3\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\5\25\u0246"
+ "\n\25\3\26\3\26\3\26\3\26\3\26\3\26\5\26\u024e\n\26\3\27\3\27\3\27\3\27"
+ "\3\27\3\27\5\27\u0256\n\27\3\30\3\30\3\30\3\30\5\30\u025c\n\30\3\31\3"
+ "\31\3\31\3\31\3\31\3\31\5\31\u0264\n\31\3\32\3\32\3\32\3\32\5\32\u026a"
+ "\n\32\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\36\3\36"
+ "\3\36\3\37\3\37\7\37\u027c\n\37\f\37\16\37\u027f\13\37\3 \3 \3 \3 \3 "
+ "\3!\3!\3!\3!\3!\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3$\3$\3$\3$\3%\3%\3%\3%\3"
+ "&\5&\u029c\n&\3&\3&\3&\3&\3&\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3)\3)\3)"
+ "\3)\3)\3*\3*\3*\3*\3*\3+\3+\3+\3+\3,\3,\3,\3,\3,\3,\3,\3-\3-\3-\3-\3-"
+ "\3-\3.\3.\3.\3/\3/\3/\3/\3/\3\60\3\60\3\60\3\61\3\61\3\61\3\62\3\62\5"
+ "\62\u02d7\n\62\3\62\3\62\3\63\3\63\3\63\3\63\5\63\u02df\n\63\3\64\3\64"
+ "\5\64\u02e3\n\64\3\64\5\64\u02e6\n\64\3\64\3\64\3\65\3\65\3\65\3\65\3"
+ "\65\3\65\3\65\3\66\3\66\3\66\3\66\5\66\u02f5\n\66\3\66\5\66\u02f8\n\66"
+ "\3\66\5\66\u02fb\n\66\3\66\3\66\3\66\5\66\u0300\n\66\3\67\3\67\3\67\3"
+ "\67\5\67\u0306\n\67\3\67\3\67\3\67\3\67\3\67\5\67\u030d\n\67\3\67\3\67"
+ "\3\67\3\67\5\67\u0313\n\67\3\67\5\67\u0316\n\67\38\38\38\38\78\u031c\n"
+ "8\f8\168\u031f\138\38\38\58\u0323\n8\39\39\39\39\79\u0329\n9\f9\169\u032c"
+ "\139\39\59\u032f\n9\3:\3:\3:\3:\7:\u0335\n:\f:\16:\u0338\13:\3:\3:\5:"
+ "\u033c\n:\3;\3;\3<\3<\3<\3<\7<\u0344\n<\f<\16<\u0347\13<\3<\3<\5<\u034b"
+ "\n<\3=\3=\3>\3>\3>\3>\7>\u0353\n>\f>\16>\u0356\13>\3>\3>\5>\u035a\n>\3"
+ "?\3?\3@\3@\3A\3A\5A\u0362\nA\3A\6A\u0365\nA\rA\16A\u0366\3B\3B\3C\3C\3"
+ "D\3D\3E\3E\3F\3F\3F\3F\3F\3F\3G\3G\3G\3G\3G\3G\3G\3G\3G\3G\3H\3H\3H\3"
+ "H\3H\3H\3I\3I\3I\3I\3I\3J\3J\3J\3J\3J\3J\3J\3J\3K\3K\3K\3K\3K\3K\3K\3"
+ "L\3L\3L\3L\3L\3L\3L\3L\3M\3M\3M\3M\3M\3M\3M\3M\3M\3M\3M\3N\3N\3N\3N\3"
+ "O\3O\3O\3O\3O\3P\3P\3P\3P\3P\3Q\3Q\3Q\3Q\3Q\3Q\3R\3R\3R\3R\3S\3S\3S\3"
+ "S\3S\3S\3T\3T\3T\3T\3T\3U\3U\3U\3V\3V\3V\3V\3W\3W\3W\3X\3X\3X\3X\3X\3"
+ "Y\3Y\3Y\3Z\3Z\3Z\3Z\3Z\3Z\3[\3[\3[\3[\3[\3[\3[\3\\\3\\\3\\\3\\\3\\\3]"
+ "\3]\3]\3]\3]\3]\3]\3]\3^\3^\3^\3^\3^\3^\3^\3^\3^\3_\3_\3_\3_\3_\3_\3`"
+ "\3`\3`\3`\3`\3`\3`\3a\3a\3a\3a\3b\3b\3b\3b\3b\3b\3c\3c\3c\3c\3c\3c\3c"
+ "\3c\3d\3d\3d\3d\3d\3d\3e\3e\3e\3e\3e\3e\3e\3f\3f\3f\3f\3f\3f\3f\3g\3g"
+ "\3g\3g\3g\3g\3h\3h\3h\3h\3h\3i\3i\3i\3i\3i\3j\3j\3j\3j\3k\3k\3k\3k\3l"
+ "\3l\3l\3l\3m\3m\3m\3n\3n\3n\3o\3o\3o\3p\3p\3p\3q\3q\3q\3r\3r\3r\3s\3s"
+ "\3s\3t\3t\3t\3u\3u\3u\3v\3v\3v\3w\3w\3w\3x\3x\3x\3y\3y\3y\3z\3z\3z\3z"
+ "\3{\3{\3{\3|\3|\3|\3}\3}\3}\3}\3~\3~\3~\3\177\3\177\3\177\3\u0080\3\u0080"
+ "\3\u0080\3\u0081\3\u0081\3\u0081\3\u0082\3\u0082\3\u0082\3\u0083\3\u0083"
+ "\3\u0083\3\u0084\3\u0084\3\u0084\3\u0085\3\u0085\3\u0085\3\u0086\3\u0086"
+ "\3\u0086\3\u0087\3\u0087\3\u0087\3\u0088\3\u0088\3\u0088\3\u0089\3\u0089"
+ "\3\u008a\3\u008a\3\u008b\3\u008b\3\u008c\3\u008c\3\u008d\3\u008d\3\u008e"
+ "\3\u008e\3\u008f\3\u008f\3\u0090\3\u0090\3\u0091\3\u0091\3\u0092\3\u0092"
+ "\3\u0093\3\u0093\3\u0094\3\u0094\3\u0095\3\u0095\3\u0096\3\u0096\3\u0097"
+ "\3\u0097\3\u0098\3\u0098\3\u0099\3\u0099\3\u009a\3\u009a\3\u009b\3\u009b"
+ "\3\u009c\3\u009c\3\u009c\3\u009c\3\u009d\3\u009d\3\u009d\3\u009e\3\u009e"
+ "\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e"
+ "\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f"
+ "\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f"
+ "\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f"
+ "\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f"
+ "\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\3\u009f\5\u009f\u050d\n\u009f"
+ "\3\u00a0\3\u00a0\3\u00a0\5\u00a0\u0512\n\u00a0\3\u00a1\3\u00a1\3\u00a1"
+ "\3\u00a1\3\u00a1\3\u00a1\3\u00a1\3\u00a2\3\u00a2\3\u00a2\3\u00a2\3\u00a2"
+ "\3\u00a2\3\u00a2\3\u00a2\3\u00a2\3\u00a2\3\u00a3\3\u00a3\3\u00a3\3\u00a3"
+ "\3\u00a3\3\u00a3\3\u00a3\3\u00a3\3\u00a4\3\u00a4\3\u00a4\3\u00a4\3\u00a4"
+ "\3\u00a4\3\u00a4\3\u00a4\3\u00a4\3\u00a5\3\u00a5\3\u00a5\3\u00a5\3\u00a5"
+ "\3\u00a5\3\u00a5\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a6\3\u00a7"
+ "\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a7"
+ "\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a9\3\u00a9"
+ "\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00aa\3\u00aa"
+ "\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00aa\3\u00aa"
+ "\3\u00aa\3\u00aa\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ab"
+ "\3\u00ab\3\u00ab\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00ac"
+ "\3\u00ac\3\u00ac\3\u00ac\3\u00ac\3\u00ad\5\u00ad\u057f\n\u00ad\3\u00ad"
+ "\3\u00ad\3\u00ad\3\u00ad\3\u00ad\3\u00ae\5\u00ae\u0587\n\u00ae\3\u00ae"
+ "\3\u00ae\3\u00af\3\u00af\7\u00af\u058d\n\u00af\f\u00af\16\u00af\u0590"
+ "\13\u00af\3\u00b0\3\u00b0\5\u00b0\u0594\n\u00b0\3\u00b1\3\u00b1\5\u00b1"
+ "\u0598\n\u00b1\3\u00b2\3\u00b2\5\u00b2\u059c\n\u00b2\3\u00b3\3\u00b3\5"
+ "\u00b3\u05a0\n\u00b3\3\u00b4\3\u00b4\3\u00b4\3\u00b4\3\u00b4\5\u00b4\u05a7"
+ "\n\u00b4\20\u0175\u0184\u0192\u01a1\u01d1\u01da\u01e7\u01f4\u01fc\u0207"
+ "\u0212\u021d\u022a\u0238\2\u00b5\t\2\13\2\r\2\17\3\21\4\23\5\25\6\27\7"
+ "\31\b\33\t\35\n\37\2!\2#\13%\2\'\2)\f+\2-\2/\2\61\2\63\2\65\2\67\29\2"
+ ";\2=\2?\2A\2C\2E\2G\2I\2K\rM\16O\2Q\2S\2U\2W\2Y\2[\2]\2_\2a\17c\20e\2"
+ "g\2i\2k\2m\2o\2q\21s\22u\2w\2y\2{\2}\2\177\2\u0081\2\u0083\2\u0085\2\u0087"
+ "\2\u0089\2\u008b\2\u008d\2\u008f\2\u0091\23\u0093\24\u0095\25\u0097\26"
+ "\u0099\27\u009b\30\u009d\31\u009f\32\u00a1\33\u00a3\34\u00a5\35\u00a7"
+ "\36\u00a9\37\u00ab \u00ad!\u00af\"\u00b1#\u00b3$\u00b5%\u00b7&\u00b9\'"
+ "\u00bb(\u00bd)\u00bf*\u00c1+\u00c3,\u00c5-\u00c7.\u00c9/\u00cb\60\u00cd"
+ "\61\u00cf\62\u00d1\63\u00d3\64\u00d5\65\u00d7\66\u00d9\67\u00db8\u00dd"
+ "9\u00df:\u00e1;\u00e3<\u00e5=\u00e7>\u00e9?\u00eb@\u00edA\u00efB\u00f1"
+ "C\u00f3D\u00f5E\u00f7F\u00f9G\u00fbH\u00fdI\u00ffJ\u0101K\u0103L\u0105"
+ "M\u0107N\u0109O\u010bP\u010dQ\u010fR\u0111S\u0113T\u0115U\u0117V\u0119"
+ "W\u011bX\u011dY\u011fZ\u0121[\u0123\\\u0125]\u0127^\u0129_\u012b`\u012d"
+ "a\u012fb\u0131c\u0133d\u0135e\u0137f\u0139g\u013bh\u013di\u013fj\u0141"
+ "k\u0143l\u0145m\u0147\2\u0149\2\u014b\2\u014dn\u014fo\u0151p\u0153q\u0155"
+ "r\u0157s\u0159t\u015bu\u015dv\u015fw\u0161x\u0163y\u0165\2\u0167\2\u0169"
+ "\2\u016b\2\u016d\2\t\2\3\4\5\6\7\b\33\3\3\f\f\4\2\13\13\"\"\6\2\2\2\f"
+ "\f&&\61\61\4\2&&\61\61\4\2))^^\5\2$$&&^^\n\2$$))^^ddhhppttvv\3\2\62\65"
+ "\3\2\63;\3\2\629\5\2\62;CHch\3\2\62\63\4\2--//\4\2GGgg\3\2\62;\b\2IIK"
+ "KNNiikknn\6\2FFHIffhi\6\2FFHHffhh\6\2&&C\\aac|\7\2&&\62;C\\aac|\5\2C\\"
+ "aac|\6\2\62;C\\aac|\4\2\2\u0081\ud802\udc01\3\2\ud802\udc01\3\2\udc02"
+ "\ue001\2\u05d2\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\2!\3\2\2\2\2#\3\2\2\2\2%\3\2\2\2\2\'\3"
+ "\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2q\3\2\2\2\2s\3\2\2\2\2\u0091"
+ "\3\2\2\2\2\u0093\3\2\2\2\2\u0095\3\2\2\2\2\u0097\3\2\2\2\2\u0099\3\2\2"
+ "\2\2\u009b\3\2\2\2\2\u009d\3\2\2\2\2\u009f\3\2\2\2\2\u00a1\3\2\2\2\2\u00a3"
+ "\3\2\2\2\2\u00a5\3\2\2\2\2\u00a7\3\2\2\2\2\u00a9\3\2\2\2\2\u00ab\3\2\2"
+ "\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2\2\2\u00b3\3\2\2\2\2\u00b5"
+ "\3\2\2\2\2\u00b7\3\2\2\2\2\u00b9\3\2\2\2\2\u00bb\3\2\2\2\2\u00bd\3\2\2"
+ "\2\2\u00bf\3\2\2\2\2\u00c1\3\2\2\2\2\u00c3\3\2\2\2\2\u00c5\3\2\2\2\2\u00c7"
+ "\3\2\2\2\2\u00c9\3\2\2\2\2\u00cb\3\2\2\2\2\u00cd\3\2\2\2\2\u00cf\3\2\2"
+ "\2\2\u00d1\3\2\2\2\2\u00d3\3\2\2\2\2\u00d5\3\2\2\2\2\u00d7\3\2\2\2\2\u00d9"
+ "\3\2\2\2\2\u00db\3\2\2\2\2\u00dd\3\2\2\2\2\u00df\3\2\2\2\2\u00e1\3\2\2"
+ "\2\2\u00e3\3\2\2\2\2\u00e5\3\2\2\2\2\u00e7\3\2\2\2\2\u00e9\3\2\2\2\2\u00eb"
+ "\3\2\2\2\2\u00ed\3\2\2\2\2\u00ef\3\2\2\2\2\u00f1\3\2\2\2\2\u00f3\3\2\2"
+ "\2\2\u00f5\3\2\2\2\2\u00f7\3\2\2\2\2\u00f9\3\2\2\2\2\u00fb\3\2\2\2\2\u00fd"
+ "\3\2\2\2\2\u00ff\3\2\2\2\2\u0101\3\2\2\2\2\u0103\3\2\2\2\2\u0105\3\2\2"
+ "\2\2\u0107\3\2\2\2\2\u0109\3\2\2\2\2\u010b\3\2\2\2\2\u010d\3\2\2\2\2\u010f"
+ "\3\2\2\2\2\u0111\3\2\2\2\2\u0113\3\2\2\2\2\u0115\3\2\2\2\2\u0117\3\2\2"
+ "\2\2\u0119\3\2\2\2\2\u011b\3\2\2\2\2\u011d\3\2\2\2\2\u011f\3\2\2\2\2\u0121"
+ "\3\2\2\2\2\u0123\3\2\2\2\2\u0125\3\2\2\2\2\u0127\3\2\2\2\2\u0129\3\2\2"
+ "\2\2\u012b\3\2\2\2\2\u012d\3\2\2\2\2\u012f\3\2\2\2\2\u0131\3\2\2\2\2\u0133"
+ "\3\2\2\2\2\u0135\3\2\2\2\2\u0137\3\2\2\2\2\u0139\3\2\2\2\2\u013b\3\2\2"
+ "\2\2\u013d\3\2\2\2\2\u013f\3\2\2\2\2\u0141\3\2\2\2\2\u0143\3\2\2\2\2\u0145"
+ "\3\2\2\2\2\u014d\3\2\2\2\2\u014f\3\2\2\2\2\u0151\3\2\2\2\2\u0153\3\2\2"
+ "\2\2\u0155\3\2\2\2\2\u0157\3\2\2\2\2\u0159\3\2\2\2\2\u015b\3\2\2\2\2\u015d"
+ "\3\2\2\2\2\u015f\3\2\2\2\2\u0161\3\2\2\2\2\u0163\3\2\2\2\3E\3\2\2\2\3"
+ "G\3\2\2\2\3I\3\2\2\2\4K\3\2\2\2\4M\3\2\2\2\4O\3\2\2\2\5Q\3\2\2\2\5S\3"
+ "\2\2\2\5U\3\2\2\2\6W\3\2\2\2\6Y\3\2\2\2\6[\3\2\2\2\7]\3\2\2\2\7_\3\2\2"
+ "\2\ba\3\2\2\2\bc\3\2\2\2\t\u016f\3\2\2\2\13\u017d\3\2\2\2\r\u018c\3\2"
+ "\2\2\17\u019a\3\2\2\2\21\u01a9\3\2\2\2\23\u01af\3\2\2\2\25\u01b4\3\2\2"
+ "\2\27\u01b9\3\2\2\2\31\u01be\3\2\2\2\33\u01c3\3\2\2\2\35\u01c8\3\2\2\2"
+ "\37\u01df\3\2\2\2!\u01e3\3\2\2\2#\u0200\3\2\2\2%\u0202\3\2\2\2\'\u020d"
+ "\3\2\2\2)\u0219\3\2\2\2+\u0225\3\2\2\2-\u0233\3\2\2\2/\u0245\3\2\2\2\61"
+ "\u024d\3\2\2\2\63\u0255\3\2\2\2\65\u025b\3\2\2\2\67\u0263\3\2\2\29\u0269"
+ "\3\2\2\2;\u026b\3\2\2\2=\u026f\3\2\2\2?\u0273\3\2\2\2A\u0276\3\2\2\2C"
+ "\u0279\3\2\2\2E\u0280\3\2\2\2G\u0285\3\2\2\2I\u028a\3\2\2\2K\u028e\3\2"
+ "\2\2M\u0292\3\2\2\2O\u0296\3\2\2\2Q\u029b\3\2\2\2S\u02a2\3\2\2\2U\u02a7"
+ "\3\2\2\2W\u02ab\3\2\2\2Y\u02b0\3\2\2\2[\u02b5\3\2\2\2]\u02b9\3\2\2\2_"
+ "\u02c0\3\2\2\2a\u02c6\3\2\2\2c\u02c9\3\2\2\2e\u02ce\3\2\2\2g\u02d1\3\2"
+ "\2\2i\u02d4\3\2\2\2k\u02de\3\2\2\2m\u02e0\3\2\2\2o\u02e9\3\2\2\2q\u02ff"
+ "\3\2\2\2s\u0312\3\2\2\2u\u0322\3\2\2\2w\u032e\3\2\2\2y\u033b\3\2\2\2{"
+ "\u033d\3\2\2\2}\u034a\3\2\2\2\177\u034c\3\2\2\2\u0081\u0359\3\2\2\2\u0083"
+ "\u035b\3\2\2\2\u0085\u035d\3\2\2\2\u0087\u035f\3\2\2\2\u0089\u0368\3\2"
+ "\2\2\u008b\u036a\3\2\2\2\u008d\u036c\3\2\2\2\u008f\u036e\3\2\2\2\u0091"
+ "\u0370\3\2\2\2\u0093\u0376\3\2\2\2\u0095\u0380\3\2\2\2\u0097\u0386\3\2"
+ "\2\2\u0099\u038b\3\2\2\2\u009b\u0393\3\2\2\2\u009d\u039a\3\2\2\2\u009f"
+ "\u03a2\3\2\2\2\u00a1\u03ad\3\2\2\2\u00a3\u03b1\3\2\2\2\u00a5\u03b6\3\2"
+ "\2\2\u00a7\u03bb\3\2\2\2\u00a9\u03c1\3\2\2\2\u00ab\u03c5\3\2\2\2\u00ad"
+ "\u03cb\3\2\2\2\u00af\u03d0\3\2\2\2\u00b1\u03d3\3\2\2\2\u00b3\u03d7\3\2"
+ "\2\2\u00b5\u03da\3\2\2\2\u00b7\u03df\3\2\2\2\u00b9\u03e2\3\2\2\2\u00bb"
+ "\u03e8\3\2\2\2\u00bd\u03ef\3\2\2\2\u00bf\u03f4\3\2\2\2\u00c1\u03fc\3\2"
+ "\2\2\u00c3\u0405\3\2\2\2\u00c5\u040b\3\2\2\2\u00c7\u0412\3\2\2\2\u00c9"
+ "\u0416\3\2\2\2\u00cb\u041c\3\2\2\2\u00cd\u0424\3\2\2\2\u00cf\u042a\3\2"
+ "\2\2\u00d1\u0431\3\2\2\2\u00d3\u0438\3\2\2\2\u00d5\u043e\3\2\2\2\u00d7"
+ "\u0443\3\2\2\2\u00d9\u0448\3\2\2\2\u00db\u044c\3\2\2\2\u00dd\u0450\3\2"
+ "\2\2\u00df\u0454\3\2\2\2\u00e1\u0457\3\2\2\2\u00e3\u045a\3\2\2\2\u00e5"
+ "\u045d\3\2\2\2\u00e7\u0460\3\2\2\2\u00e9\u0463\3\2\2\2\u00eb\u0466\3\2"
+ "\2\2\u00ed\u0469\3\2\2\2\u00ef\u046c\3\2\2\2\u00f1\u046f\3\2\2\2\u00f3"
+ "\u0472\3\2\2\2\u00f5\u0475\3\2\2\2\u00f7\u0478\3\2\2\2\u00f9\u047b\3\2"
+ "\2\2\u00fb\u047f\3\2\2\2\u00fd\u0482\3\2\2\2\u00ff\u0485\3\2\2\2\u0101"
+ "\u0489\3\2\2\2\u0103\u048c\3\2\2\2\u0105\u048f\3\2\2\2\u0107\u0492\3\2"
+ "\2\2\u0109\u0495\3\2\2\2\u010b\u0498\3\2\2\2\u010d\u049b\3\2\2\2\u010f"
+ "\u049e\3\2\2\2\u0111\u04a1\3\2\2\2\u0113\u04a4\3\2\2\2\u0115\u04a7\3\2"
+ "\2\2\u0117\u04aa\3\2\2\2\u0119\u04ac\3\2\2\2\u011b\u04ae\3\2\2\2\u011d"
+ "\u04b0\3\2\2\2\u011f\u04b2\3\2\2\2\u0121\u04b4\3\2\2\2\u0123\u04b6\3\2"
+ "\2\2\u0125\u04b8\3\2\2\2\u0127\u04ba\3\2\2\2\u0129\u04bc\3\2\2\2\u012b"
+ "\u04be\3\2\2\2\u012d\u04c0\3\2\2\2\u012f\u04c2\3\2\2\2\u0131\u04c4\3\2"
+ "\2\2\u0133\u04c6\3\2\2\2\u0135\u04c8\3\2\2\2\u0137\u04ca\3\2\2\2\u0139"
+ "\u04cc\3\2\2\2\u013b\u04ce\3\2\2\2\u013d\u04d0\3\2\2\2\u013f\u04d4\3\2"
+ "\2\2\u0141\u04d7\3\2\2\2\u0143\u050c\3\2\2\2\u0145\u0511\3\2\2\2\u0147"
+ "\u0513\3\2\2\2\u0149\u051a\3\2\2\2\u014b\u0524\3\2\2\2\u014d\u052c\3\2"
+ "\2\2\u014f\u0535\3\2\2\2\u0151\u053c\3\2\2\2\u0153\u0542\3\2\2\2\u0155"
+ "\u054c\3\2\2\2\u0157\u0553\3\2\2\2\u0159\u055c\3\2\2\2\u015b\u0569\3\2"
+ "\2\2\u015d\u0572\3\2\2\2\u015f\u057e\3\2\2\2\u0161\u0586\3\2\2\2\u0163"
+ "\u058a\3\2\2\2\u0165\u0593\3\2\2\2\u0167\u0597\3\2\2\2\u0169\u059b\3\2"
+ "\2\2\u016b\u059f\3\2\2\2\u016d\u05a6\3\2\2\2\u016f\u0170\7\61\2\2\u0170"
+ "\u0171\7\61\2\2\u0171\u0175\3\2\2\2\u0172\u0174\13\2\2\2\u0173\u0172\3"
+ "\2\2\2\u0174\u0177\3\2\2\2\u0175\u0176\3\2\2\2\u0175\u0173\3\2\2\2\u0176"
+ "\u0179\3\2\2\2\u0177\u0175\3\2\2\2\u0178\u017a\t\2\2\2\u0179\u0178\3\2"
+ "\2\2\u017a\u017b\3\2\2\2\u017b\u017c\b\2\2\2\u017c\n\3\2\2\2\u017d\u017e"
+ "\7\61\2\2\u017e\u017f\7,\2\2\u017f\u0180\7,\2\2\u0180\u0184\3\2\2\2\u0181"
+ "\u0183\13\2\2\2\u0182\u0181\3\2\2\2\u0183\u0186\3\2\2\2\u0184\u0185\3"
+ "\2\2\2\u0184\u0182\3\2\2\2\u0185\u0187\3\2\2\2\u0186\u0184\3\2\2\2\u0187"
+ "\u0188\7,\2\2\u0188\u0189\7\61\2\2\u0189\u018a\3\2\2\2\u018a\u018b\b\3"
+ "\2\2\u018b\f\3\2\2\2\u018c\u018d\7\61\2\2\u018d\u018e\7,\2\2\u018e\u0192"
+ "\3\2\2\2\u018f\u0191\13\2\2\2\u0190\u018f\3\2\2\2\u0191\u0194\3\2\2\2"
+ "\u0192\u0193\3\2\2\2\u0192\u0190\3\2\2\2\u0193\u0195\3\2\2\2\u0194\u0192"
+ "\3\2\2\2\u0195\u0196\7,\2\2\u0196\u0197\7\61\2\2\u0197\u0198\3\2\2\2\u0198"
+ "\u0199\b\4\2\2\u0199\16\3\2\2\2\u019a\u019b\6\5\2\2\u019b\u019c\7%\2\2"
+ "\u019c\u019d\7#\2\2\u019d\u01a1\3\2\2\2\u019e\u01a0\13\2\2\2\u019f\u019e"
+ "\3\2\2\2\u01a0\u01a3\3\2\2\2\u01a1\u01a2\3\2\2\2\u01a1\u019f\3\2\2\2\u01a2"
+ "\u01a4\3\2\2\2\u01a3\u01a1\3\2\2\2\u01a4\u01a5\7\f\2\2\u01a5\u01a6\3\2"
+ "\2\2\u01a6\u01a7\b\5\3\2\u01a7\20\3\2\2\2\u01a8\u01aa\t\3\2\2\u01a9\u01a8"
+ "\3\2\2\2\u01aa\u01ab\3\2\2\2\u01ab\u01a9\3\2\2\2\u01ab\u01ac\3\2\2\2\u01ac"
+ "\u01ad\3\2\2\2\u01ad\u01ae\b\6\3\2\u01ae\22\3\2\2\2\u01af\u01b0\7*\2\2"
+ "\u01b0\u01b1\b\7\4\2\u01b1\u01b2\3\2\2\2\u01b2\u01b3\b\7\5\2\u01b3\24"
+ "\3\2\2\2\u01b4\u01b5\7+\2\2\u01b5\u01b6\b\b\6\2\u01b6\u01b7\3\2\2\2\u01b7"
+ "\u01b8\b\b\7\2\u01b8\26\3\2\2\2\u01b9\u01ba\7]\2\2\u01ba\u01bb\b\t\b\2"
+ "\u01bb\u01bc\3\2\2\2\u01bc\u01bd\b\t\5\2\u01bd\30\3\2\2\2\u01be\u01bf"
+ "\7_\2\2\u01bf\u01c0\b\n\t\2\u01c0\u01c1\3\2\2\2\u01c1\u01c2\b\n\7\2\u01c2"
+ "\32\3\2\2\2\u01c3\u01c4\7}\2\2\u01c4\u01c5\b\13\n\2\u01c5\u01c6\3\2\2"
+ "\2\u01c6\u01c7\b\13\5\2\u01c7\34\3\2\2\2\u01c8\u01c9\7\177\2\2\u01c9\u01ca"
+ "\b\f\13\2\u01ca\u01cb\3\2\2\2\u01cb\u01cc\b\f\7\2\u01cc\36\3\2\2\2\u01cd"
+ "\u01d1\5;\33\2\u01ce\u01d0\5\63\27\2\u01cf\u01ce\3\2\2\2\u01d0\u01d3\3"
+ "\2\2\2\u01d1\u01d2\3\2\2\2\u01d1\u01cf\3\2\2\2\u01d2\u01d4\3\2\2\2\u01d3"
+ "\u01d1\3\2\2\2\u01d4\u01d5\5;\33\2\u01d5\u01e0\3\2\2\2\u01d6\u01da\5="
+ "\34\2\u01d7\u01d9\5\67\31\2\u01d8\u01d7\3\2\2\2\u01d9\u01dc\3\2\2\2\u01da"
+ "\u01db\3\2\2\2\u01da\u01d8\3\2\2\2\u01db\u01dd\3\2\2\2\u01dc\u01da\3\2"
+ "\2\2\u01dd\u01de\5=\34\2\u01de\u01e0\3\2\2\2\u01df\u01cd\3\2\2\2\u01df"
+ "\u01d6\3\2\2\2\u01e0\u01e1\3\2\2\2\u01e1\u01e2\b\r\f\2\u01e2 \3\2\2\2"
+ "\u01e3\u01e7\5=\34\2\u01e4\u01e6\5\67\31\2\u01e5\u01e4\3\2\2\2\u01e6\u01e9"
+ "\3\2\2\2\u01e7\u01e8\3\2\2\2\u01e7\u01e5\3\2\2\2\u01e8\u01ea\3\2\2\2\u01e9"
+ "\u01e7\3\2\2\2\u01ea\u01eb\7&\2\2\u01eb\u01ec\3\2\2\2\u01ec\u01ed\b\16"
+ "\r\2\u01ed\u01ee\b\16\16\2\u01ee\u01ef\b\16\17\2\u01ef\"\3\2\2\2\u01f0"
+ "\u01f4\7$\2\2\u01f1\u01f3\59\32\2\u01f2\u01f1\3\2\2\2\u01f3\u01f6\3\2"
+ "\2\2\u01f4\u01f5\3\2\2\2\u01f4\u01f2\3\2\2\2\u01f5\u01f7\3\2\2\2\u01f6"
+ "\u01f4\3\2\2\2\u01f7\u0201\7$\2\2\u01f8\u01fc\7)\2\2\u01f9\u01fb\5\65"
+ "\30\2\u01fa\u01f9\3\2\2\2\u01fb\u01fe\3\2\2\2\u01fc\u01fd\3\2\2\2\u01fc"
+ "\u01fa\3\2\2\2\u01fd\u01ff\3\2\2\2\u01fe\u01fc\3\2\2\2\u01ff\u0201\7)"
+ "\2\2\u0200\u01f0\3\2\2\2\u0200\u01f8\3\2\2\2\u0201$\3\2\2\2\u0202\u0203"
+ "\7\61\2\2\u0203\u0205\6\20\3\2\u0204\u0206\5/\25\2\u0205\u0204\3\2\2\2"
+ "\u0206\u0207\3\2\2\2\u0207\u0208\3\2\2\2\u0207\u0205\3\2\2\2\u0208\u0209"
+ "\3\2\2\2\u0209\u020a\7\61\2\2\u020a\u020b\3\2\2\2\u020b\u020c\b\20\f\2"
+ "\u020c&\3\2\2\2\u020d\u020e\5?\35\2\u020e\u0212\6\21\4\2\u020f\u0211\5"
+ "\61\26\2\u0210\u020f\3\2\2\2\u0211\u0214\3\2\2\2\u0212\u0213\3\2\2\2\u0212"
+ "\u0210\3\2\2\2\u0213\u0215\3\2\2\2\u0214\u0212\3\2\2\2\u0215\u0216\5A"
+ "\36\2\u0216\u0217\3\2\2\2\u0217\u0218\b\21\f\2\u0218(\3\2\2\2\u0219\u021d"
+ "\7$\2\2\u021a\u021c\59\32\2\u021b\u021a\3\2\2\2\u021c\u021f\3\2\2\2\u021d"
+ "\u021e\3\2\2\2\u021d\u021b\3\2\2\2\u021e\u0220\3\2\2\2\u021f\u021d\3\2"
+ "\2\2\u0220\u0221\7&\2\2\u0221\u0222\3\2\2\2\u0222\u0223\b\22\20\2\u0223"
+ "\u0224\b\22\17\2\u0224*\3\2\2\2\u0225\u0226\7\61\2\2\u0226\u022a\6\23"
+ "\5\2\u0227\u0229\5/\25\2\u0228\u0227\3\2\2\2\u0229\u022c\3\2\2\2\u022a"
+ "\u022b\3\2\2\2\u022a\u0228\3\2\2\2\u022b\u022d\3\2\2\2\u022c\u022a\3\2"
+ "\2\2\u022d\u022e\7&\2\2\u022e\u022f\3\2\2\2\u022f\u0230\b\23\r\2\u0230"
+ "\u0231\b\23\21\2\u0231\u0232\b\23\17\2\u0232,\3\2\2\2\u0233\u0234\5?\35"
+ "\2\u0234\u0238\6\24\6\2\u0235\u0237\5\61\26\2\u0236\u0235\3\2\2\2\u0237"
+ "\u023a\3\2\2\2\u0238\u0239\3\2\2\2\u0238\u0236\3\2\2\2\u0239\u023b\3\2"
+ "\2\2\u023a\u0238\3\2\2\2\u023b\u023c\7&\2\2\u023c\u023d\3\2\2\2\u023d"
+ "\u023e\b\24\r\2\u023e\u023f\b\24\22\2\u023f\u0240\b\24\17\2\u0240.\3\2"
+ "\2\2\u0241\u0246\5e\60\2\u0242\u0243\7&\2\2\u0243\u0246\6\25\7\2\u0244"
+ "\u0246\n\4\2\2\u0245\u0241\3\2\2\2\u0245\u0242\3\2\2\2\u0245\u0244\3\2"
+ "\2\2\u0246\60\3\2\2\2\u0247\u024e\5e\60\2\u0248\u0249\7\61\2\2\u0249\u024e"
+ "\6\26\b\2\u024a\u024b\7&\2\2\u024b\u024e\6\26\t\2\u024c\u024e\n\5\2\2"
+ "\u024d\u0247\3\2\2\2\u024d\u0248\3\2\2\2\u024d\u024a\3\2\2\2\u024d\u024c"
+ "\3\2\2\2\u024e\62\3\2\2\2\u024f\u0256\5k\63\2\u0250\u0256\5g\61\2\u0251"
+ "\u0256\5i\62\2\u0252\u0253\7)\2\2\u0253\u0256\6\27\n\2\u0254\u0256\n\6"
+ "\2\2\u0255\u024f\3\2\2\2\u0255\u0250\3\2\2\2\u0255\u0251\3\2\2\2\u0255"
+ "\u0252\3\2\2\2\u0255\u0254\3\2\2\2\u0256\64\3\2\2\2\u0257\u025c\5k\63"
+ "\2\u0258\u025c\5g\61\2\u0259\u025c\5i\62\2\u025a\u025c\n\6\2\2\u025b\u0257"
+ "\3\2\2\2\u025b\u0258\3\2\2\2\u025b\u0259\3\2\2\2\u025b\u025a\3\2\2\2\u025c"
+ "\66\3\2\2\2\u025d\u0264\5k\63\2\u025e\u0264\5g\61\2\u025f\u0264\5i\62"
+ "\2\u0260\u0261\7$\2\2\u0261\u0264\6\31\13\2\u0262\u0264\n\7\2\2\u0263"
+ "\u025d\3\2\2\2\u0263\u025e\3\2\2\2\u0263\u025f\3\2\2\2\u0263\u0260\3\2"
+ "\2\2\u0263\u0262\3\2\2\2\u02648\3\2\2\2\u0265\u026a\5k\63\2\u0266\u026a"
+ "\5g\61\2\u0267\u026a\5i\62\2\u0268\u026a\n\7\2\2\u0269\u0265\3\2\2\2\u0269"
+ "\u0266\3\2\2\2\u0269\u0267\3\2\2\2\u0269\u0268\3\2\2\2\u026a:\3\2\2\2"
+ "\u026b\u026c\7)\2\2\u026c\u026d\7)\2\2\u026d\u026e\7)\2\2\u026e<\3\2\2"
+ "\2\u026f\u0270\7$\2\2\u0270\u0271\7$\2\2\u0271\u0272\7$\2\2\u0272>\3\2"
+ "\2\2\u0273\u0274\7&\2\2\u0274\u0275\7\61\2\2\u0275@\3\2\2\2\u0276\u0277"
+ "\7\61\2\2\u0277\u0278\7&\2\2\u0278B\3\2\2\2\u0279\u027d\5\u0169\u00b2"
+ "\2\u027a\u027c\5\u016b\u00b3\2\u027b\u027a\3\2\2\2\u027c\u027f\3\2\2\2"
+ "\u027d\u027b\3\2\2\2\u027d\u027e\3\2\2\2\u027eD\3\2\2\2\u027f\u027d\3"
+ "\2\2\2\u0280\u0281\5=\34\2\u0281\u0282\3\2\2\2\u0282\u0283\b \23\2\u0283"
+ "\u0284\b \7\2\u0284F\3\2\2\2\u0285\u0286\7&\2\2\u0286\u0287\3\2\2\2\u0287"
+ "\u0288\b!\24\2\u0288\u0289\b!\17\2\u0289H\3\2\2\2\u028a\u028b\5\67\31"
+ "\2\u028b\u028c\3\2\2\2\u028c\u028d\b\"\25\2\u028dJ\3\2\2\2\u028e\u028f"
+ "\7$\2\2\u028f\u0290\3\2\2\2\u0290\u0291\b#\7\2\u0291L\3\2\2\2\u0292\u0293"
+ "\7&\2\2\u0293\u0294\3\2\2\2\u0294\u0295\b$\17\2\u0295N\3\2\2\2\u0296\u0297"
+ "\59\32\2\u0297\u0298\3\2\2\2\u0298\u0299\b%\25\2\u0299P\3\2\2\2\u029a"
+ "\u029c\7&\2\2\u029b\u029a\3\2\2\2\u029b\u029c\3\2\2\2\u029c\u029d\3\2"
+ "\2\2\u029d\u029e\7\61\2\2\u029e\u029f\3\2\2\2\u029f\u02a0\b&\23\2\u02a0"
+ "\u02a1\b&\7\2\u02a1R\3\2\2\2\u02a2\u02a3\7&\2\2\u02a3\u02a4\3\2\2\2\u02a4"
+ "\u02a5\b\'\24\2\u02a5\u02a6\b\'\17\2\u02a6T\3\2\2\2\u02a7\u02a8\5/\25"
+ "\2\u02a8\u02a9\3\2\2\2\u02a9\u02aa\b(\25\2\u02aaV\3\2\2\2\u02ab\u02ac"
+ "\5A\36\2\u02ac\u02ad\3\2\2\2\u02ad\u02ae\b)\23\2\u02ae\u02af\b)\7\2\u02af"
+ "X\3\2\2\2\u02b0\u02b1\7&\2\2\u02b1\u02b2\3\2\2\2\u02b2\u02b3\b*\24\2\u02b3"
+ "\u02b4\b*\17\2\u02b4Z\3\2\2\2\u02b5\u02b6\5\61\26\2\u02b6\u02b7\3\2\2"
+ "\2\u02b7\u02b8\b+\25\2\u02b8\\\3\2\2\2\u02b9\u02ba\7}\2\2\u02ba\u02bb"
+ "\b,\26\2\u02bb\u02bc\3\2\2\2\u02bc\u02bd\b,\27\2\u02bd\u02be\b,\7\2\u02be"
+ "\u02bf\b,\5\2\u02bf^\3\2\2\2\u02c0\u02c1\5C\37\2\u02c1\u02c2\3\2\2\2\u02c2"
+ "\u02c3\b-\30\2\u02c3\u02c4\b-\7\2\u02c4\u02c5\b-\31\2\u02c5`\3\2\2\2\u02c6"
+ "\u02c7\7\60\2\2\u02c7\u02c8\5C\37\2\u02c8b\3\2\2\2\u02c9\u02ca\13\2\2"
+ "\2\u02ca\u02cb\3\2\2\2\u02cb\u02cc\b/\7\2\u02cc\u02cd\b/\32\2\u02cdd\3"
+ "\2\2\2\u02ce\u02cf\7^\2\2\u02cf\u02d0\7\61\2\2\u02d0f\3\2\2\2\u02d1\u02d2"
+ "\7^\2\2\u02d2\u02d3\7&\2\2\u02d3h\3\2\2\2\u02d4\u02d6\7^\2\2\u02d5\u02d7"
+ "\7\17\2\2\u02d6\u02d5\3\2\2\2\u02d6\u02d7\3\2\2\2\u02d7\u02d8\3\2\2\2"
+ "\u02d8\u02d9\7\f\2\2\u02d9j\3\2\2\2\u02da\u02db\7^\2\2\u02db\u02df\t\b"
+ "\2\2\u02dc\u02df\5m\64\2\u02dd\u02df\5o\65\2\u02de\u02da\3\2\2\2\u02de"
+ "\u02dc\3\2\2\2\u02de\u02dd\3\2\2\2\u02dfl\3\2\2\2\u02e0\u02e2\7^\2\2\u02e1"
+ "\u02e3\t\t\2\2\u02e2\u02e1\3\2\2\2\u02e2\u02e3\3\2\2\2\u02e3\u02e5\3\2"
+ "\2\2\u02e4\u02e6\5{;\2\u02e5\u02e4\3\2\2\2\u02e5\u02e6\3\2\2\2\u02e6\u02e7"
+ "\3\2\2\2\u02e7\u02e8\5{;\2\u02e8n\3\2\2\2\u02e9\u02ea\7^\2\2\u02ea\u02eb"
+ "\7w\2\2\u02eb\u02ec\5\177=\2\u02ec\u02ed\5\177=\2\u02ed\u02ee\5\177=\2"
+ "\u02ee\u02ef\5\177=\2\u02efp\3\2\2\2\u02f0\u02f7\5u8\2\u02f1\u02f2\7\60"
+ "\2\2\u02f2\u02f4\5u8\2\u02f3\u02f5\5\u0087A\2\u02f4\u02f3\3\2\2\2\u02f4"
+ "\u02f5\3\2\2\2\u02f5\u02f8\3\2\2\2\u02f6\u02f8\5\u0087A\2\u02f7\u02f1"
+ "\3\2\2\2\u02f7\u02f6\3\2\2\2\u02f8\u02fa\3\2\2\2\u02f9\u02fb\5\u008dD"
+ "\2\u02fa\u02f9\3\2\2\2\u02fa\u02fb\3\2\2\2\u02fb\u0300\3\2\2\2\u02fc\u02fd"
+ "\5u8\2\u02fd\u02fe\5\u008fE\2\u02fe\u0300\3\2\2\2\u02ff\u02f0\3\2\2\2"
+ "\u02ff\u02fc\3\2\2\2\u0300r\3\2\2\2\u0301\u0302\7\62\2\2\u0302\u0306\7"
+ "z\2\2\u0303\u0304\7\62\2\2\u0304\u0306\7Z\2\2\u0305\u0301\3\2\2\2\u0305"
+ "\u0303\3\2\2\2\u0306\u0307\3\2\2\2\u0307\u0313\5}<\2\u0308\u0309\7\62"
+ "\2\2\u0309\u030d\7d\2\2\u030a\u030b\7\62\2\2\u030b\u030d\7D\2\2\u030c"
+ "\u0308\3\2\2\2\u030c\u030a\3\2\2\2\u030d\u030e\3\2\2\2\u030e\u0313\5\u0081"
+ ">\2\u030f\u0310\7\62\2\2\u0310\u0313\5y:\2\u0311\u0313\5w9\2\u0312\u0305"
+ "\3\2\2\2\u0312\u030c\3\2\2\2\u0312\u030f\3\2\2\2\u0312\u0311\3\2\2\2\u0313"
+ "\u0315\3\2\2\2\u0314\u0316\5\u008bC\2\u0315\u0314\3\2\2\2\u0315\u0316"
+ "\3\2\2\2\u0316t\3\2\2\2\u0317\u0323\5\u0089B\2\u0318\u031d\5\u0089B\2"
+ "\u0319\u031c\5\u0089B\2\u031a\u031c\7a\2\2\u031b\u0319\3\2\2\2\u031b\u031a"
+ "\3\2\2\2\u031c\u031f\3\2\2\2\u031d\u031b\3\2\2\2\u031d\u031e\3\2\2\2\u031e"
+ "\u0320\3\2\2\2\u031f\u031d\3\2\2\2\u0320\u0321\5\u0089B\2\u0321\u0323"
+ "\3\2\2\2\u0322\u0317\3\2\2\2\u0322\u0318\3\2\2\2\u0323v\3\2\2\2\u0324"
+ "\u032f\5\u0089B\2\u0325\u032a\t\n\2\2\u0326\u0329\5\u0089B\2\u0327\u0329"
+ "\7a\2\2\u0328\u0326\3\2\2\2\u0328\u0327\3\2\2\2\u0329\u032c\3\2\2\2\u032a"
+ "\u0328\3\2\2\2\u032a\u032b\3\2\2\2\u032b\u032d\3\2\2\2\u032c\u032a\3\2"
+ "\2\2\u032d\u032f\5\u0089B\2\u032e\u0324\3\2\2\2\u032e\u0325\3\2\2\2\u032f"
+ "x\3\2\2\2\u0330\u033c\5{;\2\u0331\u0336\5{;\2\u0332\u0335\5{;\2\u0333"
+ "\u0335\7a\2\2\u0334\u0332\3\2\2\2\u0334\u0333\3\2\2\2\u0335\u0338\3\2"
+ "\2\2\u0336\u0334\3\2\2\2\u0336\u0337\3\2\2\2\u0337\u0339\3\2\2\2\u0338"
+ "\u0336\3\2\2\2\u0339\u033a\5{;\2\u033a\u033c\3\2\2\2\u033b\u0330\3\2\2"
+ "\2\u033b\u0331\3\2\2\2\u033cz\3\2\2\2\u033d\u033e\t\13\2\2\u033e|\3\2"
+ "\2\2\u033f\u034b\5\177=\2\u0340\u0345\5\177=\2\u0341\u0344\5\177=\2\u0342"
+ "\u0344\7a\2\2\u0343\u0341\3\2\2\2\u0343\u0342\3\2\2\2\u0344\u0347\3\2"
+ "\2\2\u0345\u0343\3\2\2\2\u0345\u0346\3\2\2\2\u0346\u0348\3\2\2\2\u0347"
+ "\u0345\3\2\2\2\u0348\u0349\5\177=\2\u0349\u034b\3\2\2\2\u034a\u033f\3"
+ "\2\2\2\u034a\u0340\3\2\2\2\u034b~\3\2\2\2\u034c\u034d\t\f\2\2\u034d\u0080"
+ "\3\2\2\2\u034e\u035a\5\u0083?\2\u034f\u0354\5\u0083?\2\u0350\u0353\5\u0083"
+ "?\2\u0351\u0353\7a\2\2\u0352\u0350\3\2\2\2\u0352\u0351\3\2\2\2\u0353\u0356"
+ "\3\2\2\2\u0354\u0352\3\2\2\2\u0354\u0355\3\2\2\2\u0355\u0357\3\2\2\2\u0356"
+ "\u0354\3\2\2\2\u0357\u0358\5\u0083?\2\u0358\u035a\3\2\2\2\u0359\u034e"
+ "\3\2\2\2\u0359\u034f\3\2\2\2\u035a\u0082\3\2\2\2\u035b\u035c\t\r\2\2\u035c"
+ "\u0084\3\2\2\2\u035d\u035e\t\16\2\2\u035e\u0086\3\2\2\2\u035f\u0361\t"
+ "\17\2\2\u0360\u0362\5\u0085@\2\u0361\u0360\3\2\2\2\u0361\u0362\3\2\2\2"
+ "\u0362\u0364\3\2\2\2\u0363\u0365\5\u0089B\2\u0364\u0363\3\2\2\2\u0365"
+ "\u0366\3\2\2\2\u0366\u0364\3\2\2\2\u0366\u0367\3\2\2\2\u0367\u0088\3\2"
+ "\2\2\u0368\u0369\t\20\2\2\u0369\u008a\3\2\2\2\u036a\u036b\t\21\2\2\u036b"
+ "\u008c\3\2\2\2\u036c\u036d\t\22\2\2\u036d\u008e\3\2\2\2\u036e\u036f\t"
+ "\23\2\2\u036f\u0090\3\2\2\2\u0370\u0371\7e\2\2\u0371\u0372\7n\2\2\u0372"
+ "\u0373\7c\2\2\u0373\u0374\7u\2\2\u0374\u0375\7u\2\2\u0375\u0092\3\2\2"
+ "\2\u0376\u0377\7k\2\2\u0377\u0378\7p\2\2\u0378\u0379\7v\2\2\u0379\u037a"
+ "\7g\2\2\u037a\u037b\7t\2\2\u037b\u037c\7h\2\2\u037c\u037d\7c\2\2\u037d"
+ "\u037e\7e\2\2\u037e\u037f\7g\2\2\u037f\u0094\3\2\2\2\u0380\u0381\7v\2"
+ "\2\u0381\u0382\7t\2\2\u0382\u0383\7c\2\2\u0383\u0384\7k\2\2\u0384\u0385"
+ "\7v\2\2\u0385\u0096\3\2\2\2\u0386\u0387\7g\2\2\u0387\u0388\7p\2\2\u0388"
+ "\u0389\7w\2\2\u0389\u038a\7o\2\2\u038a\u0098\3\2\2\2\u038b\u038c\7r\2"
+ "\2\u038c\u038d\7c\2\2\u038d\u038e\7e\2\2\u038e\u038f\7m\2\2\u038f\u0390"
+ "\7c\2\2\u0390\u0391\7i\2\2\u0391\u0392\7g\2\2\u0392\u009a\3\2\2\2\u0393"
+ "\u0394\7k\2\2\u0394\u0395\7o\2\2\u0395\u0396\7r\2\2\u0396\u0397\7q\2\2"
+ "\u0397\u0398\7t\2\2\u0398\u0399\7v\2\2\u0399\u009c\3\2\2\2\u039a\u039b"
+ "\7g\2\2\u039b\u039c\7z\2\2\u039c\u039d\7v\2\2\u039d\u039e\7g\2\2\u039e"
+ "\u039f\7p\2\2\u039f\u03a0\7f\2\2\u03a0\u03a1\7u\2\2\u03a1\u009e\3\2\2"
+ "\2\u03a2\u03a3\7k\2\2\u03a3\u03a4\7o\2\2\u03a4\u03a5\7r\2\2\u03a5\u03a6"
+ "\7n\2\2\u03a6\u03a7\7g\2\2\u03a7\u03a8\7o\2\2\u03a8\u03a9\7g\2\2\u03a9"
+ "\u03aa\7p\2\2\u03aa\u03ab\7v\2\2\u03ab\u03ac\7u\2\2\u03ac\u00a0\3\2\2"
+ "\2\u03ad\u03ae\7f\2\2\u03ae\u03af\7g\2\2\u03af\u03b0\7h\2\2\u03b0\u00a2"
+ "\3\2\2\2\u03b1\u03b2\7p\2\2\u03b2\u03b3\7w\2\2\u03b3\u03b4\7n\2\2\u03b4"
+ "\u03b5\7n\2\2\u03b5\u00a4\3\2\2\2\u03b6\u03b7\7v\2\2\u03b7\u03b8\7t\2"
+ "\2\u03b8\u03b9\7w\2\2\u03b9\u03ba\7g\2\2\u03ba\u00a6\3\2\2\2\u03bb\u03bc"
+ "\7h\2\2\u03bc\u03bd\7c\2\2\u03bd\u03be\7n\2\2\u03be\u03bf\7u\2\2\u03bf"
+ "\u03c0\7g\2\2\u03c0\u00a8\3\2\2\2\u03c1\u03c2\7p\2\2\u03c2\u03c3\7g\2"
+ "\2\u03c3\u03c4\7y\2\2\u03c4\u00aa\3\2\2\2\u03c5\u03c6\7u\2\2\u03c6\u03c7"
+ "\7w\2\2\u03c7\u03c8\7r\2\2\u03c8\u03c9\7g\2\2\u03c9\u03ca\7t\2\2\u03ca"
+ "\u00ac\3\2\2\2\u03cb\u03cc\7v\2\2\u03cc\u03cd\7j\2\2\u03cd\u03ce\7k\2"
+ "\2\u03ce\u03cf\7u\2\2\u03cf\u00ae\3\2\2\2\u03d0\u03d1\7k\2\2\u03d1\u03d2"
+ "\7p\2\2\u03d2\u00b0\3\2\2\2\u03d3\u03d4\7h\2\2\u03d4\u03d5\7q\2\2\u03d5"
+ "\u03d6\7t\2\2\u03d6\u00b2\3\2\2\2\u03d7\u03d8\7k\2\2\u03d8\u03d9\7h\2"
+ "\2\u03d9\u00b4\3\2\2\2\u03da\u03db\7g\2\2\u03db\u03dc\7n\2\2\u03dc\u03dd"
+ "\7u\2\2\u03dd\u03de\7g\2\2\u03de\u00b6\3\2\2\2\u03df\u03e0\7f\2\2\u03e0"
+ "\u03e1\7q\2\2\u03e1\u00b8\3\2\2\2\u03e2\u03e3\7y\2\2\u03e3\u03e4\7j\2"
+ "\2\u03e4\u03e5\7k\2\2\u03e5\u03e6\7n\2\2\u03e6\u03e7\7g\2\2\u03e7\u00ba"
+ "\3\2\2\2\u03e8\u03e9\7u\2\2\u03e9\u03ea\7y\2\2\u03ea\u03eb\7k\2\2\u03eb"
+ "\u03ec\7v\2\2\u03ec\u03ed\7e\2\2\u03ed\u03ee\7j\2\2\u03ee\u00bc\3\2\2"
+ "\2\u03ef\u03f0\7e\2\2\u03f0\u03f1\7c\2\2\u03f1\u03f2\7u\2\2\u03f2\u03f3"
+ "\7g\2\2\u03f3\u00be\3\2\2\2\u03f4\u03f5\7f\2\2\u03f5\u03f6\7g\2\2\u03f6"
+ "\u03f7\7h\2\2\u03f7\u03f8\7c\2\2\u03f8\u03f9\7w\2\2\u03f9\u03fa\7n\2\2"
+ "\u03fa\u03fb\7v\2\2\u03fb\u00c0\3\2\2\2\u03fc\u03fd\7e\2\2\u03fd\u03fe"
+ "\7q\2\2\u03fe\u03ff\7p\2\2\u03ff\u0400\7v\2\2\u0400\u0401\7k\2\2\u0401"
+ "\u0402\7p\2\2\u0402\u0403\7w\2\2\u0403\u0404\7g\2\2\u0404\u00c2\3\2\2"
+ "\2\u0405\u0406\7d\2\2\u0406\u0407\7t\2\2\u0407\u0408\7g\2\2\u0408\u0409"
+ "\7c\2\2\u0409\u040a\7m\2\2\u040a\u00c4\3\2\2\2\u040b\u040c\7t\2\2\u040c"
+ "\u040d\7g\2\2\u040d\u040e\7v\2\2\u040e\u040f\7w\2\2\u040f\u0410\7t\2\2"
+ "\u0410\u0411\7p\2\2\u0411\u00c6\3\2\2\2\u0412\u0413\7v\2\2\u0413\u0414"
+ "\7t\2\2\u0414\u0415\7{\2\2\u0415\u00c8\3\2\2\2\u0416\u0417\7e\2\2\u0417"
+ "\u0418\7c\2\2\u0418\u0419\7v\2\2\u0419\u041a\7e\2\2\u041a\u041b\7j\2\2"
+ "\u041b\u00ca\3\2\2\2\u041c\u041d\7h\2\2\u041d\u041e\7k\2\2\u041e\u041f"
+ "\7p\2\2\u041f\u0420\7c\2\2\u0420\u0421\7n\2\2\u0421\u0422\7n\2\2\u0422"
+ "\u0423\7{\2\2\u0423\u00cc\3\2\2\2\u0424\u0425\7v\2\2\u0425\u0426\7j\2"
+ "\2\u0426\u0427\7t\2\2\u0427\u0428\7q\2\2\u0428\u0429\7y\2\2\u0429\u00ce"
+ "\3\2\2\2\u042a\u042b\7v\2\2\u042b\u042c\7j\2\2\u042c\u042d\7t\2\2\u042d"
+ "\u042e\7q\2\2\u042e\u042f\7y\2\2\u042f\u0430\7u\2\2\u0430\u00d0\3\2\2"
+ "\2\u0431\u0432\7c\2\2\u0432\u0433\7u\2\2\u0433\u0434\7u\2\2\u0434\u0435"
+ "\7g\2\2\u0435\u0436\7t\2\2\u0436\u0437\7v\2\2\u0437\u00d2\3\2\2\2\u0438"
+ "\u0439\7e\2\2\u0439\u043a\7q\2\2\u043a\u043b\7p\2\2\u043b\u043c\7u\2\2"
+ "\u043c\u043d\7v\2\2\u043d\u00d4\3\2\2\2\u043e\u043f\7i\2\2\u043f\u0440"
+ "\7q\2\2\u0440\u0441\7v\2\2\u0441\u0442\7q\2\2\u0442\u00d6\3\2\2\2\u0443"
+ "\u0444\7@\2\2\u0444\u0445\7@\2\2\u0445\u0446\7@\2\2\u0446\u0447\7?\2\2"
+ "\u0447\u00d8\3\2\2\2\u0448\u0449\7@\2\2\u0449\u044a\7@\2\2\u044a\u044b"
+ "\7?\2\2\u044b\u00da\3\2\2\2\u044c\u044d\7>\2\2\u044d\u044e\7>\2\2\u044e"
+ "\u044f\7?\2\2\u044f\u00dc\3\2\2\2\u0450\u0451\7>\2\2\u0451\u0452\7?\2"
+ "\2\u0452\u0453\7@\2\2\u0453\u00de\3\2\2\2\u0454\u0455\7A\2\2\u0455\u0456"
+ "\7<\2\2\u0456\u00e0\3\2\2\2\u0457\u0458\7A\2\2\u0458\u0459\7\60\2\2\u0459"
+ "\u00e2\3\2\2\2\u045a\u045b\7,\2\2\u045b\u045c\7\60\2\2\u045c\u00e4\3\2"
+ "\2\2\u045d\u045e\7\60\2\2\u045e\u045f\7B\2\2\u045f\u00e6\3\2\2\2\u0460"
+ "\u0461\7\60\2\2\u0461\u0462\7(\2\2\u0462\u00e8\3\2\2\2\u0463\u0464\7>"
+ "\2\2\u0464\u0465\7?\2\2\u0465\u00ea\3\2\2\2\u0466\u0467\7@\2\2\u0467\u0468"
+ "\7?\2\2\u0468\u00ec\3\2\2\2\u0469\u046a\7/\2\2\u046a\u046b\7@\2\2\u046b"
+ "\u00ee\3\2\2\2\u046c\u046d\7/\2\2\u046d\u046e\7/\2\2\u046e\u00f0\3\2\2"
+ "\2\u046f\u0470\7-\2\2\u0470\u0471\7-\2\2\u0471\u00f2\3\2\2\2\u0472\u0473"
+ "\7,\2\2\u0473\u0474\7,\2\2\u0474\u00f4\3\2\2\2\u0475\u0476\7>\2\2\u0476"
+ "\u0477\7>\2\2\u0477\u00f6\3\2\2\2\u0478\u0479\7\60\2\2\u0479\u047a\7\60"
+ "\2\2\u047a\u00f8\3\2\2\2\u047b\u047c\7\60\2\2\u047c\u047d\7\60\2\2\u047d"
+ "\u047e\7>\2\2\u047e\u00fa\3\2\2\2\u047f\u0480\7?\2\2\u0480\u0481\7?\2"
+ "\2\u0481\u00fc\3\2\2\2\u0482\u0483\7#\2\2\u0483\u0484\7?\2\2\u0484\u00fe"
+ "\3\2\2\2\u0485\u0486\7?\2\2\u0486\u0487\7?\2\2\u0487\u0488\7\u0080\2\2"
+ "\u0488\u0100\3\2\2\2\u0489\u048a\7?\2\2\u048a\u048b\7\u0080\2\2\u048b"
+ "\u0102\3\2\2\2\u048c\u048d\7(\2\2\u048d\u048e\7(\2\2\u048e\u0104\3\2\2"
+ "\2\u048f\u0490\7~\2\2\u0490\u0491\7~\2\2\u0491\u0106\3\2\2\2\u0492\u0493"
+ "\7-\2\2\u0493\u0494\7?\2\2\u0494\u0108\3\2\2\2\u0495\u0496\7/\2\2\u0496"
+ "\u0497\7?\2\2\u0497\u010a\3\2\2\2\u0498\u0499\7,\2\2\u0499\u049a\7?\2"
+ "\2\u049a\u010c\3\2\2\2\u049b\u049c\7\61\2\2\u049c\u049d\7?\2\2\u049d\u010e"
+ "\3\2\2\2\u049e\u049f\7\'\2\2\u049f\u04a0\7?\2\2\u04a0\u0110\3\2\2\2\u04a1"
+ "\u04a2\7(\2\2\u04a2\u04a3\7?\2\2\u04a3\u0112\3\2\2\2\u04a4\u04a5\7`\2"
+ "\2\u04a5\u04a6\7?\2\2\u04a6\u0114\3\2\2\2\u04a7\u04a8\7~\2\2\u04a8\u04a9"
+ "\7?\2\2\u04a9\u0116\3\2\2\2\u04aa\u04ab\7=\2\2\u04ab\u0118\3\2\2\2\u04ac"
+ "\u04ad\7\60\2\2\u04ad\u011a\3\2\2\2\u04ae\u04af\7.\2\2\u04af\u011c\3\2"
+ "\2\2\u04b0\u04b1\7B\2\2\u04b1\u011e\3\2\2\2\u04b2\u04b3\7?\2\2\u04b3\u0120"
+ "\3\2\2\2\u04b4\u04b5\7>\2\2\u04b5\u0122\3\2\2\2\u04b6\u04b7\7@\2\2\u04b7"
+ "\u0124\3\2\2\2\u04b8\u04b9\7<\2\2\u04b9\u0126\3\2\2\2\u04ba\u04bb\7~\2"
+ "\2\u04bb\u0128\3\2\2\2\u04bc\u04bd\7#\2\2\u04bd\u012a\3\2\2\2\u04be\u04bf"
+ "\7\u0080\2\2\u04bf\u012c\3\2\2\2\u04c0\u04c1\7,\2\2\u04c1\u012e\3\2\2"
+ "\2\u04c2\u04c3\7\61\2\2\u04c3\u0130\3\2\2\2\u04c4\u04c5\7\'\2\2\u04c5"
+ "\u0132\3\2\2\2\u04c6\u04c7\7-\2\2\u04c7\u0134\3\2\2\2\u04c8\u04c9\7/\2"
+ "\2\u04c9\u0136\3\2\2\2\u04ca\u04cb\7(\2\2\u04cb\u0138\3\2\2\2\u04cc\u04cd"
+ "\7`\2\2\u04cd\u013a\3\2\2\2\u04ce\u04cf\7A\2\2\u04cf\u013c\3\2\2\2\u04d0"
+ "\u04d1\7\60\2\2\u04d1\u04d2\7\60\2\2\u04d2\u04d3\7\60\2\2\u04d3\u013e"
+ "\3\2\2\2\u04d4\u04d5\7c\2\2\u04d5\u04d6\7u\2\2\u04d6\u0140\3\2\2\2\u04d7"
+ "\u04d8\7k\2\2\u04d8\u04d9\7p\2\2\u04d9\u04da\7u\2\2\u04da\u04db\7v\2\2"
+ "\u04db\u04dc\7c\2\2\u04dc\u04dd\7p\2\2\u04dd\u04de\7e\2\2\u04de\u04df"
+ "\7g\2\2\u04df\u04e0\7q\2\2\u04e0\u04e1\7h\2\2\u04e1\u0142\3\2\2\2\u04e2"
+ "\u04e3\7x\2\2\u04e3\u04e4\7q\2\2\u04e4\u04e5\7k\2\2\u04e5\u050d\7f\2\2"
+ "\u04e6\u04e7\7d\2\2\u04e7\u04e8\7q\2\2\u04e8\u04e9\7q\2\2\u04e9\u04ea"
+ "\7n\2\2\u04ea\u04eb\7g\2\2\u04eb\u04ec\7c\2\2\u04ec\u050d\7p\2\2\u04ed"
+ "\u04ee\7d\2\2\u04ee\u04ef\7{\2\2\u04ef\u04f0\7v\2\2\u04f0\u050d\7g\2\2"
+ "\u04f1\u04f2\7e\2\2\u04f2\u04f3\7j\2\2\u04f3\u04f4\7c\2\2\u04f4\u050d"
+ "\7t\2\2\u04f5\u04f6\7u\2\2\u04f6\u04f7\7j\2\2\u04f7\u04f8\7q\2\2\u04f8"
+ "\u04f9\7t\2\2\u04f9\u050d\7v\2\2\u04fa\u04fb\7k\2\2\u04fb\u04fc\7p\2\2"
+ "\u04fc\u050d\7v\2\2\u04fd\u04fe\7h\2\2\u04fe\u04ff\7n\2\2\u04ff\u0500"
+ "\7q\2\2\u0500\u0501\7c\2\2\u0501\u050d\7v\2\2\u0502\u0503\7n\2\2\u0503"
+ "\u0504\7q\2\2\u0504\u0505\7p\2\2\u0505\u050d\7i\2\2\u0506\u0507\7f\2\2"
+ "\u0507\u0508\7q\2\2\u0508\u0509\7w\2\2\u0509\u050a\7d\2\2\u050a\u050b"
+ "\7n\2\2\u050b\u050d\7g\2\2\u050c\u04e2\3\2\2\2\u050c\u04e6\3\2\2\2\u050c"
+ "\u04ed\3\2\2\2\u050c\u04f1\3\2\2\2\u050c\u04f5\3\2\2\2\u050c\u04fa\3\2"
+ "\2\2\u050c\u04fd\3\2\2\2\u050c\u0502\3\2\2\2\u050c\u0506\3\2\2\2\u050d"
+ "\u0144\3\2\2\2\u050e\u0512\5\u0147\u00a1\2\u050f\u0512\5\u0149\u00a2\2"
+ "\u0510\u0512\5\u014b\u00a3\2\u0511\u050e\3\2\2\2\u0511\u050f\3\2\2\2\u0511"
+ "\u0510\3\2\2\2\u0512\u0146\3\2\2\2\u0513\u0514\7r\2\2\u0514\u0515\7w\2"
+ "\2\u0515\u0516\7d\2\2\u0516\u0517\7n\2\2\u0517\u0518\7k\2\2\u0518\u0519"
+ "\7e\2\2\u0519\u0148\3\2\2\2\u051a\u051b\7r\2\2\u051b\u051c\7t\2\2\u051c"
+ "\u051d\7q\2\2\u051d\u051e\7v\2\2\u051e\u051f\7g\2\2\u051f\u0520\7e\2\2"
+ "\u0520\u0521\7v\2\2\u0521\u0522\7g\2\2\u0522\u0523\7f\2\2\u0523\u014a"
+ "\3\2\2\2\u0524\u0525\7r\2\2\u0525\u0526\7t\2\2\u0526\u0527\7k\2\2\u0527"
+ "\u0528\7x\2\2\u0528\u0529\7c\2\2\u0529\u052a\7v\2\2\u052a\u052b\7g\2\2"
+ "\u052b\u014c\3\2\2\2\u052c\u052d\7c\2\2\u052d\u052e\7d\2\2\u052e\u052f"
+ "\7u\2\2\u052f\u0530\7v\2\2\u0530\u0531\7t\2\2\u0531\u0532\7c\2\2\u0532"
+ "\u0533\7e\2\2\u0533\u0534\7v\2\2\u0534\u014e\3\2\2\2\u0535\u0536\7u\2"
+ "\2\u0536\u0537\7v\2\2\u0537\u0538\7c\2\2\u0538\u0539\7v\2\2\u0539\u053a"
+ "\7k\2\2\u053a\u053b\7e\2\2\u053b\u0150\3\2\2\2\u053c\u053d\7h\2\2\u053d"
+ "\u053e\7k\2\2\u053e\u053f\7p\2\2\u053f\u0540\7c\2\2\u0540\u0541\7n\2\2"
+ "\u0541\u0152\3\2\2\2\u0542\u0543\7v\2\2\u0543\u0544\7t\2\2\u0544\u0545"
+ "\7c\2\2\u0545\u0546\7p\2\2\u0546\u0547\7u\2\2\u0547\u0548\7k\2\2\u0548"
+ "\u0549\7g\2\2\u0549\u054a\7p\2\2\u054a\u054b\7v\2\2\u054b\u0154\3\2\2"
+ "\2\u054c\u054d\7p\2\2\u054d\u054e\7c\2\2\u054e\u054f\7v\2\2\u054f\u0550"
+ "\7k\2\2\u0550\u0551\7x\2\2\u0551\u0552\7g\2\2\u0552\u0156\3\2\2\2\u0553"
+ "\u0554\7x\2\2\u0554\u0555\7q\2\2\u0555\u0556\7n\2\2\u0556\u0557\7c\2\2"
+ "\u0557\u0558\7v\2\2\u0558\u0559\7k\2\2\u0559\u055a\7n\2\2\u055a\u055b"
+ "\7g\2\2\u055b\u0158\3\2\2\2\u055c\u055d\7u\2\2\u055d\u055e\7{\2\2\u055e"
+ "\u055f\7p\2\2\u055f\u0560\7e\2\2\u0560\u0561\7j\2\2\u0561\u0562\7t\2\2"
+ "\u0562\u0563\7q\2\2\u0563\u0564\7p\2\2\u0564\u0565\7k\2\2\u0565\u0566"
+ "\7|\2\2\u0566\u0567\7g\2\2\u0567\u0568\7f\2\2\u0568\u015a\3\2\2\2\u0569"
+ "\u056a\7u\2\2\u056a\u056b\7v\2\2\u056b\u056c\7t\2\2\u056c\u056d\7k\2\2"
+ "\u056d\u056e\7e\2\2\u056e\u056f\7v\2\2\u056f\u0570\7h\2\2\u0570\u0571"
+ "\7r\2\2\u0571\u015c\3\2\2\2\u0572\u0573\7v\2\2\u0573\u0574\7j\2\2\u0574"
+ "\u0575\7t\2\2\u0575\u0576\7g\2\2\u0576\u0577\7c\2\2\u0577\u0578\7f\2\2"
+ "\u0578\u0579\7u\2\2\u0579\u057a\7c\2\2\u057a\u057b\7h\2\2\u057b\u057c"
+ "\7g\2\2\u057c\u015e\3\2\2\2\u057d\u057f\7\17\2\2\u057e\u057d\3\2\2\2\u057e"
+ "\u057f\3\2\2\2\u057f\u0580\3\2\2\2\u0580\u0581\7\f\2\2\u0581\u0582\6\u00ad"
+ "\f\2\u0582\u0583\3\2\2\2\u0583\u0584\b\u00ad\3\2\u0584\u0160\3\2\2\2\u0585"
+ "\u0587\7\17\2\2\u0586\u0585\3\2\2\2\u0586\u0587\3\2\2\2\u0587\u0588\3"
+ "\2\2\2\u0588\u0589\7\f\2\2\u0589\u0162\3\2\2\2\u058a\u058e\5\u0165\u00b0"
+ "\2\u058b\u058d\5\u0167\u00b1\2\u058c\u058b\3\2\2\2\u058d\u0590\3\2\2\2"
+ "\u058e\u058c\3\2\2\2\u058e\u058f\3\2\2\2\u058f\u0164\3\2\2\2\u0590\u058e"
+ "\3\2\2\2\u0591\u0594\t\24\2\2\u0592\u0594\5\u016d\u00b4\2\u0593\u0591"
+ "\3\2\2\2\u0593\u0592\3\2\2\2\u0594\u0166\3\2\2\2\u0595\u0598\t\25\2\2"
+ "\u0596\u0598\5\u016d\u00b4\2\u0597\u0595\3\2\2\2\u0597\u0596\3\2\2\2\u0598"
+ "\u0168\3\2\2\2\u0599\u059c\t\26\2\2\u059a\u059c\5\u016d\u00b4\2\u059b"
+ "\u0599\3\2\2\2\u059b\u059a\3\2\2\2\u059c\u016a\3\2\2\2\u059d\u05a0\t\27"
+ "\2\2\u059e\u05a0\5\u016d\u00b4\2\u059f\u059d\3\2\2\2\u059f\u059e\3\2\2"
+ "\2\u05a0\u016c\3\2\2\2\u05a1\u05a2\n\30\2\2\u05a2\u05a7\6\u00b4\r\2\u05a3"
+ "\u05a4\t\31\2\2\u05a4\u05a5\t\32\2\2\u05a5\u05a7\6\u00b4\16\2\u05a6\u05a1"
+ "\3\2\2\2\u05a6\u05a3\3\2\2\2\u05a7\u016e\3\2\2\2J\2\3\4\5\6\7\b\u0175"
+ "\u0179\u0184\u0192\u01a1\u01ab\u01d1\u01da\u01df\u01e7\u01f4\u01fc\u0200"
+ "\u0207\u0212\u021d\u022a\u0238\u0245\u024d\u0255\u025b\u0263\u0269\u027d"
+ "\u029b\u02d6\u02de\u02e2\u02e5\u02f4\u02f7\u02fa\u02ff\u0305\u030c\u0312"
+ "\u0315\u031b\u031d\u0322\u0328\u032a\u032e\u0334\u0336\u033b\u0343\u0345"
+ "\u034a\u0352\u0354\u0359\u0361\u0366\u050c\u0511\u057e\u0586\u058e\u0593"
+ "\u0597\u059b\u059f\u05a6\33\tx\2\b\2\2\3\7\2\7\2\2\3\b\3\6\2\2\3\t\4\3"
+ "\n\5\3\13\6\3\f\7\t\13\2\t\f\2\7\3\2\7\7\2\7\4\2\7\5\2\7\6\2\t\r\2\t\16"
+ "\2\5\2\2\3,\b\t\t\2\ty\2\7\b\2\2\3\2";
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);
}
}
}
| 67,801 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
GroovyAnalyzer.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/groovy/GroovyAnalyzer.java | package com.tyron.code.language.groovy;
import android.content.res.AssetManager;
import com.tyron.code.ApplicationLoader;
import com.tyron.code.analyzer.BaseTextmateAnalyzer;
import com.tyron.code.ui.editor.impl.text.rosemoe.CodeEditorView;
import com.tyron.editor.Editor;
import io.github.rosemoe.sora.langs.textmate.theme.TextMateColorScheme;
import io.github.rosemoe.sora.textmate.core.theme.IRawTheme;
import java.io.InputStream;
import java.io.InputStreamReader;
public class GroovyAnalyzer extends BaseTextmateAnalyzer {
private static final String GRAMMAR_NAME = "groovy.tmLanguage";
private static final String LANGUAGE_PATH = "textmate/groovy/syntaxes/groovy.tmLanguage";
private static final String CONFIG_PATH = "textmate/groovy/language-configuration.json";
public GroovyAnalyzer(
Editor editor,
String grammarName,
InputStream open,
InputStreamReader config,
IRawTheme rawTheme)
throws Exception {
super(editor, grammarName, open, config, rawTheme);
}
public static GroovyAnalyzer create(Editor editor) {
try {
AssetManager assetManager = ApplicationLoader.applicationContext.getAssets();
try (InputStreamReader config = new InputStreamReader(assetManager.open(CONFIG_PATH))) {
return new GroovyAnalyzer(
editor,
GRAMMAR_NAME,
assetManager.open(LANGUAGE_PATH),
config,
((TextMateColorScheme) ((CodeEditorView) editor).getColorScheme()).getRawTheme());
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| 1,592 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Groovy.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/groovy/Groovy.java | package com.tyron.code.language.groovy;
import com.tyron.code.language.Language;
import com.tyron.editor.Editor;
import java.io.File;
public class Groovy implements Language {
@Override
public boolean isApplicable(File ext) {
return ext.getName().endsWith(".groovy") || ext.getName().endsWith(".gradle");
}
@Override
public io.github.rosemoe.sora.lang.Language get(Editor editor) {
return new GroovyLanguage(editor);
}
}
| 444 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
GroovyLanguage.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/language/groovy/GroovyLanguage.java | package com.tyron.code.language.groovy;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.tyron.editor.Editor;
import io.github.rosemoe.sora.lang.Language;
import io.github.rosemoe.sora.lang.analysis.AnalyzeManager;
import io.github.rosemoe.sora.lang.completion.CompletionCancelledException;
import io.github.rosemoe.sora.lang.completion.CompletionPublisher;
import io.github.rosemoe.sora.lang.smartEnter.NewlineHandler;
import io.github.rosemoe.sora.text.CharPosition;
import io.github.rosemoe.sora.text.ContentReference;
import io.github.rosemoe.sora.widget.SymbolPairMatch;
public class GroovyLanguage implements Language {
private final Editor mEditor;
private final GroovyAnalyzer mAnalyzer;
public GroovyLanguage(Editor editor) {
mEditor = editor;
mAnalyzer = GroovyAnalyzer.create(editor);
}
@NonNull
@Override
public AnalyzeManager getAnalyzeManager() {
return mAnalyzer;
}
@Override
public int getInterruptionLevel() {
return INTERRUPTION_LEVEL_STRONG;
}
@Override
public void requireAutoComplete(
@NonNull ContentReference content,
@NonNull CharPosition position,
@NonNull CompletionPublisher publisher,
@NonNull Bundle extraArguments)
throws CompletionCancelledException {}
@Override
public int getIndentAdvance(@NonNull ContentReference content, int line, int column) {
return 0;
}
@Override
public boolean useTab() {
return true;
}
@Override
public CharSequence format(CharSequence text) {
return text;
}
@Override
public SymbolPairMatch getSymbolPairs() {
return null;
}
@Override
public NewlineHandler[] getNewlineHandlers() {
return new NewlineHandler[0];
}
@Override
public void destroy() {}
}
| 1,773 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
BaseTextmateAnalyzer.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/analyzer/BaseTextmateAnalyzer.java | package com.tyron.code.analyzer;
import android.graphics.Color;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.tyron.code.language.textmate.BaseIncrementalAnalyzeManager;
import com.tyron.code.language.textmate.CodeBlockUtils;
import com.tyron.editor.Editor;
import io.github.rosemoe.sora.lang.styling.CodeBlock;
import io.github.rosemoe.sora.lang.styling.Span;
import io.github.rosemoe.sora.lang.styling.TextStyle;
import io.github.rosemoe.sora.langs.textmate.folding.FoldingRegions;
import io.github.rosemoe.sora.langs.textmate.folding.IndentRange;
import io.github.rosemoe.sora.text.Content;
import io.github.rosemoe.sora.text.ContentReference;
import io.github.rosemoe.sora.textmate.core.grammar.IGrammar;
import io.github.rosemoe.sora.textmate.core.grammar.ITokenizeLineResult2;
import io.github.rosemoe.sora.textmate.core.grammar.StackElement;
import io.github.rosemoe.sora.textmate.core.internal.grammar.StackElementMetadata;
import io.github.rosemoe.sora.textmate.core.registry.Registry;
import io.github.rosemoe.sora.textmate.core.theme.FontStyle;
import io.github.rosemoe.sora.textmate.core.theme.IRawTheme;
import io.github.rosemoe.sora.textmate.core.theme.Theme;
import io.github.rosemoe.sora.textmate.languageconfiguration.ILanguageConfiguration;
import io.github.rosemoe.sora.textmate.languageconfiguration.internal.LanguageConfigurator;
import io.github.rosemoe.sora.textmate.languageconfiguration.internal.supports.Folding;
import io.github.rosemoe.sora.util.ArrayList;
import io.github.rosemoe.sora.widget.schemes.EditorColorScheme;
import java.io.InputStream;
import java.io.Reader;
import java.util.List;
/** A text mate analyzer which does not use a TextMateLanguage */
public class BaseTextmateAnalyzer extends BaseIncrementalAnalyzeManager<StackElement, Span> {
/** Maximum for code block count */
public static int MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT = 5000;
private final Registry registry = new Registry();
private final IGrammar grammar;
private Theme theme;
private final Editor editor;
private final ILanguageConfiguration configuration;
public BaseTextmateAnalyzer(
Editor editor,
String grammarName,
InputStream grammarIns,
Reader languageConfiguration,
IRawTheme theme)
throws Exception {
registry.setTheme(theme);
this.editor = editor;
this.theme = Theme.createFromRawTheme(theme);
this.grammar = registry.loadGrammarFromPathSync(grammarName, grammarIns);
if (languageConfiguration != null) {
LanguageConfigurator languageConfigurator = new LanguageConfigurator(languageConfiguration);
configuration = languageConfigurator.getLanguageConfiguration();
} else {
configuration = null;
}
}
public void analyzeCodeBlocks(
Content model, List<CodeBlock> blocks, CodeBlockAnalyzeDelegate delegate) {
if (configuration == null) {
return;
}
Folding folding = configuration.getFolding();
if (folding == null) {
return;
}
try {
FoldingRegions foldingRegions =
CodeBlockUtils.computeRanges(
model,
editor.getTabCount(),
folding.getOffSide(),
folding,
MAX_FOLDING_REGIONS_FOR_INDENT_LIMIT,
delegate);
for (int i = 0; i < foldingRegions.length() && !delegate.isCancelled(); i++) {
int startLine = foldingRegions.getStartLineNumber(i);
int endLine = foldingRegions.getEndLineNumber(i);
if (startLine != endLine) {
CodeBlock codeBlock = new CodeBlock();
codeBlock.toBottomOfEndLine = true;
codeBlock.startLine = startLine;
codeBlock.endLine = endLine;
// It's safe here to use raw data because the Content is only held by this
// thread
int length = model.getColumnCount(startLine);
char[] chars = model.getLine(startLine).getRawData();
codeBlock.startColumn =
IndentRange.computeStartColumn(
chars, length, editor.useTab() ? 1 : editor.getTabCount());
codeBlock.endColumn = codeBlock.startColumn;
blocks.add(codeBlock);
}
}
blocks.sort(CodeBlock.COMPARATOR_END);
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public StackElement getInitialState() {
return null;
}
@Override
public boolean stateEquals(StackElement state, StackElement another) {
if (state == null && another == null) {
return true;
}
if (state != null && another != null) {
return state.equals(another);
}
return false;
}
@Override
public Result<StackElement, Span> tokenizeLine(CharSequence lineC, StackElement state) {
String line = lineC.toString();
ArrayList<Span> tokens = new ArrayList<>();
ITokenizeLineResult2 lineTokens = grammar.tokenizeLine2(line, state);
int tokensLength = lineTokens.getTokens().length / 2;
for (int i = 0; i < tokensLength; i++) {
int startIndex = lineTokens.getTokens()[2 * i];
if (i == 0 && startIndex != 0) {
tokens.add(Span.obtain(0, EditorColorScheme.TEXT_NORMAL));
}
int metadata = lineTokens.getTokens()[2 * i + 1];
int foreground = StackElementMetadata.getForeground(metadata);
int fontStyle = StackElementMetadata.getFontStyle(metadata);
Span span =
Span.obtain(
startIndex,
TextStyle.makeStyle(
foreground + 255,
0,
(fontStyle & FontStyle.Bold) != 0,
(fontStyle & FontStyle.Italic) != 0,
false));
if ((fontStyle & FontStyle.Underline) != 0) {
String color = theme.getColor(foreground);
if (color != null) {
span.underlineColor = Color.parseColor(color);
}
}
tokens.add(span);
}
return new Result<>(lineTokens.getRuleStack(), null, tokens);
}
@Override
public List<Span> generateSpansForLine(LineTokenizeResult<StackElement, Span> tokens) {
return null;
}
@Override
public List<CodeBlock> computeBlocks(Content text, CodeBlockAnalyzeDelegate delegate) {
List<CodeBlock> list = new java.util.ArrayList<>();
analyzeCodeBlocks(text, list, delegate);
return list;
}
@Override
public void reset(@NonNull ContentReference content, @NonNull Bundle extraArguments) {
if (!extraArguments.getBoolean("loaded", false)) {
return;
}
super.reset(content, extraArguments);
}
public void updateTheme(IRawTheme theme) {
registry.setTheme(theme);
this.theme = Theme.createFromRawTheme(theme);
}
protected Theme getTheme() {
return theme;
}
}
| 6,741 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
DiagnosticTextmateAnalyzer.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/analyzer/DiagnosticTextmateAnalyzer.java | package com.tyron.code.analyzer;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.tyron.builder.model.DiagnosticWrapper;
import com.tyron.code.language.DiagnosticSpanMapUpdater;
import com.tyron.code.language.HighlightUtil;
import com.tyron.code.ui.editor.impl.text.rosemoe.CodeEditorView;
import com.tyron.editor.Editor;
import io.github.rosemoe.sora.lang.analysis.AnalyzeManager;
import io.github.rosemoe.sora.lang.analysis.StyleReceiver;
import io.github.rosemoe.sora.lang.styling.Styles;
import io.github.rosemoe.sora.text.CharPosition;
import io.github.rosemoe.sora.text.ContentReference;
import io.github.rosemoe.sora.textmate.core.theme.IRawTheme;
import java.io.InputStream;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
public abstract class DiagnosticTextmateAnalyzer extends BaseTextmateAnalyzer {
protected List<DiagnosticWrapper> mDiagnostics = new ArrayList<>();
private boolean mShouldAnalyzeInBg;
private ContentReference ref;
protected Editor mEditor;
private final Consumer<Styles> mStyleModifier;
public DiagnosticTextmateAnalyzer(
Editor editor,
String grammarName,
InputStream grammarIns,
Reader languageConfiguration,
IRawTheme theme)
throws Exception {
super(editor, grammarName, grammarIns, languageConfiguration, theme);
mEditor = editor;
mStyleModifier = this::modifyStyles;
}
protected void modifyStyles(Styles styles) {
if (styles == null) {
return;
}
HighlightUtil.clearDiagnostics(styles);
HighlightUtil.markDiagnostics(mEditor, mDiagnostics, styles);
}
public void setDiagnostics(
CodeEditorView codeEditorView, @NonNull List<DiagnosticWrapper> diagnostics) {
mDiagnostics = diagnostics;
}
@Override
public void setReceiver(@Nullable StyleReceiver receiver) {
if (receiver != null) {
super.setReceiver(new StyleReceiverInterceptor(receiver, mStyleModifier));
} else {
super.setReceiver(null);
}
}
@Override
public void insert(CharPosition start, CharPosition end, CharSequence insertedText) {
super.insert(start, end, insertedText);
if (getExtraArguments().getBoolean("bg", false)) {
if (!mShouldAnalyzeInBg) {
mShouldAnalyzeInBg = true;
} else {
analyzeInBackground(ref.getReference());
}
}
if (start.getLine() != end.getLine()) {
DiagnosticSpanMapUpdater.shiftDiagnosticsOnMultiLineInsert(mDiagnostics, ref, start, end);
} else {
DiagnosticSpanMapUpdater.shiftDiagnosticsOnSingleLineInsert(mDiagnostics, ref, start, end);
}
}
@Override
public void delete(CharPosition start, CharPosition end, CharSequence deletedText) {
super.delete(start, end, deletedText);
if (getExtraArguments().getBoolean("bg", false)) {
if (!mShouldAnalyzeInBg) {
mShouldAnalyzeInBg = true;
} else {
analyzeInBackground(ref.getReference());
}
}
if (start.getLine() != end.getLine()) {
DiagnosticSpanMapUpdater.shiftDiagnosticsOnMultiLineDelete(mDiagnostics, ref, start, end);
} else {
DiagnosticSpanMapUpdater.shiftDiagnosticsOnSingleLineDelete(mDiagnostics, ref, start, end);
}
}
@Override
public void reset(@NonNull ContentReference content, @NonNull Bundle extraArguments) {
// it CAN be null.
//noinspection ConstantConditions
if (extraArguments == null) {
extraArguments = new Bundle();
}
this.ref = content;
super.reset(content, extraArguments);
}
@Override
public Bundle getExtraArguments() {
Bundle extraArguments = super.getExtraArguments();
if (extraArguments == null) {
extraArguments = new Bundle();
}
return extraArguments;
}
@Override
public void destroy() {
mEditor = null;
super.destroy();
}
public abstract void analyzeInBackground(CharSequence contents);
public void rerunWithoutBg() {
mShouldAnalyzeInBg = false;
super.rerun();
}
public void rerunWithBg() {
super.rerun();
analyzeInBackground(ref.getReference());
}
public static class StyleReceiverInterceptor implements StyleReceiver {
private final StyleReceiver mReceiver;
private final Consumer<Styles> mConsumer;
public StyleReceiverInterceptor(
@NonNull StyleReceiver base, @NonNull Consumer<Styles> consumer) {
mReceiver = base;
mConsumer = consumer;
}
@Override
public void setStyles(AnalyzeManager sourceManager, Styles styles) {
mConsumer.accept(styles);
mReceiver.setStyles(sourceManager, styles);
}
}
}
| 4,694 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SemanticAnalyzeManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/analyzer/SemanticAnalyzeManager.java | package com.tyron.code.analyzer;
import com.tyron.code.analyzer.semantic.SemanticToken;
import com.tyron.code.language.HighlightUtil;
import com.tyron.editor.CharPosition;
import com.tyron.editor.Content;
import com.tyron.editor.Editor;
import io.github.rosemoe.sora.lang.styling.Span;
import io.github.rosemoe.sora.lang.styling.Styles;
import io.github.rosemoe.sora.lang.styling.TextStyle;
import io.github.rosemoe.sora.textmate.core.theme.FontStyle;
import io.github.rosemoe.sora.textmate.core.theme.IRawTheme;
import io.github.rosemoe.sora.textmate.core.theme.ThemeTrieElementRule;
import java.io.InputStream;
import java.io.Reader;
import java.util.List;
public abstract class SemanticAnalyzeManager extends DiagnosticTextmateAnalyzer {
private List<SemanticToken> mSemanticTokens;
public SemanticAnalyzeManager(
Editor editor,
String grammarName,
InputStream grammarIns,
Reader languageConfiguration,
IRawTheme theme)
throws Exception {
super(editor, grammarName, grammarIns, languageConfiguration, theme);
}
public abstract List<SemanticToken> analyzeSpansAsync(CharSequence contents);
@Override
public void insert(
io.github.rosemoe.sora.text.CharPosition start,
io.github.rosemoe.sora.text.CharPosition end,
CharSequence insertedText) {
super.insert(start, end, insertedText);
}
@Override
protected void modifyStyles(Styles styles) {
super.modifyStyles(styles);
Content content = mEditor.getContent();
if (mSemanticTokens != null) {
for (int i = mSemanticTokens.size() - 1; i >= 0; i--) {
SemanticToken token = mSemanticTokens.get(i);
if (token.getOffset() > content.length()) {
continue;
}
CharPosition start = mEditor.getCharPosition(token.getOffset());
CharPosition end = mEditor.getCharPosition(token.getOffset() + token.getLength());
Span span = Span.obtain(0, getStyle(token));
HighlightUtil.replaceSpan(
styles, span, start.getLine(), start.getColumn(), end.getLine(), end.getColumn());
}
}
}
private long getStyle(SemanticToken token) {
List<ThemeTrieElementRule> match = getTheme().match(token.getTokenType().toString());
if (!match.isEmpty()) {
ThemeTrieElementRule next = match.iterator().next();
int foreground = next.foreground;
int fontStyle = next.fontStyle;
return TextStyle.makeStyle(
foreground + 255,
0,
(fontStyle & FontStyle.Bold) == FontStyle.Bold,
(fontStyle & FontStyle.Italic) == FontStyle.Italic,
false);
}
return 0;
}
}
| 2,648 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SemanticToken.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/analyzer/semantic/SemanticToken.java | package com.tyron.code.analyzer.semantic;
import androidx.annotation.NonNull;
public class SemanticToken {
private final TokenType tokenType;
private final int tokenModifiers;
private final int offset;
private final int length;
public SemanticToken(int offset, int length, TokenType tokenType, int tokenModifiers) {
this.offset = offset;
this.length = length;
this.tokenType = tokenType;
this.tokenModifiers = tokenModifiers;
}
public TokenType getTokenType() {
return tokenType;
}
public int getTokenModifiers() {
return tokenModifiers;
}
public int getOffset() {
return offset;
}
public int getLength() {
return length;
}
@NonNull
@Override
public String toString() {
return "SemanticToken{"
+ "tokenType="
+ tokenType
+ ", tokenModifiers="
+ tokenModifiers
+ ", offset="
+ offset
+ ", length="
+ length
+ '}';
}
}
| 969 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SemanticHighlighter.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/analyzer/semantic/SemanticHighlighter.java | package com.tyron.code.analyzer.semantic;
import com.sun.source.tree.Tree;
import com.sun.source.util.TreePath;
import com.sun.source.util.TreePathScanner;
import java.util.concurrent.atomic.AtomicBoolean;
public class SemanticHighlighter extends TreePathScanner<Void, Void> {
private final AtomicBoolean mCancelFlag = new AtomicBoolean(false);
public void cancel() {
mCancelFlag.set(true);
}
@Override
public Void scan(Tree tree, Void unused) {
if (tree == null || mCancelFlag.get()) {
return null;
}
return super.scan(tree, unused);
}
@Override
public Void scan(Iterable<? extends Tree> iterable, Void unused) {
if (iterable == null || mCancelFlag.get()) {
return null;
}
return super.scan(iterable, unused);
}
@Override
public Void scan(TreePath treePath, Void unused) {
if (treePath == null || mCancelFlag.get()) {
return null;
}
return super.scan(treePath, unused);
}
@Override
public Void reduce(Void unused, Void r1) {
if (unused == null || r1 == null || mCancelFlag.get()) {
return null;
}
return super.reduce(unused, r1);
}
}
| 1,149 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
TokenType.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/analyzer/semantic/TokenType.java | package com.tyron.code.analyzer.semantic;
import androidx.annotation.NonNull;
public class TokenType {
public static final TokenType UNKNOWN = create("token.error-token");
public static TokenType create(String scope, String... fallbackScopes) {
return new TokenType(scope, fallbackScopes);
}
private final String scope;
private final String[] fallbackScopes;
public TokenType(@NonNull String scope, String[] fallbackScopes) {
this.scope = scope;
this.fallbackScopes = fallbackScopes;
}
public String getScope() {
return scope;
}
public String[] getFallbackScopes() {
return fallbackScopes;
}
@NonNull
@Override
public String toString() {
return scope;
}
}
| 719 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Event.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/event/Event.java | package com.tyron.code.event;
import io.github.rosemoe.sora.event.ClickEvent;
import io.github.rosemoe.sora.event.DoubleClickEvent;
import io.github.rosemoe.sora.event.EditorKeyEvent;
import io.github.rosemoe.sora.event.LongPressEvent;
/**
* An Event object describes an event of editor. It includes several attributes such as time and the
* editor object. Subclasses of Event will define their own fields or methods.
*
* @author Rosemoe
*/
public abstract class Event {
private final long mEventTime;
private boolean mIntercepted;
public Event() {
this(System.currentTimeMillis());
}
public Event(long eventTime) {
mEventTime = eventTime;
mIntercepted = false;
}
/** Get event time */
public long getEventTime() {
return mEventTime;
}
/**
* Check whether this event can be intercepted (so that the event is not sent to other receivers
* after being intercepted) Intercept-able events:
*
* @see LongPressEvent
* @see ClickEvent
* @see DoubleClickEvent
* @see EditorKeyEvent
*/
public boolean canIntercept() {
return false;
}
/**
* Intercept the event.
*
* <p>Make sure {@link #canIntercept()} returns true. Otherwise, an {@link
* UnsupportedOperationException} will be thrown.
*/
public void intercept() {
if (!canIntercept()) {
throw new UnsupportedOperationException("intercept() not supported");
}
mIntercepted = true;
}
/** Check whether this event is intercepted */
public boolean isIntercepted() {
return mIntercepted;
}
}
| 1,560 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SubscriptionReceipt.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/event/SubscriptionReceipt.java | package com.tyron.code.event;
import java.lang.ref.WeakReference;
public class SubscriptionReceipt<R extends Event> {
private final Class<R> clazz;
private final WeakReference<EventReceiver<R>> receiver;
private final EventManager manager;
public SubscriptionReceipt(Class<R> clazz, EventReceiver<R> receiver, EventManager manager) {
this.clazz = clazz;
this.receiver = new WeakReference<>(receiver);
this.manager = manager;
}
public void unsubscribe() {
EventManager.Receivers<R> receivers = manager.getReceivers(clazz);
receivers.lock.writeLock().lock();
try {
EventReceiver<R> target = receiver.get();
if (target != null) {
receivers.receivers.remove(target);
}
} finally {
receivers.lock.writeLock().unlock();
}
}
}
| 803 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
EventManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/event/EventManager.java | package com.tyron.code.event;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
* This class manages event dispatching in editor. Users can either register their event receivers
* here or dispatch event to the receivers in this manager.
*
* <p>There may be several EventManagers in one editor instance. For example, each plugin will have
* it own EventManager and the editor also has a root event manager for external listeners.
*
* <p>Note that the event type must be exact. That's to say, you need to use a terminal class
* instead of using its parent classes. For instance, if you register a receiver with the event type
* {@link Event}, no event will be sent to your receiver.
*
* @author Rosemoe
*/
public final class EventManager {
@SuppressWarnings("rawtypes")
private final Map<Class<?>, Receivers> receivers;
private final ReadWriteLock lock;
private boolean enabled;
private final EventManager parent;
private final List<EventManager> children;
private boolean detached = false;
/** Create an EventManager with no parent */
public EventManager() {
this(null);
}
/** Create an EventManager with the given parent. Null for no parent. */
public EventManager(@Nullable EventManager parent) {
receivers = new HashMap<>();
this.parent = parent;
lock = new ReentrantReadWriteLock();
children = new Vector<>();
if (parent != null) {
parent.children.add(this);
}
}
/**
* Set enabled. Disabled EventManager will not deliver event to its subscribers or children. Root
* EventManager can not be disabled.
*/
public void setEnabled(boolean enabled) {
if (parent == null && !enabled) {
throw new IllegalStateException(
"The event manager is set to be root, and can not be disabled");
}
this.enabled = enabled;
}
/** Check is the manager enabled */
public boolean isEnabled() {
return enabled;
}
/** Get root node */
public EventManager getRootManager() {
checkDetached();
return parent == null ? this : parent.getRootManager();
}
/**
* Get root manager and dispatch the given event
*
* @see #dispatchEvent(Event)
*/
public <T extends Event> boolean dispatchEventFromRoot(@NonNull T event) {
return getRootManager().dispatchEvent(event);
}
/** Detached from parent. This manager will not receive future events from parent */
public void detach() {
if (parent == null) {
throw new IllegalStateException("root manager can not be detached");
}
checkDetached();
detached = true;
parent.children.remove(this);
}
private void checkDetached() {
if (detached) {
throw new IllegalStateException("already detached");
}
}
/** Get receivers container of a given event type safely */
@NonNull
@SuppressWarnings("unchecked")
<T extends Event> Receivers<T> getReceivers(@NonNull Class<T> type) {
lock.readLock().lock();
Receivers<T> result;
try {
result = receivers.get(type);
} finally {
lock.readLock().unlock();
}
if (result == null) {
lock.writeLock().lock();
try {
result = receivers.get(type);
if (result == null) {
result = new Receivers<>();
receivers.put(type, result);
}
} finally {
lock.writeLock().unlock();
}
}
return result;
}
/**
* Register a receiver of the given event.
*
* @param eventType Event type to be received
* @param receiver Receiver of event
* @param <T> Event type
*/
public <T extends Event> SubscriptionReceipt<T> subscribeEvent(
@NonNull Class<T> eventType, @NonNull EventReceiver<T> receiver) {
Receivers<T> receivers = getReceivers(eventType);
receivers.lock.writeLock().lock();
try {
List<EventReceiver<T>> list = receivers.receivers;
if (list.contains(receiver)) {
throw new IllegalArgumentException("the receiver is already registered for this type");
}
list.add(receiver);
} finally {
receivers.lock.writeLock().unlock();
}
return new SubscriptionReceipt<>(eventType, receiver, this);
}
public <T extends Event> void subscribeEvent(
@NonNull LifecycleOwner lifecycleOwner,
@NonNull Class<T> eventType,
@NonNull EventReceiver<T> receiver) {
SubscriptionReceipt<T> receipt = subscribeEvent(eventType, receiver);
lifecycleOwner
.getLifecycle()
.addObserver(
new DefaultLifecycleObserver() {
@Override
public void onDestroy(@NonNull LifecycleOwner owner) {
receipt.unsubscribe();
lifecycleOwner.getLifecycle().removeObserver(this);
}
});
}
/**
* Dispatch the given event to its receivers registered in this manager.
*
* @param event Event to dispatch
* @param <T> Event type
* @return Whether the event's intercept flag is set
*/
@SuppressWarnings("unchecked")
public <T extends Event> boolean dispatchEvent(@NonNull T event) {
// Safe cast
Receivers<T> receivers = getReceivers((Class<T>) event.getClass());
receivers.lock.readLock().lock();
EventReceiver<T>[] receiverArr;
int count;
try {
count = receivers.receivers.size();
receiverArr = obtainBuffer(count);
receivers.receivers.toArray(receiverArr);
} finally {
receivers.lock.readLock().unlock();
}
List<EventReceiver<T>> unsubscribedReceivers = null;
try {
Unsubscribe unsubscribe = new Unsubscribe();
for (int i = 0; i < count && !event.isIntercepted(); i++) {
EventReceiver<T> receiver = receiverArr[i];
receiver.onReceive(event, unsubscribe);
if (unsubscribe.isUnsubscribed()) {
if (unsubscribedReceivers == null) {
unsubscribedReceivers = new LinkedList<>();
}
unsubscribedReceivers.add(receiver);
}
unsubscribe.reset();
}
} finally {
if (unsubscribedReceivers != null) {
receivers.lock.writeLock().lock();
try {
receivers.receivers.removeAll(unsubscribedReceivers);
} finally {
receivers.lock.writeLock().unlock();
}
}
recycleBuffer(receiverArr);
}
for (int i = 0; i < children.size() && !event.isIntercepted(); i++) {
EventManager sub = null;
try {
sub = children.get(i);
} catch (IndexOutOfBoundsException e) {
// concurrent mod ignored
}
if (sub != null) {
sub.dispatchEvent(event);
}
}
return event.isIntercepted();
}
/**
* Internal class for saving receivers of each type
*
* @param <T> Event type
*/
static class Receivers<T extends Event> {
ReadWriteLock lock = new ReentrantReadWriteLock();
List<EventReceiver<T>> receivers = new ArrayList<>();
}
private final EventReceiver<?>[][] caches = new EventReceiver[5][];
@SuppressWarnings("unchecked")
private <V extends Event> EventReceiver<V>[] obtainBuffer(int size) {
EventReceiver<V>[] res = null;
synchronized (this) {
for (int i = 0; i < caches.length; i++) {
if (caches[i] != null && caches[i].length >= size) {
res = (EventReceiver<V>[]) caches[i];
caches[i] = null;
break;
}
}
}
if (res == null) {
res = new EventReceiver[size];
}
return res;
}
private synchronized void recycleBuffer(EventReceiver<?>[] array) {
if (array == null) {
return;
}
for (int i = 0; i < caches.length; i++) {
if (caches[i] == null) {
Arrays.fill(array, null);
caches[i] = array;
break;
}
}
}
}
| 8,138 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
EventReceiver.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/event/EventReceiver.java | package com.tyron.code.event;
public interface EventReceiver<T extends Event> {
void onReceive(T event, Unsubscribe unsubscribe);
}
| 136 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Unsubscribe.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/app/src/main/java/com/tyron/code/event/Unsubscribe.java | package com.tyron.code.event;
import io.github.rosemoe.sora.event.Event;
import io.github.rosemoe.sora.event.EventReceiver;
/**
* Instance for unsubscribing for a receiver.
*
* <p>Note that this instance can be reused during an event dispatch, so it is not a valid behavior
* to save the instance in event receivers. Always use the one given by {@link
* EventReceiver#onReceive(Event, Unsubscribe)}.
*/
public class Unsubscribe {
private boolean unsubscribeFlag = false;
/**
* Unsubscribe the event. And current receiver will not get event again. References to the
* receiver are also removed.
*/
public void unsubscribe() {
unsubscribeFlag = true;
}
/** Checks whether unsubscribe flag is set */
public boolean isUnsubscribed() {
return unsubscribeFlag;
}
/** Reset the flag */
public void reset() {
unsubscribeFlag = false;
}
}
| 883 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
CompletionEngine.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/CompletionEngine.java | package com.tyron.kotlin_completion;
import android.util.Log;
import android.util.Pair;
import com.tyron.builder.model.DiagnosticWrapper;
import com.tyron.builder.project.api.AndroidModule;
import com.tyron.common.util.Debouncer;
import com.tyron.completion.model.CachedCompletion;
import com.tyron.completion.model.CompletionItem;
import com.tyron.completion.model.CompletionList;
import com.tyron.completion.model.DrawableKind;
import com.tyron.kotlin_completion.classpath.ClassPathEntry;
import com.tyron.kotlin_completion.completion.Completions;
import com.tyron.kotlin_completion.diagnostic.ConvertDiagnosticKt;
import com.tyron.kotlin_completion.util.AsyncExecutor;
import com.tyron.kotlin_completion.util.StringUtilsKt;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import org.jetbrains.kotlin.diagnostics.Diagnostic;
import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.diagnostics.Diagnostics;
public class CompletionEngine {
public enum Recompile {
ALWAYS,
AFTER_DOT,
NEVER
}
private final AndroidModule mProject;
private final SourcePath sp;
private final CompilerClassPath classPath;
private final AsyncExecutor async = new AsyncExecutor();
private CachedCompletion cachedCompletion;
private final Debouncer debounceLint = new Debouncer(Duration.ofMillis(500));
private Set<File> lintTodo = new HashSet<>();
private int lintCount = 0;
private CompletionEngine(AndroidModule project) {
mProject = project;
classPath = new CompilerClassPath(project);
sp = new SourcePath(classPath);
}
private static volatile CompletionEngine INSTANCE = null;
public static synchronized CompletionEngine getInstance(AndroidModule project) {
if (INSTANCE == null) {
INSTANCE = new CompletionEngine(project);
} else {
if (project != INSTANCE.mProject) {
Log.d("CompletionEngine", "Creating new instance");
INSTANCE = new CompletionEngine(project);
}
}
return INSTANCE;
}
public boolean isIndexing() {
return sp.getIndex().getIndexing();
}
public SourcePath getSourcePath() {
return sp;
}
public synchronized Pair<CompiledFile, Integer> recover(
File file, String contents, Recompile recompile, int offset) {
boolean shouldRecompile = true;
switch (recompile) {
case NEVER:
shouldRecompile = false;
break;
case ALWAYS:
shouldRecompile = true;
break;
case AFTER_DOT:
shouldRecompile = offset > 0 && contents.charAt(offset - 1) == '.';
}
sp.put(file, contents, false);
CompiledFile compiled;
if (shouldRecompile) {
compiled = sp.currentVersion(file);
} else {
compiled = sp.latestCompiledVersion(file);
}
return Pair.create(compiled, offset);
}
public CompletableFuture<CompletionList> complete(File file, String contents, int cursor) {
if (isIndexing()) {
return CompletableFuture.completedFuture(CompletionList.EMPTY);
}
return async.compute(
() -> {
Pair<CompiledFile, Integer> pair = recover(file, contents, Recompile.NEVER, cursor);
return new Completions().completions(pair.first, cursor, sp.getIndex());
});
}
public CompletionList complete(
File file, String contents, String prefix, int line, int column, int cursor) {
if (isIndexing()) {
return CompletionList.EMPTY;
}
if (isIncrementalCompletion(cachedCompletion, file, prefix, line, column)) {
String partialIdentifier = partialIdentifier(prefix, prefix.length());
CompletionList cachedList = cachedCompletion.getCompletionList();
if (!cachedList.items.isEmpty()) {
List<CompletionItem> narrowedList =
cachedList.items.stream()
.filter(
item -> {
String label = item.label;
if (label.contains("(")) {
label = label.substring(0, label.indexOf('('));
}
if (label.length() < partialIdentifier.length()) {
return false;
}
return StringUtilsKt.containsCharactersInOrder(
label, partialIdentifier, false);
})
.collect(Collectors.toList());
CompletionList completionList = new CompletionList();
completionList.items = narrowedList;
return completionList;
}
}
debounceLint.cancel();
Pair<CompiledFile, Integer> recover = recover(file, contents, Recompile.NEVER, cursor);
CompletionList completions =
new Completions().completions(recover.first, cursor, sp.getIndex());
String partialIdentifier = partialIdentifier(contents, cursor);
cachedCompletion = new CachedCompletion(file, line, column, partialIdentifier, completions);
return completions;
}
public CompletionList completeV2(
File file, String contents, String prefix, int line, int column, int cursor) {
if (isIndexing()) {
return CompletionList.EMPTY;
}
CompletionList.Builder builder = CompletionList.builder(prefix);
List<CompletionItem> items = new ArrayList<>();
if (builder.getPrefix().startsWith("p")) {
items.add(new CompletionItem("package", null, "package", DrawableKind.Keyword));
}
if (builder.getPrefix().startsWith("i")) {
items.add(new CompletionItem("import", null, "import", DrawableKind.Keyword));
}
Set<ClassPathEntry> jars = classPath.getClassPath();
for (ClassPathEntry entry : jars) {
Path compiledJar = entry.getCompiledJar();
Path sourceJar = entry.getSourceJar();
try (ZipFile zipFile = new ZipFile(compiledJar.toFile())) {
Enumeration<? extends ZipEntry> entries = zipFile.entries();
while (entries.hasMoreElements()) {
ZipEntry zipEntry = entries.nextElement();
String filePath = zipEntry.getName();
if (filePath.endsWith(".class")) {
String className = filePath.replace("/", ".").replace(".class", "").replace("$", ".");
items.add(new CompletionItem(className, null, className, DrawableKind.Keyword));
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
builder.addItems(items);
CompletionList completionList = builder.build();
return completionList;
}
private String partialIdentifier(String contents, int end) {
int start = end;
while (start > 0 && Character.isJavaIdentifierPart(contents.charAt(start - 1))) {
start--;
}
return contents.substring(start, end);
}
private boolean isIncrementalCompletion(
CachedCompletion cachedCompletion, File file, String prefix, int line, int column) {
prefix = partialIdentifier(prefix, prefix.length());
if (cachedCompletion == null) {
return false;
}
if (!file.equals(cachedCompletion.getFile())) {
return false;
}
if (prefix.endsWith(".")) {
return false;
}
if (cachedCompletion.getLine() != line) {
return false;
}
if (cachedCompletion.getColumn() > column) {
return false;
}
if (!prefix.startsWith(cachedCompletion.getPrefix())) {
return false;
}
if (prefix.length() - cachedCompletion.getPrefix().length()
!= column - cachedCompletion.getColumn()) {
return false;
}
return true;
}
private List<File> clearLint() {
List<File> result = new ArrayList<>(lintTodo);
lintTodo.clear();
return result;
}
public interface LintCallback {
void onLint(List<DiagnosticWrapper> diagnostics);
}
public void lintLater(File file, LintCallback callback) {
lintTodo.add(file);
debounceLint.schedule(
cancelFunction -> {
callback.onLint(doLint(cancelFunction));
return Unit.INSTANCE;
});
}
public void lintNow(File file) {
lintTodo.add(file);
debounceLint.submitImmediately(
cancel -> {
doLint(cancel);
return Unit.INSTANCE;
});
}
public void doLint(File file, String contents, LintCallback callback) {
debounceLint.cancel();
debounceLint.schedule(
cancel -> {
doLint(file, contents, cancel, callback);
return Unit.INSTANCE;
});
}
public void doLint(
File file, String contents, Function0<Boolean> cancelCallback, LintCallback callback) {
if (cancelCallback.invoke()) {
return;
}
sp.put(file, contents, false);
BindingContext context = sp.compileFiles(Collections.singletonList(file));
if (cancelCallback.invoke()) {
return;
}
List<DiagnosticWrapper> diagnosticWrappers = new ArrayList<>();
Diagnostics diagnostics = context.getDiagnostics();
for (Diagnostic it : diagnostics) {
diagnosticWrappers.addAll(ConvertDiagnosticKt.convertDiagnostic(it));
}
lintCount++;
callback.onLint(diagnosticWrappers);
}
public List<DiagnosticWrapper> doLint(Function0<Boolean> cancelCallback) {
List<File> files = clearLint();
BindingContext context = sp.compileFiles(files);
if (!cancelCallback.invoke()) {
List<DiagnosticWrapper> diagnosticWrappers = new ArrayList<>();
Diagnostics diagnostics = context.getDiagnostics();
for (Diagnostic it : diagnostics) {
diagnosticWrappers.addAll(ConvertDiagnosticKt.convertDiagnostic(it));
}
lintCount++;
return diagnosticWrappers;
}
return Collections.emptyList();
}
}
| 10,029 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SourcePath.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/SourcePath.java | package com.tyron.kotlin_completion;
import android.util.Log;
import com.tyron.kotlin_completion.compiler.CompletionKind;
import com.tyron.kotlin_completion.index.SymbolIndex;
import com.tyron.kotlin_completion.util.AsyncExecutor;
import com.tyron.kotlin_completion.util.UtilKt;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import kotlin.Pair;
import kotlin.collections.CollectionsKt;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt;
import org.apache.commons.io.FileUtils;
import org.jetbrains.kotlin.com.intellij.lang.Language;
import org.jetbrains.kotlin.container.ComponentProvider;
import org.jetbrains.kotlin.descriptors.ModuleDescriptor;
import org.jetbrains.kotlin.idea.KotlinLanguage;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.resolve.BindingContext;
public class SourcePath {
private static final String TAG = "SourcePath";
private final CompilerClassPath cp;
private final Map<URI, SourceFile> files = new HashMap<>();
private final FakeLock parsedDataWriteLock = new FakeLock();
public static class FakeLock {
public void lock() {}
public void unlock() {}
}
private final AsyncExecutor indexAsync = new AsyncExecutor();
private final SymbolIndex index = new SymbolIndex();
private boolean indexEnabled = false;
private boolean indexInitialized;
public SourcePath(CompilerClassPath classPath) {
cp = classPath;
}
public CompilerClassPath getCompilerClassPath() {
return cp;
}
public SymbolIndex getIndex() {
return index;
}
public class SourceFile {
private final URI uri;
private String content;
private final Path path;
private KtFile parsed;
private KtFile compiledFile;
public BindingContext compiledContext;
private ComponentProvider compiledcontainer;
private final Language language;
private final boolean isTemporary;
private final String extension;
private final CompletionKind kind = CompletionKind.DEFAULT;
public SourceFile(URI uri, String content, Language language, boolean isTemporary) {
this(uri, content, Paths.get(uri), null, null, null, null, language, isTemporary);
}
public SourceFile(URI uri, String content, Language language) {
this(uri, content, Paths.get(uri), null, null, null, null, language, false);
}
private SourceFile(
URI uri,
String content,
Path path,
KtFile parsed,
KtFile compiledFile,
BindingContext compiledContext,
ComponentProvider compiledcontainer,
Language language,
boolean isTemporary) {
this.uri = uri;
this.content = content;
this.path = path;
this.parsed = parsed;
this.compiledFile = compiledFile;
this.compiledContext = compiledContext;
this.compiledcontainer = compiledcontainer;
this.language = language;
this.isTemporary = isTemporary;
extension = ".kt";
}
public void put(String newContent) {
content = newContent;
}
public void clean() {
parsed = null;
compiledFile = null;
compiledContext = null;
compiledcontainer = null;
}
public void parse() {
Log.d(TAG, "Parsing file " + path);
parsed =
cp.getCompiler()
.createKtFile(
content,
(path == null ? Paths.get("sourceFile.virtual" + extension) : path),
kind);
}
public void parseIfChanged() {
if (parsed == null || !content.equals(parsed.getText())) {
Log.d(TAG, "Parse has changed, parsing.");
parse();
}
}
public void compileIfNull() {
if (compiledFile == null) {
parseIfChanged();
doCompileIfChanged();
}
}
private void compile() {
parse();
doCompile();
}
private void compileIfChanged() {
parseIfChanged();
doCompileIfChanged();
}
private void doCompileIfChanged() {
if (parsed == null
|| compiledFile == null
|| !parsed.getText().equals(compiledFile.getText())) {
doCompile();
;
}
}
private void doCompile() {
if (this.path.toFile().getName().endsWith(".kt")) {
Pair<BindingContext, ComponentProvider> pair =
cp.getCompiler().compileKtFile(parsed, allIncludingThis());
parsedDataWriteLock.lock();
try {
compiledContext = pair.getFirst();
compiledcontainer = pair.getSecond();
compiledFile = parsed;
} finally {
parsedDataWriteLock.unlock();
}
}
initializeIndexAsyncIfNeeded(compiledcontainer);
}
public CompiledFile prepareCompiledFile() {
parseIfChanged();
compileIfNull();
return doPrepareCompiledFile();
}
public CompiledFile doPrepareCompiledFile() {
return new CompiledFile(
content, compiledFile, compiledContext, compiledcontainer, allIncludingThis(), cp);
}
private Collection<KtFile> allIncludingThis() {
parseIfChanged();
if (isTemporary) {
Set<KtFile> all = all(false);
Sequence<KtFile> plus =
SequencesKt.plus(
SequencesKt.asSequence(all.iterator()), SequencesKt.sequenceOf(parsed));
return SequencesKt.toList(plus);
} else {
return all(false);
}
}
}
public void put(File file, String content, boolean temp) {
assert !content.contains("\r");
Log.d(TAG, "Putting contents of " + file.getName());
if (temp) {
Log.d(TAG, "Adding temporary file");
}
if (files.containsKey(file.toURI())) {
sourceFile(file).put(content);
} else {
files.put(file.toURI(), new SourceFile(file.toURI(), content, KotlinLanguage.INSTANCE, temp));
}
}
public boolean deleteIfTemporary(File uri) {
if (sourceFile(uri).isTemporary) {
delete(uri);
return true;
}
return false;
}
public void delete(File file) {
files.remove(file.toURI());
}
public BindingContext compileFiles(Collection<File> all) {
Set<SourceFile> sources =
all.stream().map(o -> files.get(o.toURI())).collect(Collectors.toSet());
Set<SourceFile> allChanged =
sources.stream()
.filter(
it -> {
if (it.compiledFile == null) {
return true;
}
return !it.content.equals(it.compiledFile.getText());
})
.collect(Collectors.toSet());
BindingContext sourcesContext = compileAndUpdate(allChanged);
return UtilKt.util(sourcesContext, sources, allChanged);
}
private void initializeIndexAsyncIfNeeded(ComponentProvider container) {
indexAsync.execute(
() -> {
if (indexEnabled && !indexInitialized) {
ModuleDescriptor module =
(ModuleDescriptor) container.resolve(ModuleDescriptor.class).getValue();
index.refresh(module, true);
indexInitialized = true;
}
});
}
private BindingContext compileAndUpdate(Set<SourceFile> changed) {
if (changed.isEmpty()) return null;
Map<SourceFile, KtFile> parse =
CollectionsKt.associateWith(
changed,
sourceFile -> {
sourceFile.parseIfChanged();
return sourceFile.parsed;
});
Set<KtFile> all = all(false);
Pair<BindingContext, ComponentProvider> pair =
cp.getCompiler().compileKtFiles(parse.values(), all, CompletionKind.DEFAULT);
parse.forEach(
(f, parsed) -> {
parsedDataWriteLock.lock();
try {
if (f.parsed.equals(parsed)) {
f.compiledFile = parsed;
f.compiledContext = pair.getFirst();
f.compiledcontainer = pair.getSecond();
}
} finally {
parsedDataWriteLock.unlock();
}
});
initializeIndexAsyncIfNeeded(pair.getSecond());
return pair.getFirst();
}
public CompiledFile currentVersion(File file) {
SourceFile sourceFile = sourceFile(file);
sourceFile.compileIfChanged();
return sourceFile.prepareCompiledFile();
}
public CompiledFile latestCompiledVersion(File file) {
SourceFile sourceFile = sourceFile(file);
return sourceFile.prepareCompiledFile();
}
private SourceFile sourceFile(File file) {
if (!files.containsKey(file.toURI())) {
String string;
try {
string = FileUtils.readFileToString(file, Charset.defaultCharset());
Log.d("STRING", string);
} catch (IOException e) {
string = "";
}
put(file, string, true);
}
return files.get(file.toURI());
}
private Set<KtFile> all(boolean includeHidden) {
return files.values().stream()
.filter(it -> includeHidden || !it.isTemporary)
.map(
it -> {
it.parseIfChanged();
return it.parsed;
})
.collect(Collectors.toSet());
}
}
| 9,326 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
CompiledFile.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/CompiledFile.java | package com.tyron.kotlin_completion;
import com.tyron.completion.progress.ProgressManager;
import com.tyron.kotlin_completion.compiler.CompletionKind;
import com.tyron.kotlin_completion.position.Position;
import com.tyron.kotlin_completion.util.PsiUtils;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
import kotlin.collections.MapsKt;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt;
import kotlin.text.StringsKt;
import org.jetbrains.kotlin.com.google.common.collect.ImmutableMap;
import org.jetbrains.kotlin.com.intellij.openapi.util.Pair;
import org.jetbrains.kotlin.com.intellij.openapi.util.TextRange;
import org.jetbrains.kotlin.com.intellij.psi.PsiElement;
import org.jetbrains.kotlin.container.ComponentProvider;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.psi.KtCallExpression;
import org.jetbrains.kotlin.psi.KtDotQualifiedExpression;
import org.jetbrains.kotlin.psi.KtElement;
import org.jetbrains.kotlin.psi.KtExpression;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.psi.KtReferenceExpression;
import org.jetbrains.kotlin.psi.KtSafeQualifiedExpression;
import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.scopes.LexicalScope;
import org.jetbrains.kotlin.types.KotlinType;
public class CompiledFile {
private final String mContent;
private final KtFile mParse;
private final BindingContext mCompile;
private final ComponentProvider mContainer;
private final Collection<KtFile> mSourcePath;
private final CompilerClassPath mClassPath;
private final CompletionKind mKind = CompletionKind.DEFAULT;
public CompiledFile(
String mContent,
KtFile mParse,
BindingContext mCompile,
ComponentProvider mContainer,
Collection<KtFile> mSourcePath,
CompilerClassPath classpath) {
this.mContent = mContent;
this.mParse = mParse;
this.mCompile = mCompile;
this.mContainer = mContainer;
this.mClassPath = classpath;
this.mSourcePath = mSourcePath;
}
public KotlinType typeAtPoint(int cursor) {
KtElement cursorExpr = parseAtPoint(cursor, true);
if (cursorExpr == null) {
return null;
}
cursorExpr = PsiUtils.findParent(cursorExpr, KtExpression.class);
if (cursorExpr == null) {
return null;
}
KtElement surroundingExpr = expandForType(cursor, (KtExpression) cursorExpr);
LexicalScope scope = scopeAtPoint(cursor);
if (scope == null) {
return null;
}
return typeOfExpression((KtExpression) surroundingExpr, scope);
}
public KotlinType typeOfExpression(KtExpression expression, LexicalScope scopeWithImports) {
return bindingContextOf(expression, scopeWithImports).getType(expression);
}
public BindingContext bindingContextOf(KtExpression expression, LexicalScope scopeWithImports) {
return mClassPath
.getCompiler()
.compileKtExpression(expression, scopeWithImports, mSourcePath)
.getFirst();
}
public Pair<KtExpression, DeclarationDescriptor> referenceAtPoint(int cursor) {
ProgressManager.checkCanceled();
KtElement element = parseAtPoint(cursor, true);
if (element == null) {
return null;
}
KtExpression cursorExpr = PsiUtils.findParent(element, KtExpression.class);
if (cursorExpr == null) {
return null;
}
KtExpression surroundingExpr = expandForReference(cursor, cursorExpr);
LexicalScope scope = scopeAtPoint(cursor);
if (scope == null) {
return null;
}
BindingContext context = bindingContextOf(surroundingExpr, scope);
return referenceFromContext(cursor, context);
}
public Pair<KtExpression, DeclarationDescriptor> referenceFromContext(
int cursor, BindingContext context) {
ProgressManager.checkCanceled();
ImmutableMap<KtReferenceExpression, DeclarationDescriptor> targets =
context.getSliceContents(BindingContext.REFERENCE_TARGET);
Sequence<Map.Entry<KtReferenceExpression, DeclarationDescriptor>> filter =
SequencesKt.filter(
MapsKt.asSequence(targets), it -> it.getKey().getTextRange().contains(cursor));
Sequence<Map.Entry<KtReferenceExpression, DeclarationDescriptor>> sorted =
SequencesKt.sortedBy(filter, it -> it.getKey().getTextRange().getLength());
Sequence<Pair<KtExpression, DeclarationDescriptor>> map =
SequencesKt.map(sorted, it -> Pair.create(it.getKey(), it.getValue()));
return SequencesKt.firstOrNull(map);
}
public KtExpression expandForReference(int cursor, KtExpression surroundingExpr) {
PsiElement parent = surroundingExpr.getParent();
if (parent instanceof KtDotQualifiedExpression
|| parent instanceof KtSafeQualifiedExpression
|| parent instanceof KtCallExpression) {
KtExpression ktExpression = expandForReference(cursor, (KtExpression) parent);
if (ktExpression != null) {
return ktExpression;
}
}
return surroundingExpr;
}
private KtExpression expandForType(int cursor, KtExpression surroundingExpr) {
KtDotQualifiedExpression dotParent = (KtDotQualifiedExpression) surroundingExpr.getParent();
if (dotParent != null && dotParent.getSelectorExpression().getTextRange().contains(cursor)) {
return expandForType(cursor, dotParent);
}
return surroundingExpr;
}
public KtElement parseAtPoint(int cursor, boolean asReference) {
return CompiledFileUtilKt.parseAtPoint(
mClassPath, cursor, oldOffset(cursor), mContent, mParse, asReference);
}
public String lineBefore(int cursor) {
return StringsKt.substringAfterLast(mContent.substring(0, cursor), '\n', "\n");
}
public String lineAfter(int cursor) {
return StringsKt.substringBefore(mContent.substring(cursor), "\n", "\n");
}
public LexicalScope scopeAtPoint(int cursor) {
int oldCursor = oldOffset(cursor);
Sequence<Map.Entry<KtElement, LexicalScope>> sequence =
MapsKt.asSequence(mCompile.getSliceContents(BindingContext.LEXICAL_SCOPE));
Sequence<Map.Entry<KtElement, LexicalScope>> filter =
SequencesKt.filter(
sequence,
it ->
(it.getKey().getTextRange().getStartOffset() <= oldCursor
&& oldCursor <= it.getKey().getTextRange().getEndOffset()));
Sequence<Map.Entry<KtElement, LexicalScope>> entrySequence =
SequencesKt.sortedBy(filter, it -> it.getKey().getTextRange().getLength());
Sequence<LexicalScope> map = SequencesKt.map(entrySequence, Map.Entry::getValue);
return SequencesKt.firstOrNull(map);
}
public KtElement elementAtPoint(int cursor) {
int oldCursor = oldOffset(cursor);
PsiElement psi = mParse.findElementAt(oldCursor);
return PsiUtils.findParent(psi, KtElement.class);
}
private int oldOffset(int cursor) {
Pair<TextRange, TextRange> pair = Position.changedRegion(mParse.getText(), mContent);
if (pair == null || pair.getFirst() == null || pair.getSecond() == null) {
return cursor;
}
TextRange oldChanged = pair.getFirst();
TextRange newChanged = pair.getSecond();
if (cursor <= newChanged.getStartOffset()) {
return cursor;
}
if (cursor < newChanged.getEndOffset()) {
int newRelative = cursor - newChanged.getStartOffset();
int oldRelative = newRelative * oldChanged.getLength() / newChanged.getLength();
return oldChanged.getStartOffset() + oldRelative;
}
return mParse.getText().length() - (mContent.length() - cursor);
}
public String describeRange(TextRange range, boolean oldContent) {
try {
String c = oldContent ? mParse.getText() : mContent;
com.tyron.completion.model.Position start = Position.position(c, range.getStartOffset());
com.tyron.completion.model.Position end = Position.position(c, range.getEndOffset());
String file = mParse.getVirtualFile().getName();
return file
+ " "
+ start.line
+ ":"
+ (start.column + 1)
+ "-"
+ (end.line + 1)
+ ":"
+ (end.column + 1);
} catch (IOException e) {
return "Unknown range: " + range;
}
}
public ComponentProvider getContainer() {
return mContainer;
}
public BindingContext getCompile() {
return mCompile;
}
public KtFile getParse() {
return mParse;
}
public String getContent() {
return mContent;
}
}
| 8,475 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
KotlinCompletionModule.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/KotlinCompletionModule.java | package com.tyron.kotlin_completion;
import com.tyron.actions.ActionManager;
import com.tyron.kotlin_completion.action.ImplementAbstractFunctionsQuickFix;
public class KotlinCompletionModule {
public static void registerActions(ActionManager actionManager) {
actionManager.registerAction(
ImplementAbstractFunctionsQuickFix.ID, new ImplementAbstractFunctionsQuickFix());
}
}
| 394 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
CompilerClassPath.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/CompilerClassPath.java | package com.tyron.kotlin_completion;
import com.tyron.builder.BuildModule;
import com.tyron.builder.project.api.AndroidModule;
import com.tyron.kotlin_completion.classpath.ClassPathEntry;
import com.tyron.kotlin_completion.classpath.DefaultClassPathResolver;
import com.tyron.kotlin_completion.compiler.Compiler;
import com.tyron.kotlin_completion.util.AsyncExecutor;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import kotlin.collections.SetsKt;
import kotlin.jvm.functions.Function1;
public class CompilerClassPath implements Closeable {
private final Set<Path> mWorkspaceRoots = new HashSet<>();
private final Set<Path> mJavaSourcePath;
final Set<ClassPathEntry> mClassPath;
private final AndroidModule mProject;
// private final CompilerConfiguration mConfiguration;
private Compiler compiler;
private final AsyncExecutor asyncExecutor = new AsyncExecutor();
public CompilerClassPath(AndroidModule project) {
// mConfiguration = config;
mProject = project;
mJavaSourcePath =
project.getJavaFiles().values().stream().map(File::toPath).collect(Collectors.toSet());
mJavaSourcePath.addAll(
project.getJavaFiles().values().stream().map(File::toPath).collect(Collectors.toSet()));
mJavaSourcePath.addAll(
project.getResourceClasses().values().stream()
.map(File::toPath)
.collect(Collectors.toList()));
mClassPath =
project.getLibraries().stream()
.map(file -> new ClassPathEntry(file.toPath(), null))
.collect(Collectors.toSet());
mClassPath.add(new ClassPathEntry(BuildModule.getAndroidJar().toPath(), null));
mClassPath.add(
new ClassPathEntry(
new File(
project.getRootFile(),
"/build/libraries/kotlin_runtime/" + project.getRootFile().getName() + ".jar")
.toPath(),
null));
File javaDir = new File(project.getRootFile() + "/src/main/java");
File buildGenDir = new File(project.getRootFile() + "/build/gen");
File viewBindingDir = new File(project.getRootFile() + "/build/view_binding");
mJavaSourcePath.addAll(getFiles(javaDir, ".java"));
mJavaSourcePath.addAll(getFiles(buildGenDir, ".java"));
mJavaSourcePath.addAll(getFiles(viewBindingDir, ".java"));
compiler =
new Compiler(
project,
mJavaSourcePath,
mClassPath.stream().map(ClassPathEntry::getCompiledJar).collect(Collectors.toSet()));
// compiler.updateConfiguration(mConfiguration);
}
public Set<ClassPathEntry> getClassPath() {
return mClassPath;
}
private boolean refresh(boolean updateClassPath, boolean updateJavaSourcePath) {
DefaultClassPathResolver resolver = new DefaultClassPathResolver(mProject.getLibraries());
boolean refreshCompiler = updateJavaSourcePath;
if (updateClassPath) {
Set<ClassPathEntry> newClassPath = resolver.getClassPathOrEmpty();
if (!newClassPath.equals(mClassPath)) {
synchronized (mClassPath) {
syncPaths(mClassPath, newClassPath, "class paths", ClassPathEntry::getCompiledJar);
}
refreshCompiler = true;
}
}
asyncExecutor.compute(
() -> {
Set<ClassPathEntry> newClassPathWithSources = resolver.getClassPathWithSources();
synchronized (mClassPath) {
syncPaths(
mClassPath, newClassPathWithSources, "Source paths", ClassPathEntry::getSourceJar);
}
return null;
});
if (refreshCompiler) {
compiler.close();
compiler =
new Compiler(
mProject,
mJavaSourcePath,
mClassPath.stream().map(ClassPathEntry::getCompiledJar).collect(Collectors.toSet()));
updateCompilerConfiguration();
}
return refreshCompiler;
}
private void updateCompilerConfiguration() {
// compiler.updateConfiguration(mConfiguration);
}
public static Set<Path> getFiles(File dir, String ext) {
Set<Path> files = new HashSet<>();
File[] fileList = dir.listFiles();
if (fileList == null) {
return Collections.emptySet();
}
for (File file : fileList) {
if (file.isDirectory()) {
files.addAll(getFiles(file, ext));
} else {
if (file.getName().endsWith(ext)) {
files.add(file.toPath());
}
}
}
return files;
}
public <T> void syncPaths(
Set<ClassPathEntry> dest,
Set<ClassPathEntry> newSet,
String name,
Function1<T, Path> function) {
Set<ClassPathEntry> added = SetsKt.minus(newSet, dest);
Set<ClassPathEntry> removed = SetsKt.minus(dest, newSet);
dest.removeAll(removed);
dest.addAll(added);
}
public Compiler getCompiler() {
return compiler;
}
@Override
public void close() throws IOException {}
}
| 5,055 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Position.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/position/Position.java | package com.tyron.kotlin_completion.position;
import com.tyron.completion.model.Range;
import com.tyron.kotlin_completion.model.Location;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.StringReader;
import kotlin.text.StringsKt;
import org.jetbrains.kotlin.com.intellij.openapi.util.Pair;
import org.jetbrains.kotlin.com.intellij.openapi.util.TextRange;
import org.jetbrains.kotlin.com.intellij.psi.PsiElement;
public class Position {
public static int offset(String content, int line, int character) {
assert !content.contains("\r");
try {
BufferedReader reader = new BufferedReader(new StringReader(content));
int offset = 0;
int lineOffset = 0;
while (lineOffset < line) {
int nextChar = reader.read();
if (nextChar == -1) {
throw new RuntimeException("Reached end of line while parsing");
}
if (nextChar == '\n') {
lineOffset++;
}
offset++;
}
int charOffset = 0;
while (charOffset < character) {
int nextChar = reader.read();
if (nextChar == -1) {
throw new RuntimeException("Reached end of character while parsing");
}
charOffset++;
offset++;
}
return offset;
} catch (Exception e) {
return -1;
}
}
public static Pair<TextRange, TextRange> changedRegion(String oldContent, String newContent) {
if (oldContent.equals(newContent)) {
return null;
}
int prefix = StringsKt.commonPrefixWith(oldContent, newContent, false).length();
int suffix = StringsKt.commonSuffixWith(oldContent, newContent, false).length();
int oldEnd = Math.max(oldContent.length() - suffix, prefix);
int newEnd = Math.max(newContent.length() - suffix, prefix);
return Pair.create(new TextRange(prefix, oldEnd), new TextRange(prefix, newEnd));
}
public static com.tyron.completion.model.Position position(String content, int offset)
throws IOException {
StringReader reader = new StringReader(content);
int line = 0;
int c = 0;
int find = 0;
while (find < offset) {
int nextChar = reader.read();
if (nextChar == -1) {
throw new IllegalArgumentException("Reached end of file before reaching offset " + offset);
}
find++;
c++;
if (nextChar == '\n') {
line++;
c = 0;
}
}
return new com.tyron.completion.model.Position(line, c);
}
public static Location location(PsiElement expr) {
String content;
try {
content = expr.getContainingFile().getText();
} catch (NullPointerException e) {
content = null;
}
String file =
new File(
expr.getContainingFile()
.getOriginalFile()
.getViewProvider()
.getVirtualFile()
.getPath())
.toURI()
.toString();
if (content == null) {
return null;
}
return new Location(file, range(content, expr.getTextRange()));
}
public static Range range(String content, TextRange range) {
try {
return new Range(
position(content, range.getStartOffset()), position(content, range.getEndOffset()));
} catch (IOException e) {
return Range.NONE;
}
}
}
| 3,365 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ImplementAbstractFunctionsQuickFix.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/action/ImplementAbstractFunctionsQuickFix.java | package com.tyron.kotlin_completion.action;
import static org.jetbrains.kotlin.js.resolve.diagnostics.SourceLocationUtilsKt.findPsi;
import android.content.Context;
import androidx.annotation.NonNull;
import com.tyron.actions.AnActionEvent;
import com.tyron.actions.CommonDataKeys;
import com.tyron.completion.model.Rewrite;
import com.tyron.completion.model.TextEdit;
import com.tyron.completion.util.RewriteUtil;
import com.tyron.editor.Caret;
import com.tyron.editor.Editor;
import com.tyron.kotlin_completion.CompiledFile;
import com.tyron.kotlin_completion.util.PsiUtils;
import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.tools.Diagnostic;
import kotlin.text.StringsKt;
import org.jetbrains.kotlin.com.intellij.openapi.util.Pair;
import org.jetbrains.kotlin.com.intellij.psi.PsiElement;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.lexer.KtTokens;
import org.jetbrains.kotlin.psi.KtClass;
import org.jetbrains.kotlin.psi.KtDeclaration;
import org.jetbrains.kotlin.psi.KtElement;
import org.jetbrains.kotlin.psi.KtExpression;
import org.jetbrains.kotlin.psi.KtModifierList;
import org.jetbrains.kotlin.psi.KtNamedFunction;
import org.jetbrains.kotlin.psi.KtSuperTypeListEntry;
import org.jetbrains.kotlin.psi.KtTypeReference;
public class ImplementAbstractFunctionsQuickFix extends QuickFix {
public static final String ID = "kotlinImplementAbstractFunctionsQuickFIx";
public static final String ERROR_CODE = "ABSTRACT_MEMBER_NOT_IMPLEMENTED";
public static final String ERROR_CODE_CLASS = "ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED";
@Override
public boolean accept(@NonNull String errorCode) {
return ERROR_CODE.equals(errorCode) || ERROR_CODE_CLASS.equals(errorCode);
}
@Override
public String getTitle(Context context) {
return "Implement Abstract Functions";
}
@Override
public void actionPerformed(@NonNull AnActionEvent e) {
Editor editor = e.getRequiredData(CommonDataKeys.EDITOR);
File file = e.getRequiredData(CommonDataKeys.FILE);
Caret caret = editor.getCaret();
Diagnostic<?> diagnostic = e.getRequiredData(CommonDataKeys.DIAGNOSTIC);
CompiledFile compiledFile = e.getRequiredData(CommonKotlinKeys.COMPILED_FILE);
KtElement kotlinClass = compiledFile.parseAtPoint(caret.getStart(), false);
if (kotlinClass instanceof KtClass) {
List<String> functions = getAbstractFunctionsStubs(compiledFile, (KtClass) kotlinClass);
Rewrite<Void> rewrite =
new Rewrite<Void>() {
@Override
public Map<Path, TextEdit[]> rewrite(Void unused) {
return Collections.emptyMap();
}
};
RewriteUtil.performRewrite(editor, file, null, rewrite);
}
}
private List<String> getAbstractFunctionsStubs(CompiledFile file, KtClass kotlinClass) {
List<KtSuperTypeListEntry> superTypeListEntries = kotlinClass.getSuperTypeListEntries();
Stream<List<String>> streamStream =
superTypeListEntries.stream()
.map(
it -> {
Pair<KtExpression, DeclarationDescriptor> pair =
file.referenceAtPoint(PsiUtils.getStartOffset(it));
if (pair == null) {
return null;
}
DeclarationDescriptor descriptor = pair.getSecond();
if (descriptor == null) {
return null;
}
PsiElement superClass = findPsi(descriptor);
if (!(superClass instanceof KtClass)) {
return null;
}
KtClass ktSuperClass = (KtClass) superClass;
if (isAbstractOrInterface(ktSuperClass)) {
return ktSuperClass.getDeclarations().stream()
.filter(
decl ->
isAbstractFunction(decl)
&& !overridesDeclaration(kotlinClass, decl))
.map(function -> getFunctionStub(((KtNamedFunction) function)))
.collect(Collectors.toList());
}
return null;
})
.filter(Objects::nonNull);
List<String> strings = new ArrayList<>();
streamStream.forEach(strings::addAll);
return strings;
}
private String getFunctionStub(KtNamedFunction function) {
return "override fun" + StringsKt.substringAfter(function.getText(), "fun", "") + " { }";
}
private boolean isAbstractOrInterface(KtClass ktClass) {
if (ktClass.isInterface()) {
return true;
}
KtModifierList modifierList = ktClass.getModifierList();
if (modifierList != null) {
return modifierList.hasModifier(KtTokens.ABSTRACT_KEYWORD);
}
return false;
}
private boolean isAbstractFunction(KtDeclaration decl) {
if (decl instanceof KtNamedFunction) {
if (((KtNamedFunction) decl).hasBody()) {
return false;
}
KtModifierList modifierList = decl.getModifierList();
if (modifierList == null) {
return false;
}
return modifierList.hasModifier(KtTokens.ABSTRACT_KEYWORD);
}
return false;
}
private boolean overridesDeclaration(KtClass ktClass, KtDeclaration declaration) {
List<KtDeclaration> declarations = ktClass.getDeclarations();
return declarations.stream()
.anyMatch(
it -> {
String name = it.getName();
if (name == null) {
return false;
}
if (name.equals(declaration.getName()) && it.hasModifier(KtTokens.OVERRIDE_KEYWORD)) {
if (it instanceof KtNamedFunction && declaration instanceof KtNamedFunction) {
return parametersMatch(((KtNamedFunction) it), ((KtNamedFunction) declaration));
} else {
return true;
}
} else {
return false;
}
});
}
private boolean parametersMatch(KtNamedFunction function, KtNamedFunction functionDeclaration) {
if (function.getValueParameters().size() == functionDeclaration.getValueParameters().size()) {
for (int i = 0; i < function.getValueParameters().size(); i++) {
String fName = function.getValueParameters().get(i).getName();
String fdName = functionDeclaration.getName();
if (!Objects.equals(fName, fdName)) {
return false;
}
KtTypeReference typeReference = function.getValueParameters().get(i).getTypeReference();
KtTypeReference fdTypeReference = functionDeclaration.getTypeReference();
if (!Objects.equals(typeReference, fdTypeReference)) {
return false;
}
}
if (function.getTypeParameters().size() == functionDeclaration.getTypeParameters().size()) {
for (int i = 0; i < function.getTypeParameters().size(); i++) {
if (!function
.getTypeParameters()
.get(i)
.getVariance()
.equals(functionDeclaration.getTypeParameters().get(i).getVariance())) {
return false;
}
}
}
return true;
}
return false;
}
}
| 7,498 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
CommonKotlinKeys.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/action/CommonKotlinKeys.java | package com.tyron.kotlin_completion.action;
import com.tyron.kotlin_completion.CompiledFile;
import org.jetbrains.kotlin.com.intellij.openapi.util.Key;
public class CommonKotlinKeys {
public static final Key<CompiledFile> COMPILED_FILE = Key.create("Compiled File");
}
| 274 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
QuickFix.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/action/QuickFix.java | package com.tyron.kotlin_completion.action;
import android.content.Context;
import androidx.annotation.CallSuper;
import androidx.annotation.NonNull;
import com.tyron.actions.ActionPlaces;
import com.tyron.actions.AnAction;
import com.tyron.actions.AnActionEvent;
import com.tyron.actions.CommonDataKeys;
import com.tyron.actions.Presentation;
import com.tyron.kotlin_completion.CompiledFile;
import javax.tools.Diagnostic;
public abstract class QuickFix extends AnAction {
public abstract boolean accept(@NonNull String errorCode);
@CallSuper
@Override
public void update(@NonNull AnActionEvent event) {
Presentation presentation = event.getPresentation();
presentation.setVisible(false);
if (!ActionPlaces.EDITOR.equals(event.getPlace())) {
return;
}
CompiledFile compiledFile = event.getData(CommonKotlinKeys.COMPILED_FILE);
if (compiledFile == null) {
return;
}
Diagnostic<?> diagnostic = event.getData(CommonDataKeys.DIAGNOSTIC);
if (diagnostic == null) {
return;
}
if (!accept(diagnostic.getCode())) {
return;
}
presentation.setVisible(true);
presentation.setText(getTitle(event.getDataContext()));
}
public abstract String getTitle(Context context);
}
| 1,261 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
RenderCompletionItem.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/completion/RenderCompletionItem.java | package com.tyron.kotlin_completion.completion;
import com.tyron.completion.model.CompletionItem;
import com.tyron.completion.model.DrawableKind;
import java.util.Collections;
import java.util.List;
import kotlin.Unit;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt;
import kotlin.text.Regex;
import org.jetbrains.kotlin.builtins.FunctionTypesKt;
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import org.jetbrains.kotlin.descriptors.ConstructorDescriptor;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorVisitor;
import org.jetbrains.kotlin.descriptors.FunctionDescriptor;
import org.jetbrains.kotlin.descriptors.ModuleDescriptor;
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor;
import org.jetbrains.kotlin.descriptors.PackageViewDescriptor;
import org.jetbrains.kotlin.descriptors.PropertyDescriptor;
import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor;
import org.jetbrains.kotlin.descriptors.PropertySetterDescriptor;
import org.jetbrains.kotlin.descriptors.ReceiverParameterDescriptor;
import org.jetbrains.kotlin.descriptors.ScriptDescriptor;
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor;
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor;
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor;
import org.jetbrains.kotlin.descriptors.VariableDescriptor;
import org.jetbrains.kotlin.renderer.ClassifierNamePolicy;
import org.jetbrains.kotlin.renderer.DescriptorRenderer;
import org.jetbrains.kotlin.renderer.ParameterNameRenderingPolicy;
import org.jetbrains.kotlin.types.ErrorUtils;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.UnresolvedType;
public class RenderCompletionItem implements DeclarationDescriptorVisitor<CompletionItem, Void> {
private final boolean snippetsEnabled;
private final CompletionItem result = new CompletionItem();
DescriptorRenderer DECL_RENDERER =
DescriptorRenderer.Companion.withOptions(
it -> {
it.setWithDefinedIn(false);
it.setModifiers(Collections.emptySet());
it.setClassifierNamePolicy(ClassifierNamePolicy.SHORT.INSTANCE);
it.setParameterNameRenderingPolicy(ParameterNameRenderingPolicy.ONLY_NON_SYNTHESIZED);
it.setTypeNormalizer(
kotlinType -> {
if (kotlinType instanceof UnresolvedType) {
return ErrorUtils.createErrorTypeWithCustomDebugName(
((UnresolvedType) kotlinType).getPresentableName());
}
return kotlinType;
});
return Unit.INSTANCE;
});
public RenderCompletionItem(boolean snippetsEnabled) {
this.snippetsEnabled = snippetsEnabled;
}
private void setDefaults(DeclarationDescriptor d) {
result.label = label(d);
result.commitText = escape(label(d));
result.detail = DECL_RENDERER.render(d);
}
private String functionInsertText(FunctionDescriptor d) {
String name = escape(label(d));
return CompletionUtilsKt.functionInsertText(d, snippetsEnabled, name);
}
public static boolean isFunctionType(KotlinType d) {
if (d == null) {
return false;
}
return FunctionTypesKt.isFunctionType(d);
}
private String valueParametersSnippet(List<ValueParameterDescriptor> parameters) {
Sequence<ValueParameterDescriptor> sequence = SequencesKt.asSequence(parameters.iterator());
Sequence<ValueParameterDescriptor> filter =
SequencesKt.filterNot(sequence, ValueParameterDescriptor::declaresDefaultValue);
Sequence<String> map =
SequencesKt.mapIndexed(filter, (index, vpd) -> "$" + (index + 1) + ":" + vpd.getName());
return SequencesKt.joinToString(map, "", "", "", 0, "", null);
}
private final Regex GOOD_IDENTIFIER = new Regex("[a-zA-Z]\\w*");
private String escape(String id) {
if (GOOD_IDENTIFIER.matches(id)) {
return id;
}
return '`' + id + '`';
}
@Override
public CompletionItem visitPackageFragmentDescriptor(
PackageFragmentDescriptor packageFragmentDescriptor, Void unused) {
setDefaults(packageFragmentDescriptor);
return result;
}
@Override
public CompletionItem visitPackageViewDescriptor(
PackageViewDescriptor packageViewDescriptor, Void unused) {
setDefaults(packageViewDescriptor);
return result;
}
@Override
public CompletionItem visitVariableDescriptor(
VariableDescriptor variableDescriptor, Void unused) {
setDefaults(variableDescriptor);
result.iconKind = DrawableKind.LocalVariable;
return result;
}
@Override
public CompletionItem visitFunctionDescriptor(
FunctionDescriptor functionDescriptor, Void unused) {
setDefaults(functionDescriptor);
result.iconKind = DrawableKind.Method;
result.commitText = functionInsertText(functionDescriptor);
return result;
}
@Override
public CompletionItem visitTypeParameterDescriptor(
TypeParameterDescriptor typeParameterDescriptor, Void unused) {
setDefaults(typeParameterDescriptor);
return result;
}
@Override
public CompletionItem visitClassDescriptor(ClassDescriptor classDescriptor, Void unused) {
setDefaults(classDescriptor);
switch (classDescriptor.getKind()) {
case INTERFACE:
result.iconKind = DrawableKind.Interface;
break;
default:
case CLASS:
result.iconKind = DrawableKind.Class;
break;
}
return result;
}
@Override
public CompletionItem visitTypeAliasDescriptor(
TypeAliasDescriptor typeAliasDescriptor, Void unused) {
setDefaults(typeAliasDescriptor);
return result;
}
@Override
public CompletionItem visitModuleDeclaration(ModuleDescriptor moduleDescriptor, Void unused) {
setDefaults(moduleDescriptor);
return result;
}
@Override
public CompletionItem visitConstructorDescriptor(
ConstructorDescriptor constructorDescriptor, Void unused) {
setDefaults(constructorDescriptor);
return result;
}
@Override
public CompletionItem visitScriptDescriptor(ScriptDescriptor scriptDescriptor, Void unused) {
setDefaults(scriptDescriptor);
return result;
}
@Override
public CompletionItem visitPropertyDescriptor(
PropertyDescriptor propertyDescriptor, Void unused) {
setDefaults(propertyDescriptor);
return result;
}
@Override
public CompletionItem visitValueParameterDescriptor(
ValueParameterDescriptor valueParameterDescriptor, Void unused) {
setDefaults(valueParameterDescriptor);
return result;
}
@Override
public CompletionItem visitPropertyGetterDescriptor(
PropertyGetterDescriptor propertyGetterDescriptor, Void unused) {
setDefaults(propertyGetterDescriptor);
result.iconKind = DrawableKind.Field;
return result;
}
@Override
public CompletionItem visitPropertySetterDescriptor(
PropertySetterDescriptor propertySetterDescriptor, Void unused) {
setDefaults(propertySetterDescriptor);
result.iconKind = DrawableKind.Field;
return result;
}
@Override
public CompletionItem visitReceiverParameterDescriptor(
ReceiverParameterDescriptor receiverParameterDescriptor, Void unused) {
setDefaults(receiverParameterDescriptor);
return result;
}
private String label(DeclarationDescriptor d) {
if (d instanceof ConstructorDescriptor) {
return d.getContainingDeclaration().getName().getIdentifier();
}
if (d.getName().isSpecial()) {
return null;
}
return d.getName().getIdentifier();
}
}
| 7,696 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Completions.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/completion/Completions.java | package com.tyron.kotlin_completion.completion;
import com.tyron.completion.model.CompletionList;
import com.tyron.kotlin_completion.CompiledFile;
import com.tyron.kotlin_completion.index.SymbolIndex;
import kotlin.sequences.SequencesKt;
import kotlin.text.MatchResult;
import kotlin.text.Regex;
import kotlin.text.StringsKt;
public class Completions {
public CompletionList completions(CompiledFile file, int cursor, SymbolIndex index) {
String partial = findPartialIdentifier(file, cursor);
return CompletionUtilsKt.completions(file, cursor, index, partial);
}
public String findPartialIdentifier(CompiledFile file, int cursor) {
String line = file.lineBefore(cursor);
if (line.matches(String.valueOf(new Regex(".*\\.")))) {
return "";
}
if (line.matches(String.valueOf(new Regex(".*\\.\\w+")))) {
return StringsKt.substringAfterLast(line, ".", ".");
}
MatchResult matchResult = SequencesKt.lastOrNull(new Regex("\\w+").findAll(line, 0));
if (matchResult == null) {
return "";
}
return matchResult.getValue();
}
}
| 1,091 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ElementCompletionItems.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/completion/ElementCompletionItems.java | package com.tyron.kotlin_completion.completion;
import com.tyron.completion.model.CompletionItem;
import kotlin.sequences.Sequence;
import org.jetbrains.kotlin.psi.KtExpression;
public class ElementCompletionItems {
private final Sequence<CompletionItem> items;
private final boolean isExhaustive;
private final KtExpression receiver;
public ElementCompletionItems(
Sequence<CompletionItem> items, boolean isExhaustive, KtExpression receiver) {
this.items = items;
this.isExhaustive = isExhaustive;
this.receiver = receiver;
}
public Sequence<CompletionItem> getItems() {
return items;
}
public boolean isExhaustive() {
return isExhaustive;
}
public KtExpression getReceiver() {
return receiver;
}
public Sequence<CompletionItem> component1() {
return items;
}
public boolean component2() {
return isExhaustive;
}
public KtExpression component3() {
return receiver;
}
}
| 956 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
CompilationEnvironment.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/compiler/CompilationEnvironment.java | package com.tyron.kotlin_completion.compiler;
import com.tyron.builder.project.api.KotlinModule;
import com.tyron.kotlin.completion.core.model.KotlinEnvironment;
import com.tyron.kotlin.completion.core.resolve.CodeAssistAnalyzerFacadeForJVM;
import java.io.Closeable;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Set;
import java.util.stream.Collectors;
import kotlin.Pair;
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys;
import org.jetbrains.kotlin.cli.common.environment.UtilKt;
import org.jetbrains.kotlin.cli.common.messages.MessageCollector;
import org.jetbrains.kotlin.cli.jvm.compiler.CliBindingTrace;
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment;
import org.jetbrains.kotlin.cli.jvm.config.JvmContentRootsKt;
import org.jetbrains.kotlin.com.intellij.openapi.Disposable;
import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer;
import org.jetbrains.kotlin.config.ApiVersion;
import org.jetbrains.kotlin.config.CommonConfigurationKeys;
import org.jetbrains.kotlin.config.CompilerConfiguration;
import org.jetbrains.kotlin.config.JVMConfigurationKeys;
import org.jetbrains.kotlin.config.JvmTarget;
import org.jetbrains.kotlin.config.LanguageFeature;
import org.jetbrains.kotlin.config.LanguageVersion;
import org.jetbrains.kotlin.config.LanguageVersionSettings;
import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl;
import org.jetbrains.kotlin.container.ComponentProvider;
import org.jetbrains.kotlin.context.MutableModuleContext;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.psi.KtPsiFactory;
import org.jetbrains.kotlin.resolve.BindingTraceContext;
public class CompilationEnvironment implements Closeable {
private final KotlinModule mModule;
private final Set<Path> mJavaSourcePath;
private final Set<Path> mClassPath;
private final Disposable mDisposable = Disposer.newDisposable();
private final KotlinCoreEnvironment mEnvironment;
private final KtPsiFactory mParser;
public CompilationEnvironment(
KotlinModule module, Set<Path> javaSourcePath, Set<Path> classPath) {
mModule = module;
mJavaSourcePath = javaSourcePath;
mClassPath = classPath;
UtilKt.setIdeaIoUseFallback();
mEnvironment = KotlinEnvironment.getEnvironment(module);
updateConfig(mEnvironment.getConfiguration());
mParser = new KtPsiFactory(mEnvironment.getProject());
}
private void updateConfig(CompilerConfiguration configuration) {
HashMap<LanguageFeature, LanguageFeature.State> map = new HashMap<>();
for (LanguageFeature value : LanguageFeature.values()) {
map.put(value, LanguageFeature.State.ENABLED);
}
// Map<AnalysisFlag<?>, Object> analysisFlags = new HashMap<>();
// analysisFlags.put(AnalysisFlags.getSkipMetadataVersionCheck(), false);
LanguageVersionSettings settings =
new LanguageVersionSettingsImpl(
LanguageVersion.LATEST_STABLE,
ApiVersion.createByLanguageVersion(LanguageVersion.LATEST_STABLE),
// analysisFlags,
Collections.emptyMap(),
map);
configuration.put(CommonConfigurationKeys.MODULE_NAME, mModule.getName());
configuration.put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, settings);
configuration.put(
CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.Companion.getNONE());
configuration.put(JVMConfigurationKeys.USE_PSI_CLASS_FILES_READING, true);
configuration.put(JVMConfigurationKeys.NO_JDK, true);
JvmContentRootsKt.addJvmClasspathRoots(
configuration, mClassPath.stream().map(Path::toFile).collect(Collectors.toList()));
JvmContentRootsKt.addJavaSourceRoots(
configuration, mJavaSourcePath.stream().map(Path::toFile).collect(Collectors.toList()));
}
private CompilerConfiguration getConfiguration() {
CompilerConfiguration configuration = new CompilerConfiguration();
updateConfig(configuration);
return configuration;
}
public Pair<ComponentProvider, BindingTraceContext> createContainer(
Collection<KtFile> sourcePath) {
return createContainer(Collections.emptyList(), sourcePath);
}
public Pair<ComponentProvider, BindingTraceContext> createContainer(
Collection<KtFile> filesToAnalyze, Collection<KtFile> sourcePath) {
CliBindingTrace trace = new CliBindingTrace();
MutableModuleContext moduleContext =
CodeAssistAnalyzerFacadeForJVM.createModuleContext(
getEnvironment().getProject(), getEnvironment().getConfiguration(), true);
ComponentProvider container =
CodeAssistAnalyzerFacadeForJVM.INSTANCE.createContainer(
trace,
moduleContext,
filesToAnalyze,
sourcePath,
getEnvironment(),
mModule,
JvmTarget.JVM_1_8);
return new Pair<>(container, trace);
}
public void updateConfiguration(CompilerConfiguration config) {
JvmTarget name = config.get(JVMConfigurationKeys.JVM_TARGET);
if (name != null) {
mEnvironment.getConfiguration().put(JVMConfigurationKeys.JVM_TARGET, name);
}
}
public JvmTarget getJvmTargetFrom(String target) {
switch (target) {
case "default":
return JvmTarget.DEFAULT;
case "1.8":
return JvmTarget.JVM_1_8;
case "17":
return JvmTarget.JVM_17;
default:
return null;
}
}
@Override
public void close() {
Disposer.dispose(mDisposable);
}
public KtPsiFactory getParser() {
return mParser;
}
public KotlinCoreEnvironment getEnvironment() {
return mEnvironment;
}
}
| 5,682 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Compiler.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/compiler/Compiler.java | package com.tyron.kotlin_completion.compiler;
import android.util.Log;
import com.tyron.builder.project.api.KotlinModule;
import com.tyron.kotlin.completion.core.resolve.AnalysisResultWithProvider;
import com.tyron.kotlin.completion.core.resolve.KotlinAnalyzer;
import java.io.Closeable;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.locks.ReentrantLock;
import kotlin.Pair;
import org.jetbrains.kotlin.cli.common.environment.UtilKt;
import org.jetbrains.kotlin.com.intellij.lang.Language;
import org.jetbrains.kotlin.com.intellij.lang.java.JavaLanguage;
import org.jetbrains.kotlin.com.intellij.openapi.vfs.StandardFileSystems;
import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileManager;
import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileSystem;
import org.jetbrains.kotlin.com.intellij.psi.PsiFile;
import org.jetbrains.kotlin.com.intellij.psi.PsiFileFactory;
import org.jetbrains.kotlin.com.intellij.psi.PsiJavaFile;
import org.jetbrains.kotlin.config.CompilerConfiguration;
import org.jetbrains.kotlin.container.ComponentProvider;
import org.jetbrains.kotlin.idea.KotlinLanguage;
import org.jetbrains.kotlin.psi.KtExpression;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.resolve.BindingContext;
import org.jetbrains.kotlin.resolve.BindingTraceContext;
import org.jetbrains.kotlin.resolve.LazyTopDownAnalyzer;
import org.jetbrains.kotlin.resolve.TopDownAnalysisMode;
import org.jetbrains.kotlin.resolve.calls.components.InferenceSession;
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo;
import org.jetbrains.kotlin.resolve.scopes.LexicalScope;
import org.jetbrains.kotlin.types.TypeUtils;
import org.jetbrains.kotlin.types.expressions.ExpressionTypingServices;
public class Compiler implements Closeable {
private final Set<Path> mJavaSourcePath;
private final Set<Path> mClassPath;
private final CompilationEnvironment mDefaultCompileEnvironment;
private final VirtualFileSystem mLocalFileSystem;
private final ReentrantLock mCompileLock = new ReentrantLock();
private boolean closed = false;
public Compiler(KotlinModule module, Set<Path> javaSourcePath, Set<Path> classPath) {
mJavaSourcePath = javaSourcePath;
mClassPath = classPath;
mDefaultCompileEnvironment = new CompilationEnvironment(module, mJavaSourcePath, mClassPath);
mLocalFileSystem =
VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.FILE_PROTOCOL);
UtilKt.setIdeaIoUseFallback();
}
public PsiFile createPsiFile(String content) {
return createPsiFile(
content, Paths.get("dummy.virtual.kt"), KotlinLanguage.INSTANCE, CompletionKind.DEFAULT);
}
public PsiFile createPsiFile(String content, Path file, Language language, CompletionKind kind) {
assert !content.contains("\r");
PsiFile newFile =
psiFileFactoryFor(kind).createFileFromText(file.toString(), language, content, true, false);
assert newFile.getVirtualFile() != null;
return newFile;
}
public KtFile createKtFile(String content, Path file, CompletionKind kind) {
return (KtFile) createPsiFile(content, file, KotlinLanguage.INSTANCE, kind);
}
public PsiJavaFile createJavaFile(String content, Path file, CompletionKind kind) {
return (PsiJavaFile) createPsiFile(content, file, JavaLanguage.INSTANCE, kind);
}
public PsiFileFactory psiFileFactoryFor(CompletionKind kind) {
return PsiFileFactory.getInstance(mDefaultCompileEnvironment.getEnvironment().getProject());
}
public Pair<BindingContext, ComponentProvider> compileKtFile(
KtFile file, Collection<KtFile> sourcePath) {
return compileKtFiles(Collections.singletonList(file), sourcePath, CompletionKind.DEFAULT);
}
public Pair<BindingContext, ComponentProvider> compileKtFiles(
Collection<? extends KtFile> files, Collection<KtFile> sourcePath, CompletionKind kind) {
mCompileLock.lock();
try {
AnalysisResultWithProvider result = KotlinAnalyzer.INSTANCE.analyzeFiles(sourcePath, files);
return new Pair<>(
result.getAnalysisResult().getBindingContext(), result.getComponentProvider());
// Pair<ComponentProvider, BindingTraceContext> pair =
// mDefaultCompileEnvironment.createContainer(sourcePath);
// ((LazyTopDownAnalyzer)
// pair.getFirst().resolve(LazyTopDownAnalyzer.class).getValue())
// .analyzeDeclarations(TopDownAnalysisMode.TopLevelDeclarations, files,
// DataFlowInfo.Companion.getEMPTY(), null);
// return new Pair<>(pair.getSecond().getBindingContext(), pair.getFirst());
} finally {
mCompileLock.unlock();
}
}
public CompilationEnvironment getDefaultCompileEnvironment() {
return mDefaultCompileEnvironment;
}
public Pair<BindingContext, ComponentProvider> compileJavaFiles(
Collection<? extends PsiJavaFile> files, Collection<KtFile> sourcePath, CompletionKind kind) {
mCompileLock.lock();
try {
Pair<ComponentProvider, BindingTraceContext> pair =
mDefaultCompileEnvironment.createContainer(sourcePath);
((LazyTopDownAnalyzer) pair.getFirst().resolve(LazyTopDownAnalyzer.class).getValue())
.analyzeDeclarations(
TopDownAnalysisMode.TopLevelDeclarations,
files,
DataFlowInfo.Companion.getEMPTY(),
null);
return new Pair<>(pair.getSecond().getBindingContext(), pair.getFirst());
} finally {
mCompileLock.unlock();
}
}
public Pair<BindingContext, ComponentProvider> compileKtExpression(
KtExpression expression, LexicalScope scopeWithImports, Collection<KtFile> sourcePath) {
Log.d(null, "Compiling kt expression: " + expression.getText());
mCompileLock.lock();
try {
Pair<ComponentProvider, BindingTraceContext> pair =
mDefaultCompileEnvironment.createContainer(sourcePath);
ExpressionTypingServices incrementalCompiler =
pair.getFirst().create(ExpressionTypingServices.class);
incrementalCompiler.getTypeInfo(
scopeWithImports,
expression,
TypeUtils.NO_EXPECTED_TYPE,
DataFlowInfo.Companion.getEMPTY(),
InferenceSession.Companion.getDefault(),
pair.getSecond(),
true);
return new Pair<>(pair.getSecond().getBindingContext(), pair.getFirst());
} finally {
mCompileLock.unlock();
}
}
public void updateConfiguration(CompilerConfiguration config) {
mDefaultCompileEnvironment.updateConfiguration(config);
}
@Override
public void close() {
if (!closed) {
mDefaultCompileEnvironment.close();
closed = true;
} else {
Log.w(null, "Compiler is already closed!");
}
}
}
| 6,882 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ClassPathEntry.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/classpath/ClassPathEntry.java | package com.tyron.kotlin_completion.classpath;
import java.nio.file.Path;
public class ClassPathEntry {
private final Path mCompiledJar;
private final Path mSourceJar;
public ClassPathEntry(Path compiledJar, Path sourceJar) {
mCompiledJar = compiledJar;
mSourceJar = sourceJar;
}
public Path getCompiledJar() {
return mCompiledJar;
}
public Path getSourceJar() {
return mSourceJar;
}
@Override
public int hashCode() {
return mCompiledJar.hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ClassPathEntry) {
if (((ClassPathEntry) obj).mCompiledJar.equals(this.mCompiledJar)) {
return true;
}
}
return false;
}
}
| 727 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ClassPathResolver.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/classpath/ClassPathResolver.java | package com.tyron.kotlin_completion.classpath;
import java.util.Collections;
import java.util.Set;
public interface ClassPathResolver {
ClassPathResolver EMPTY =
new ClassPathResolver() {
@Override
public String getResolveType() {
return "[]";
}
@Override
public Set<ClassPathEntry> getClassPath() {
return Collections.emptySet();
}
};
String getResolveType();
Set<ClassPathEntry> getClassPath();
default Set<ClassPathEntry> getClassPathOrEmpty() {
try {
return getClassPath();
} catch (Exception e) {
return Collections.emptySet();
}
}
default Set<ClassPathEntry> getClassPathWithSources() {
return getClassPath();
}
}
| 750 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
DefaultClassPathResolver.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/classpath/DefaultClassPathResolver.java | package com.tyron.kotlin_completion.classpath;
import java.io.File;
import java.util.Collection;
import java.util.Set;
import java.util.stream.Collectors;
public class DefaultClassPathResolver implements ClassPathResolver {
private final Collection<File> mLibraries;
public DefaultClassPathResolver(Collection<File> libraries) {
mLibraries = libraries;
}
@Override
public String getResolveType() {
return "Default";
}
@Override
public Set<ClassPathEntry> getClassPath() {
return mLibraries.stream()
.map(file -> new ClassPathEntry(file.toPath(), null))
.collect(Collectors.toSet());
}
@Override
public Set<ClassPathEntry> getClassPathWithSources() {
return mLibraries.stream()
.map(
file -> {
File source =
new File(
file.getParentFile(),
file.getName().substring(0, file.getName().lastIndexOf("."))
+ "-sources.jar");
return new ClassPathEntry(file.toPath(), (source.exists() ? source.toPath() : null));
})
.collect(Collectors.toSet());
}
}
| 1,161 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
PsiUtils.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/util/PsiUtils.java | package com.tyron.kotlin_completion.util;
import com.tyron.completion.progress.ProgressManager;
import kotlin.sequences.Sequence;
import kotlin.sequences.SequencesKt;
import org.jetbrains.kotlin.com.intellij.psi.PsiElement;
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.psi.KtElement;
import org.jetbrains.kotlin.psi.psiUtil.PsiUtilsKt;
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
import org.jetbrains.kotlin.resolve.scopes.HierarchicalScope;
import org.jetbrains.kotlin.resolve.scopes.LexicalScope;
import org.jetbrains.kotlin.resolve.scopes.utils.ScopeUtilsKt;
import org.jetbrains.kotlin.types.KotlinType;
import org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt;
public class PsiUtils {
public static <Find> Find findParent(PsiElement element, Class<Find> find) {
ProgressManager.checkCanceled();
Sequence<PsiElement> parentsWithSelf = PsiUtilsKt.getParentsWithSelf(element);
Sequence<Find> sequence = SequencesKt.filterIsInstance(parentsWithSelf, find);
return SequencesKt.firstOrNull(sequence);
}
public static Sequence<PsiElement> getParentsWithSelf(PsiElement element) {
return PsiUtilsKt.getParentsWithSelf(element);
}
public static Sequence<HierarchicalScope> getParentsWithSelf(LexicalScope scope) {
return ScopeUtilsKt.getParentsWithSelf(scope);
}
public static KotlinType replaceArgumentsWithStarProjections(KotlinType type) {
return TypeUtilsKt.replaceArgumentsWithStarProjections(type);
}
public static int getStartOffset(KtElement element) {
return PsiUtilsKt.getStartOffset(element);
}
public static int getEndOffset(KtElement element) {
return PsiUtilsKt.getEndOffset(element);
}
public static Sequence<DeclarationDescriptor> getParentsWithSelf(DeclarationDescriptor d) {
ProgressManager.checkCanceled();
return DescriptorUtilsKt.getParentsWithSelf(d);
}
public static FqName getFqNameSafe(DeclarationDescriptor d) {
ProgressManager.checkCanceled();
return DescriptorUtilsKt.getFqNameSafe(d);
}
}
| 2,119 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
AsyncExecutor.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/util/AsyncExecutor.java | package com.tyron.kotlin_completion.util;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import kotlin.jvm.functions.Function0;
public class AsyncExecutor {
private int threadCount = 0;
private final ExecutorService workerThread =
Executors.newSingleThreadExecutor(runnable -> new Thread(runnable, "async" + threadCount++));
public void execute(Runnable task) {
CompletableFuture.runAsync(task, workerThread);
}
public <R> CompletableFuture<R> compute(Function0<R> task) {
return CompletableFuture.supplyAsync(task::invoke, workerThread);
}
public void shutdown(boolean await) {
workerThread.shutdown();
;
if (await) {
try {
workerThread.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| 960 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SymbolKind.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/model/SymbolKind.java | package com.tyron.kotlin_completion.model;
public enum SymbolKind {
File(1),
Module(2),
Namespace(3),
Package(4),
Class(5),
Method(6),
Property(7),
Field(8),
Constructor(9),
Enum(10),
Interface(11),
Function(12),
Variable(13),
Constant(14),
String(15),
Number(16),
Boolean(17),
Array(18),
Object(19),
Key(20),
Null(21),
EnumMember(22),
Struct(23),
Event(24),
Operator(25),
TypeParameter(26);
private final int value;
SymbolKind(int value) {
this.value = value;
}
public int getValue() {
return this.value;
}
public static SymbolKind forValue(int value) {
SymbolKind[] allValues = SymbolKind.values();
if (value < 1 || value > allValues.length) {
throw new IllegalArgumentException("Illegal enum value: " + value);
}
return allValues[value];
}
}
| 871 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Location.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/model/Location.java | package com.tyron.kotlin_completion.model;
import com.tyron.completion.model.Range;
public class Location {
private String uri;
private Range range;
public Location() {}
public Location(String uri, Range range) {
this.uri = uri;
this.range = range;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public Range getRange() {
return range;
}
public void setRange(Range range) {
this.range = range;
}
}
| 503 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SymbolTag.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/model/SymbolTag.java | package com.tyron.kotlin_completion.model;
public enum SymbolTag {
Deprecated(1);
private final int value;
SymbolTag(int value) {
this.value = value;
}
public int getValue() {
return this.value;
}
public static SymbolTag forValue(int value) {
SymbolTag[] allValues = SymbolTag.values();
if (value < 1 || value > allValues.length) {
throw new IllegalArgumentException("Illegal enum value: " + value);
}
return allValues[value];
}
}
| 482 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
DocumentSymbol.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin_completion/model/DocumentSymbol.java | package com.tyron.kotlin_completion.model;
import com.tyron.completion.model.Range;
import java.util.List;
public class DocumentSymbol {
private String name;
private SymbolKind kind;
private Range range;
private Range selectionRange;
private String detail;
private List<SymbolTag> tags;
private List<DocumentSymbol> children;
public DocumentSymbol() {}
public DocumentSymbol(
final String name, final SymbolKind kind, final Range range, final Range selectionRange) {
this.name = name;
this.kind = kind;
this.range = range;
this.selectionRange = selectionRange;
}
public DocumentSymbol(
final String name,
final SymbolKind kind,
final Range range,
final Range selectionRange,
final String detail) {
this(name, kind, range, selectionRange);
this.detail = detail;
}
public DocumentSymbol(
final String name,
final SymbolKind kind,
final Range range,
final Range selectionRange,
final String detail,
final List<DocumentSymbol> children) {
this(name, kind, range, selectionRange);
this.detail = detail;
this.children = children;
}
public String getName() {
return this.name;
}
public void setName(final String name) {
this.name = name;
}
public SymbolKind getKind() {
return this.kind;
}
public void setKind(SymbolKind kind) {
this.kind = kind;
}
public Range getRange() {
return this.range;
}
public void setRange(Range range) {
this.range = range;
}
public Range getSelectionRange() {
return this.selectionRange;
}
public void setSelectionRange(Range range) {
this.selectionRange = range;
}
public String getDetail() {
return this.detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public List<SymbolTag> getTags() {
return this.tags;
}
public void setTags(List<SymbolTag> tags) {
this.tags = tags;
}
public List<DocumentSymbol> getChildren() {
return this.children;
}
public void setChildren(final List<DocumentSymbol> children) {
this.children = children;
}
@Override
public String toString() {
return this.name;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
DocumentSymbol other = (DocumentSymbol) obj;
if (this.name == null) {
if (other.name != null) {
return false;
}
} else if (!this.name.equals(other.name)) {
return false;
}
if (this.kind == null) {
if (other.kind != null) {
return false;
}
} else if (!this.kind.equals(other.kind)) {
return false;
}
if (this.range == null) {
if (other.range != null) {
return false;
}
} else if (!this.range.equals(other.range)) {
return false;
}
if (this.selectionRange == null) {
if (other.selectionRange != null) {
return false;
}
} else if (!this.selectionRange.equals(other.selectionRange)) {
return false;
}
if (this.detail == null) {
if (other.detail != null) {
return false;
}
} else if (!this.detail.equals(other.detail)) {
return false;
}
if (this.tags == null) {
if (other.tags != null) {
return false;
}
} else if (!this.tags.equals(other.tags)) {
return false;
}
if (this.children == null) {
if (other.children != null) {
return false;
}
} else if (!this.children.equals(other.children)) {
return false;
}
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
result = prime * result + ((this.kind == null) ? 0 : this.kind.hashCode());
result = prime * result + ((this.range == null) ? 0 : this.range.hashCode());
result = prime * result + ((this.selectionRange == null) ? 0 : this.selectionRange.hashCode());
result = prime * result + ((this.detail == null) ? 0 : this.detail.hashCode());
result = prime * result + ((this.tags == null) ? 0 : this.tags.hashCode());
return prime * result + ((this.children == null) ? 0 : this.children.hashCode());
}
}
| 4,414 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
CodeAssistJavaClassFinder.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin/completion/core/resolve/lang/java/CodeAssistJavaClassFinder.java | package com.tyron.kotlin.completion.core.resolve.lang.java;
import androidx.annotation.NonNull;
import com.tyron.builder.project.api.KotlinModule;
import com.tyron.kotlin.completion.core.model.KotlinEnvironment;
import java.util.Set;
import org.jetbrains.kotlin.com.intellij.openapi.project.Project;
import org.jetbrains.kotlin.com.intellij.psi.search.GlobalSearchScope;
import org.jetbrains.kotlin.config.JvmTarget;
import org.jetbrains.kotlin.config.LanguageVersionSettings;
import org.jetbrains.kotlin.load.java.AbstractJavaClassFinder;
import org.jetbrains.kotlin.load.java.JavaClassFinderImpl;
import org.jetbrains.kotlin.load.java.structure.JavaClass;
import org.jetbrains.kotlin.load.java.structure.JavaPackage;
import org.jetbrains.kotlin.name.ClassId;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.resolve.BindingTrace;
import org.jetbrains.kotlin.resolve.lazy.KotlinCodeAnalyzer;
public class CodeAssistJavaClassFinder extends AbstractJavaClassFinder {
private KotlinModule module;
private final JavaClassFinderImpl impl = new JavaClassFinderImpl();
public CodeAssistJavaClassFinder(KotlinModule module) {
this.module = module;
}
@Override
public void initialize(
BindingTrace trace,
KotlinCodeAnalyzer codeAnalyzer,
LanguageVersionSettings languageVersionSettings,
JvmTarget jvmTarget) {
Project project = KotlinEnvironment.getEnvironment(module).getProject();
setProjectInstance(project);
impl.setScope(GlobalSearchScope.allScope(project));
impl.initialize(trace, codeAnalyzer, languageVersionSettings, jvmTarget);
}
@Override
public JavaClass findClass(@NonNull ClassId classId) {
return impl.findClass(classId);
}
@Override
public void setProjectInstance(@NonNull Project project) {
impl.setProjectInstance(project);
}
@Override
public JavaClass findClass(@NonNull Request request) {
return impl.findClass(request);
}
@Override
public JavaPackage findPackage(@NonNull FqName fqName) {
return impl.findPackage(fqName);
}
@Override
public Set<String> knownClassNamesInPackage(@NonNull FqName fqName) {
return impl.knownClassNamesInPackage(fqName);
}
}
| 2,205 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
NonBlockingReadActionImpl.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin/completion/core/model/NonBlockingReadActionImpl.java | package com.tyron.kotlin.completion.core.model;
import com.google.common.util.concurrent.AsyncCallable;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.tyron.completion.progress.ProgressManager;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.concurrency.CancellablePromise;
import org.jetbrains.kotlin.com.intellij.openapi.application.ModalityState;
import org.jetbrains.kotlin.com.intellij.openapi.application.NonBlockingReadAction;
public class NonBlockingReadActionImpl<T> implements NonBlockingReadAction<T> {
private final Callable<T> myCallable;
public NonBlockingReadActionImpl(Callable<T> callable) {
myCallable = callable;
}
@Override
public NonBlockingReadAction<T> expireWhen(BooleanSupplier booleanSupplier) {
return new NonBlockingReadActionImpl<>(myCallable);
}
@Override
public NonBlockingReadAction<T> finishOnUiThread(
ModalityState modalityState, Consumer<? super T> consumer) {
ListenableFuture<T> result =
ProgressManager.getInstance()
.computeNonCancelableAsync(
new AsyncCallable<T>() {
@Override
public ListenableFuture<T> call() throws Exception {
return Futures.immediateFuture(myCallable.call());
}
});
Futures.addCallback(
result,
new FutureCallback<T>() {
@Override
public void onSuccess(@Nullable T result) {
consumer.accept(result);
}
@Override
public void onFailure(Throwable t) {}
},
runnable -> ProgressManager.getInstance().runLater(runnable));
return this;
}
@Override
public NonBlockingReadAction<T> coalesceBy(Object... objects) {
return this;
}
@Override
public CancellablePromise<T> submit(Executor executor) {
Future<T> result = ((ExecutorService) executor).submit(myCallable);
return new CancellablePromiseWrapper<>(result);
}
}
| 2,366 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
CancellablePromiseWrapper.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/kotlin-completion/src/main/java/com/tyron/kotlin/completion/core/model/CancellablePromiseWrapper.java | package com.tyron.kotlin.completion.core.model;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.jetbrains.concurrency.CancellablePromise;
public class CancellablePromiseWrapper<T> implements CancellablePromise<T> {
private final Future<T> result;
public CancellablePromiseWrapper(Future<T> result) {
this.result = result;
}
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return result.cancel(mayInterruptIfRunning);
}
@Override
public boolean isCancelled() {
return result.isCancelled();
}
@Override
public boolean isDone() {
return result.isDone();
}
@Override
public T get() throws ExecutionException, InterruptedException {
return result.get();
}
@Override
public T get(long timeout, TimeUnit unit)
throws ExecutionException, InterruptedException, TimeoutException {
return result.get(timeout, unit);
}
}
| 1,032 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusResources.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusResources.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.DrawableValue;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.Style;
import com.flipkart.android.proteus.value.Value;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Collectors;
/**
* ProteusResources
*
* @author adityasharat
*/
public class ProteusResources {
@NonNull private final Map<String, ViewTypeParser> parsers;
@Nullable private final LayoutManager layoutManager;
@NonNull private final FunctionManager functionManager;
@Nullable private final StyleManager styleManager;
private final StringManager stringManager;
private final DrawableManager drawableManager;
private final ColorManager colorManager;
private final DimensionManager dimensionManager;
ProteusResources(
@NonNull Map<String, ViewTypeParser> parsers,
@Nullable LayoutManager layoutManager,
@NonNull FunctionManager functionManager,
@Nullable StyleManager styleManager,
StringManager stringManager,
DrawableManager drawableManager,
ColorManager colorManager,
DimensionManager dimensionManager) {
this.parsers = parsers;
this.layoutManager = layoutManager;
this.functionManager = functionManager;
this.styleManager = styleManager;
this.stringManager = stringManager;
this.drawableManager = drawableManager;
this.colorManager = colorManager;
this.dimensionManager = dimensionManager;
}
@NonNull
public FunctionManager getFunctionManager() {
return this.functionManager;
}
@NonNull
public Function getFunction(@NonNull String name) {
return functionManager.get(name);
}
@Nullable
public Layout getLayout(@NonNull String name) {
return null != layoutManager ? layoutManager.get(name) : null;
}
public Value getString(String name) {
return null != stringManager ? stringManager.get(name, Locale.getDefault()) : null;
}
public DrawableValue getDrawable(String name) {
return null != drawableManager ? drawableManager.get(name) : null;
}
public Value getColor(String name) {
if (name.startsWith("@color/")) {
name = name.substring("@color/".length());
}
return null != colorManager ? colorManager.getColor(name) : null;
}
public List<Style> findStyle(String name) {
return styleManager.getStyles().entrySet().stream()
.filter(e -> e.getKey().contains(name))
.map(Map.Entry::getValue)
.collect(Collectors.toList());
}
@NonNull
public Map<String, ViewTypeParser> getParsers() {
return parsers;
}
@Nullable
public Style getStyle(String name) {
if (name.startsWith("@style/")) {
name = name.substring("@style/".length());
}
return null != styleManager ? styleManager.get(name) : null;
}
public Value getDimension(String name) {
if (name.startsWith("@dimen/")) {
name = name.substring("@dimen/".length());
}
return null != dimensionManager ? dimensionManager.getDimension(name) : null;
}
}
| 3,788 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusContextWrapper.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusContextWrapper.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
/**
* ProteusContextWrapper
*
* <p>A wrapper for {@link ProteusContext} that simply delegates all of its calls to another
* ProteusContext. Can be subclassed to modify or to add new behavior without changing the original
* ProteusContext.
*
* @author adityasharat
*/
public class ProteusContextWrapper extends ProteusContext {
public ProteusContextWrapper(ProteusContext context) {
super(context, context.getProteusResources(), context.getLoader(), context.getCallback());
}
}
| 1,145 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ColorManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ColorManager.java | package com.flipkart.android.proteus;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.Value;
import java.util.Map;
public abstract class ColorManager {
protected abstract Map<String, Value> getColors();
@Nullable
public Value getColor(String name) {
return getColors() != null ? getColors().get(name) : null;
}
}
| 360 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Function.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/Function.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.annotation.SuppressLint;
import android.content.Context;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.parser.ParseHelper;
import com.flipkart.android.proteus.toolbox.Utils;
import com.flipkart.android.proteus.value.Array;
import com.flipkart.android.proteus.value.Primitive;
import com.flipkart.android.proteus.value.Value;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @author Aditya Sharat on 18-05-2015.
*/
public abstract class Function {
// SPECIAL
public static final Function NOOP =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
return ProteusConstants.EMPTY_STRING;
}
@Override
public String getName() {
return "noop";
}
};
@SuppressLint("SimpleDateFormat")
public static final Function DATE =
new Function() {
private SimpleDateFormat from = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private SimpleDateFormat to = new SimpleDateFormat("E, d MMM");
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
Date in = getFromFormat(arguments).parse(arguments[0].getAsString());
String out = getToFormat(arguments).format(in);
return new Primitive(out);
}
private SimpleDateFormat getFromFormat(Value[] arguments) {
if (arguments.length > 2) {
return new SimpleDateFormat(arguments[2].getAsString());
} else {
return from;
}
}
private SimpleDateFormat getToFormat(Value[] arguments) {
if (arguments.length > 1) {
return new SimpleDateFormat(arguments[1].getAsString());
} else {
return to;
}
}
@Override
public String getName() {
return "date";
}
};
public static final Function FORMAT =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
String template = arguments[0].getAsString();
String[] values = new String[arguments.length - 1];
for (int i = 1; i < arguments.length; i++) {
values[i - 1] = arguments[i].getAsString();
}
return new Primitive(String.format(template, (Object[]) values));
}
@Override
public String getName() {
return "format";
}
};
public static final Function JOIN =
new Function() {
private static final String DEFAULT_DELIMITER = ", ";
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
return new Primitive(Utils.join(arguments[0].getAsArray(), getDelimiter(arguments)));
}
private String getDelimiter(Value[] arguments) {
if (arguments.length > 1) {
return arguments[1].getAsString();
}
return DEFAULT_DELIMITER;
}
@Override
public String getName() {
return "join";
}
};
public static final Function NUMBER =
new Function() {
private final DecimalFormat DEFAULT_FORMATTER = new DecimalFormat("#,###");
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double number = Double.parseDouble(arguments[0].getAsString());
DecimalFormat formatter = getFormatter(arguments);
formatter.setRoundingMode(RoundingMode.FLOOR);
formatter.setMinimumFractionDigits(0);
formatter.setMaximumFractionDigits(2);
return new Primitive(formatter.format(number));
}
private DecimalFormat getFormatter(Value[] arguments) {
if (arguments.length > 1) {
return new DecimalFormat(arguments[1].getAsString());
}
return DEFAULT_FORMATTER;
}
@Override
public String getName() {
return "number";
}
};
// Mathematical
public static final Function ADD =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double sum = 0;
for (Value argument : arguments) {
sum = sum + argument.getAsDouble();
}
return new Primitive(sum);
}
@Override
public String getName() {
return "add";
}
};
public static final Function SUBTRACT =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double sum = arguments[0].getAsDouble();
for (int i = 1; i < arguments.length; i++) {
sum = sum - arguments[i].getAsDouble();
}
return new Primitive(sum);
}
@Override
public String getName() {
return "sub";
}
};
public static final Function MULTIPLY =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double product = 1;
for (Value argument : arguments) {
product = product * argument.getAsDouble();
}
return new Primitive(product);
}
@Override
public String getName() {
return "mul";
}
};
public static final Function DIVIDE =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double quotient = arguments[0].getAsDouble();
for (int i = 1; i < arguments.length; i++) {
quotient = quotient / arguments[i].getAsDouble();
}
return new Primitive(quotient);
}
@Override
public String getName() {
return "div";
}
};
public static final Function MODULO =
new Function() {
@NonNull
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double remainder = arguments[0].getAsDouble();
for (int i = 1; i < arguments.length; i++) {
remainder = remainder % arguments[i].getAsDouble();
}
return new Primitive(remainder);
}
@Override
public String getName() {
return "mod";
}
};
// Logical
public static final Function AND =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 1) {
return ProteusConstants.FALSE;
}
boolean bool = true;
for (Value argument : arguments) {
bool = ParseHelper.parseBoolean(argument);
if (!bool) {
break;
}
}
return bool ? ProteusConstants.TRUE : ProteusConstants.FALSE;
}
@Override
public String getName() {
return "and";
}
};
public static final Function OR =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 1) {
return ProteusConstants.FALSE;
}
boolean bool = false;
for (Value argument : arguments) {
bool = ParseHelper.parseBoolean(argument);
if (bool) {
break;
}
}
return bool ? ProteusConstants.TRUE : ProteusConstants.FALSE;
}
@Override
public String getName() {
return "or";
}
};
// Unary
public static final Function NOT =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 1) {
return ProteusConstants.TRUE;
}
return ParseHelper.parseBoolean(arguments[0])
? ProteusConstants.FALSE
: ProteusConstants.TRUE;
}
@Override
public String getName() {
return "not";
}
};
// Comparison
public static final Function EQUALS =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 2) {
return ProteusConstants.FALSE;
}
Value x = arguments[0];
Value y = arguments[1];
boolean bool = false;
if (x.isPrimitive() && y.isPrimitive()) {
bool = x.getAsPrimitive().equals(y.getAsPrimitive());
}
return bool ? ProteusConstants.TRUE : ProteusConstants.FALSE;
}
@Override
public String getName() {
return "eq";
}
};
public static final Function LESS_THAN =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 2) {
return ProteusConstants.FALSE;
}
Value x = arguments[0];
Value y = arguments[1];
boolean bool = false;
if (x.isPrimitive() && y.isPrimitive()) {
bool = x.getAsPrimitive().getAsDouble() < y.getAsPrimitive().getAsDouble();
}
return bool ? ProteusConstants.TRUE : ProteusConstants.FALSE;
}
@Override
public String getName() {
return "lt";
}
};
public static final Function GREATER_THAN =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 2) {
return ProteusConstants.FALSE;
}
Value x = arguments[0];
Value y = arguments[1];
boolean bool = false;
if (x.isPrimitive() && y.isPrimitive()) {
bool = x.getAsPrimitive().getAsDouble() > y.getAsPrimitive().getAsDouble();
}
return bool ? ProteusConstants.TRUE : ProteusConstants.FALSE;
}
@Override
public String getName() {
return "gt";
}
};
public static final Function LESS_THAN_OR_EQUALS =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 2) {
return ProteusConstants.FALSE;
}
Value x = arguments[0];
Value y = arguments[1];
boolean bool = false;
if (x.isPrimitive() && y.isPrimitive()) {
bool = x.getAsPrimitive().getAsDouble() <= y.getAsPrimitive().getAsDouble();
}
return bool ? ProteusConstants.TRUE : ProteusConstants.FALSE;
}
@Override
public String getName() {
return "lte";
}
};
public static final Function GREATER_THAN_OR_EQUALS =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
if (arguments.length < 2) {
return ProteusConstants.FALSE;
}
Value x = arguments[0];
Value y = arguments[1];
boolean bool = false;
if (x.isPrimitive() && y.isPrimitive()) {
bool = x.getAsPrimitive().getAsDouble() >= y.getAsPrimitive().getAsDouble();
}
return bool ? ProteusConstants.TRUE : ProteusConstants.FALSE;
}
@Override
public String getName() {
return "gte";
}
};
// Conditional
public static final Function TERNARY =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
Value i = arguments[0];
Value t = arguments[1];
Value e = arguments[2];
return ParseHelper.parseBoolean(i) ? t : e;
}
@Override
public String getName() {
return "ternary";
}
};
// String
// String.charAt()
public static final Function CHAR_AT =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
String string = arguments[0].getAsString();
int index = arguments[1].getAsInt();
char charAtIndex = string.charAt(index);
return new Primitive(charAtIndex);
}
@Override
public String getName() {
return "charAt";
}
};
// String.contains()
public static final Function CONTAINS =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
String string = arguments[0].getAsString();
String substring = arguments[1].getAsString();
boolean bool = string.contains(substring);
return new Primitive(bool);
}
@Override
public String getName() {
return "contains";
}
};
// String.endsWith()
// String.indexOf()
// String.isEmpty()
public static final Function IS_EMPTY =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
String string = arguments[0].getAsString();
return new Primitive(ProteusConstants.EMPTY.equals(string));
}
@Override
public String getName() {
return "isEmpty";
}
};
// String.lastIndexOf()
// String.length()
public static final Function LENGTH =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
Value value = arguments[0];
int length = 0;
if (value.isPrimitive()) {
length = value.getAsString().length();
} else if (value.isArray()) {
length = value.getAsArray().size();
}
return new Primitive(length);
}
@Override
public String getName() {
return "length";
}
};
// String.matches()
// String.replace()
// String.replaceAll()
// String.replaceFirst()
// String.split()
// String.startsWith()
// String.substring()
// String.toLowerCase()
// String.toUpperCase()
// String.trim()
public static final Function TRIM =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
String string = arguments[0].getAsString().trim();
return new Primitive(string);
}
@Override
public String getName() {
return "trim";
}
};
// String.subSequence()
// Math
// Math.abs
// Math.ceil
// Math.floor
// Math.pow
// Math.round
// Math.random
// Math.max
public static final Function MAX =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double max = arguments[0].getAsDouble();
double current;
for (int i = 1; i < arguments.length; i++) {
current = arguments[i].getAsDouble();
if (current > max) {
max = current;
}
}
return new Primitive(max);
}
@Override
public String getName() {
return "max";
}
};
// Math.min
public static final Function MIN =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
double min = arguments[0].getAsDouble();
double current;
for (int i = 1; i < arguments.length; i++) {
current = arguments[i].getAsDouble();
if (current < min) {
min = current;
}
}
return new Primitive(min);
}
@Override
public String getName() {
return "min";
}
};
// Array
public static final Function SLICE =
new Function() {
@NonNull
@Override
public Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception {
Array in = arguments[0].getAsArray();
int start = getStart(in, arguments);
int end = getEnd(in, arguments);
Array out = new Array();
for (int i = start; i < end; i++) {
out.add(in.get(i));
}
return out;
}
private int getStart(Array in, Value[] arguments) {
if (arguments.length > 1) {
int index = arguments[1].getAsInt();
if (index < 0) {
index = in.size() - index;
if (index < 0) {
return 0;
}
} else if (index > in.size()) {
index = in.size();
}
return index;
}
return 0;
}
private int getEnd(Array in, Value[] arguments) {
if (arguments.length > 2) {
int index = arguments[2].getAsInt();
if (index < 0) {
index = in.size() - index;
if (index < 0) {
return 0;
}
} else if (index > in.size()) {
index = in.size();
}
return index;
}
return in.size();
}
@Override
public String getName() {
return "slice";
}
};
@NonNull
public abstract Value call(Context context, Value data, int dataIndex, Value... arguments)
throws Exception;
public abstract String getName();
}
| 20,076 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusConstants.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusConstants.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import com.flipkart.android.proteus.value.Primitive;
/** Contains data binding constants */
public class ProteusConstants {
public static final String TYPE = "type";
public static final String LAYOUT = "layout";
public static final String DATA = "data";
public static final String COLLECTION = "collection";
public static final String DATA_NULL = "null";
public static final String STYLE_DELIMITER = "\\.";
public static final String EMPTY = "";
public static final Primitive EMPTY_STRING = new Primitive(EMPTY);
public static final Primitive TRUE = new Primitive(true);
public static final Primitive FALSE = new Primitive(false);
private static boolean isLoggingEnabled = BuildConfig.DEBUG;
public static void setIsLoggingEnabled(boolean isLoggingEnabled) {
ProteusConstants.isLoggingEnabled = isLoggingEnabled;
}
public static boolean isLoggingEnabled() {
return ProteusConstants.isLoggingEnabled;
}
}
| 1,603 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
FunctionManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/FunctionManager.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import java.util.Map;
/**
* FunctionManager
*
* @author adityasharat
*/
public class FunctionManager {
@NonNull private final Map<String, Function> functions;
public FunctionManager(@NonNull Map<String, Function> functions) {
this.functions = functions;
}
@NonNull
public Function get(@NonNull String name) {
Function function = functions.get(name);
if (function == null) {
function = Function.NOOP;
}
return function;
}
}
| 1,156 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusView.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusView.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Style;
import com.flipkart.android.proteus.value.Value;
import java.util.Collections;
import java.util.Map;
/**
* ProteusView
*
* <p>This interface is just to add behaviour to Android views so they can host the Proteus View
* Managers. Since Java < JDK 8 do not have default implementations for interfaces all Views
* which need to be inflated via proteus need to implement this interface.
*
* @author adtityasharat
*/
public interface ProteusView {
/**
* @return The View Manager of this Proteus View.
*/
Manager getViewManager();
/**
* @param manager Sets a View Manager on this View.
*/
void setViewManager(@NonNull Manager manager);
/**
* @return The interface as an Android native View.
*/
@NonNull
View getAsView();
/**
* Manager
*
* @author aditya.sharat
*/
interface Manager {
default void setOnDragListener(View.OnDragListener listener) {
;
}
default View.OnDragListener getOnDragListener() {
return null;
}
default void setOnClickListener(View.OnClickListener listener) {}
default View.OnClickListener getOnClickListener() {
return null;
}
default void setOnLongClickListener(View.OnLongClickListener listener) {}
default View.OnLongClickListener getOnLongClickListener() {
return null;
}
default <T extends View> ViewTypeParser<T> getViewTypeParser() {
return null;
}
/**
* Update the {@link View} with new data.
*
* @param data New data for the view
*/
void update(@Nullable ObjectValue data);
default void updateAttribute(String name, Value value) {}
default void updateAttribute(String name, String value) {}
default void removeAttribute(String name) {}
default void setStyle(Style style) {}
default void setTheme(Style theme) {}
default Style getTheme() {
return null;
}
default Style getStyle() {
return getContext().getStyle();
}
default String getAttributeName(int id) {
return "Unknown";
}
default Map<String, ViewTypeParser.AttributeSet.Attribute> getLayoutParamsAttributes() {
return Collections.emptyMap();
}
default Map<String, ViewTypeParser.AttributeSet.Attribute> getAvailableAttributes() {
return Collections.emptyMap();
}
/**
* Look for a child view with the given id. If this view has the given id, return this view.
* Similar to {@link View#findViewById(int)}. Since Proteus is a runtime inflater, layouts use
* String ids instead of int and it generates unique int ids using the {@link IdGenerator}.
*
* @param id The string id to search for.
* @return The view that has the given id in the hierarchy or null
*/
@Nullable
View findViewById(@NonNull String id);
/**
* @return The Proteus Context associated with this Manager.
*/
@NonNull
ProteusContext getContext();
/**
* @return The Layout of View which is hosting this manager.
*/
@NonNull
Layout getLayout();
/**
* @return The Data Context of the view which is hosting this manager.
*/
@NonNull
DataContext getDataContext();
/**
* Returns this proteus view's extras.
*
* @return the Object stored in this view as a extra, or {@code null} if not set
* @see #setExtras(Object)
*/
@Nullable
Object getExtras();
/**
* Sets the extra associated with this view. A extra can be used to mark a view in its hierarchy
* and does not have to be unique within the hierarchy. Extras can also be used to store data
* within a proteus view without resorting to another data structure. It is similar to {@link
* View#setTag(Object)}
*
* @param extras The object to set as the extra.
* @see #setExtras(Object)
*/
void setExtras(@Nullable Object extras);
}
}
| 4,805 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Proteus.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/Proteus.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Size;
import java.util.HashMap;
import java.util.Map;
/**
* Proteus
*
* @author aditya.sharat
*/
public final class Proteus {
@NonNull public final FunctionManager functions;
@NonNull private final Map<String, Type> types;
@NonNull private final Map<String, ViewTypeParser> parsers;
Proteus(@NonNull Map<String, Type> types, @NonNull final Map<String, Function> functions) {
this.types = types;
this.functions = new FunctionManager(functions);
this.parsers = map(types);
}
public boolean has(@NonNull @Size(min = 1) String type) {
return types.containsKey(type);
}
@Nullable
public ViewTypeParser.AttributeSet.Attribute getAttributeId(
@NonNull @Size(min = 1) String name, @NonNull @Size(min = 1) String type) {
return types.get(type).getAttributeId(name);
}
private Map<String, ViewTypeParser> map(Map<String, Type> types) {
Map<String, ViewTypeParser> parsers = new HashMap<>(types.size());
for (Map.Entry<String, Type> entry : types.entrySet()) {
parsers.put(entry.getKey(), entry.getValue().parser);
}
return parsers;
}
@NonNull
public ProteusContext createContext(@NonNull Context base) {
return createContextBuilder(base).build();
}
@NonNull
public ProteusContext.Builder createContextBuilder(@NonNull Context base) {
return new ProteusContext.Builder(base, parsers, functions);
}
public static class Type {
public final int id;
public final String type;
public final ViewTypeParser parser;
private final ViewTypeParser.AttributeSet attributes;
Type(
int id,
@NonNull String type,
@NonNull ViewTypeParser parser,
@NonNull ViewTypeParser.AttributeSet attributes) {
this.id = id;
this.type = type;
this.parser = parser;
this.attributes = attributes;
}
@Nullable
public ViewTypeParser.AttributeSet.Attribute getAttributeId(String name) {
return attributes.getAttribute(name);
}
}
}
| 2,781 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusBuilder.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusBuilder.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.parser.IncludeParser;
import com.flipkart.android.proteus.parser.ViewParser;
import com.flipkart.android.proteus.parser.custom.ButtonParser;
import com.flipkart.android.proteus.parser.custom.CheckBoxParser;
import com.flipkart.android.proteus.parser.custom.EditTextParser;
import com.flipkart.android.proteus.parser.custom.FrameLayoutParser;
import com.flipkart.android.proteus.parser.custom.HorizontalProgressBarParser;
import com.flipkart.android.proteus.parser.custom.HorizontalScrollViewParser;
import com.flipkart.android.proteus.parser.custom.ImageButtonParser;
import com.flipkart.android.proteus.parser.custom.ImageViewParser;
import com.flipkart.android.proteus.parser.custom.LinearLayoutParser;
import com.flipkart.android.proteus.parser.custom.ListViewParser;
import com.flipkart.android.proteus.parser.custom.ProgressBarParser;
import com.flipkart.android.proteus.parser.custom.RatingBarParser;
import com.flipkart.android.proteus.parser.custom.RelativeLayoutParser;
import com.flipkart.android.proteus.parser.custom.ScrollViewParser;
import com.flipkart.android.proteus.parser.custom.TextViewParser;
import com.flipkart.android.proteus.parser.custom.ViewGroupParser;
import com.flipkart.android.proteus.parser.custom.WebViewParser;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* ProteusBuilder
*
* @author aditya.sharat
*/
public class ProteusBuilder {
/** The Default Module of Proteus. */
public static final Module DEFAULT_MODULE =
new Module() {
@Override
public void registerWith(ProteusBuilder builder) {
// register the default parsers
builder.register(new ViewParser<>());
builder.register(new IncludeParser<>());
builder.register(new ViewGroupParser<>());
builder.register(new RelativeLayoutParser<>());
builder.register(new LinearLayoutParser<>());
builder.register(new FrameLayoutParser<>());
builder.register(new ScrollViewParser<>());
builder.register(new HorizontalScrollViewParser<>());
builder.register(new ImageViewParser<>());
builder.register(new TextViewParser<>());
builder.register(new EditTextParser<>());
builder.register(new ButtonParser<>());
builder.register(new ImageButtonParser<>());
builder.register(new WebViewParser<>());
builder.register(new RatingBarParser<>());
builder.register(new CheckBoxParser<>());
builder.register(new ProgressBarParser<>());
builder.register(new HorizontalProgressBarParser<>());
builder.register(new ListViewParser<>());
// register the default functions
builder.register(Function.DATE);
builder.register(Function.FORMAT);
builder.register(Function.JOIN);
builder.register(Function.NUMBER);
builder.register(Function.ADD);
builder.register(Function.SUBTRACT);
builder.register(Function.MULTIPLY);
builder.register(Function.DIVIDE);
builder.register(Function.MODULO);
builder.register(Function.AND);
builder.register(Function.OR);
builder.register(Function.NOT);
builder.register(Function.EQUALS);
builder.register(Function.LESS_THAN);
builder.register(Function.GREATER_THAN);
builder.register(Function.LESS_THAN_OR_EQUALS);
builder.register(Function.GREATER_THAN_OR_EQUALS);
builder.register(Function.TERNARY);
builder.register(Function.CHAR_AT);
builder.register(Function.CONTAINS);
builder.register(Function.IS_EMPTY);
builder.register(Function.LENGTH);
builder.register(Function.TRIM);
builder.register(Function.MAX);
builder.register(Function.MIN);
builder.register(Function.SLICE);
}
};
private static final int ID = -1;
private Map<String, Map<String, AttributeProcessor>> processors = new LinkedHashMap<>();
private Map<String, ViewTypeParser> parsers = new LinkedHashMap<>();
private HashMap<String, Function> functions = new HashMap<>();
public ProteusBuilder() {
DEFAULT_MODULE.registerWith(this);
}
public ProteusBuilder register(
@NonNull String type, @NonNull Map<String, AttributeProcessor> processors) {
Map<String, AttributeProcessor> map = getExtraAttributeProcessors(type);
map.putAll(processors);
return this;
}
public ProteusBuilder register(
@NonNull String type, @NonNull String name, @NonNull AttributeProcessor processor) {
Map<String, AttributeProcessor> map = getExtraAttributeProcessors(type);
map.put(name, processor);
return this;
}
public ProteusBuilder register(@NonNull ViewTypeParser parser) {
String parentType = parser.getParentType();
if (parentType != null && !parsers.containsKey(parentType)) {
throw new IllegalStateException(parentType + " is not a registered type parser");
}
parsers.put(parser.getType(), parser);
return this;
}
public ProteusBuilder register(@NonNull Function function) {
functions.put(function.getName(), function);
return this;
}
public ProteusBuilder register(@NonNull Module module) {
module.registerWith(this);
return this;
}
@Nullable
public ViewTypeParser get(@NonNull String type) {
return parsers.get(type);
}
public Proteus build() {
Map<String, Proteus.Type> types = new HashMap<>();
for (Map.Entry<String, ViewTypeParser> entry : parsers.entrySet()) {
types.put(entry.getKey(), prepare(entry.getValue()));
}
return new Proteus(types, functions);
}
protected Proteus.Type prepare(ViewTypeParser parser) {
String name = parser.getType();
ViewTypeParser parent = parsers.get(parser.getParentType());
Map<String, AttributeProcessor> extras = this.processors.get(name);
//noinspection unchecked
return new Proteus.Type(ID, name, parser, parser.prepare(parent, extras));
}
protected Map<String, AttributeProcessor> getExtraAttributeProcessors(String type) {
Map<String, AttributeProcessor> map = this.processors.get(type);
if (map == null) {
map = new LinkedHashMap<>();
this.processors.put(type, map);
}
return map;
}
public interface Module {
/**
* @param builder
*/
void registerWith(ProteusBuilder builder);
}
}
| 7,290 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
DrawableManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/DrawableManager.java | package com.flipkart.android.proteus;
import com.flipkart.android.proteus.value.DrawableValue;
import java.util.Map;
public abstract class DrawableManager {
protected abstract Map<String, DrawableValue> getDrawables();
public DrawableValue get(String name) {
return null != getDrawables() ? getDrawables().get(name) : null;
}
}
| 342 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
LayoutManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/LayoutManager.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.Layout;
import java.util.Map;
/**
* LayoutManager
*
* @author adityasharat
*/
public abstract class LayoutManager {
@Nullable
protected abstract Map<String, Layout> getLayouts();
@Nullable
public Layout get(@NonNull String name) {
return null != getLayouts() ? getLayouts().get(name) : null;
}
}
| 1,083 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
StyleManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/StyleManager.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.Style;
import java.util.Map;
/**
* StyleManager
*
* @author adityasharat
*/
public abstract class StyleManager {
@Nullable
protected abstract Map<String, Style> getStyles();
@Nullable
public Style get(@NonNull String name) {
return null != getStyles() ? getStyles().get(name) : null;
}
}
| 1,074 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
DataContext.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/DataContext.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.managers.ViewManager;
import com.flipkart.android.proteus.value.Binding.FunctionBinding;
import com.flipkart.android.proteus.value.Null;
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Value;
import java.util.Map;
/**
* DataContext class hosts a the data, scope, index, and if this context has it's own scope or if it
* inherits from a parent. An instance of this class used in the update flow of a {@link
* ProteusView} which is executed when {@link ViewManager#update(ObjectValue)} is invoked. The
* {@link #data} is update on every update call.
*
* @author Aditya Sharat
*/
public class DataContext {
/**
* This property is used to identify whether this data context is simply cloned from it's parent
* data context. Which implies that the {@link #scope} and {@link #data} were copied from it's
* parents data context.
*/
private final boolean hasOwnProperties;
/**
* This is the local isolated scope created for this {@link ProteusView} hosting this instance of
* the data context. This is populated from the {@code data} attribute specified in the layout.
*/
@Nullable private final Map<String, Value> scope;
/**
* This index is used to resolve the {@code $index} meta values when dealing with arrays and data
* bound {@code children} attribute.
*/
private final int index;
/** The data which will be used to bind all data bound attribute values of the layout. */
private ObjectValue data;
/**
* This is the default constructor to create a new {@code DataContext}. The {@link
* #hasOwnProperties} is initialized to {@code true} is and only if the {@param scope} argument is
* non null. An empty non null, null, a {@param scope} which does not refer to any data paths from
* the parent scope implies that the hosting {@link ProteusView} is completely isolated from the
* parent and cannot access any data from above it in the hierarchy.
*
* @param scope the local isolate scope for this data context.
* @param index the data index for this data context.
*/
private DataContext(@Nullable Map<String, Value> scope, int index) {
this.scope = scope;
this.index = index;
this.hasOwnProperties = scope != null;
}
/**
* This is a copy constructor for creating a clone of another data context. The {@link
* #hasOwnProperties} is always {@code false} for a cloned data context.
*
* @param dataContext the parent data context to clone from.
*/
public DataContext(DataContext dataContext) {
this.data = dataContext.getData();
this.scope = dataContext.getScope();
this.index = dataContext.getIndex();
this.hasOwnProperties = false;
}
/**
* Utility method to create a new {@link DataContext} without any {@link #scope}.
*
* @param context The proteus context to resolve {@link FunctionBinding} to evaluate the scope.
* @param data The data to be used by the data context.
* @param dataIndex The data index to used by the data context.
* @return A new data context with scope evaluated.
*/
public static DataContext create(
@NonNull ProteusContext context, @Nullable ObjectValue data, int dataIndex) {
DataContext dataContext = new DataContext(null, dataIndex);
dataContext.update(context, data);
return dataContext;
}
/**
* Utility method to create a new {@link DataContext} with a {@link #scope}.
*
* @param context The proteus android context to resolve {@link FunctionBinding} to evaluate the
* scope.
* @param data The data to be used by the data context.
* @param dataIndex The data index to used by the data context.
* @param scope The scope map used to create the {@link #data} of this data context.
* @return A new data context with scope evaluated.
*/
public static DataContext create(
@NonNull ProteusContext context,
@Nullable ObjectValue data,
int dataIndex,
@Nullable Map<String, Value> scope) {
DataContext dataContext = new DataContext(scope, dataIndex);
dataContext.update(context, data);
return dataContext;
}
/**
* Update this data context with new data.
*
* @param context The proteus context used to evaluate {@link FunctionBinding} to evaluate the
* scope.
* @param in The new data.
*/
public void update(@NonNull ProteusContext context, @Nullable ObjectValue in) {
if (in == null) {
in = new ObjectValue();
}
if (scope == null) {
data = in;
return;
}
ObjectValue out = new ObjectValue();
for (Map.Entry<String, Value> entry : scope.entrySet()) {
String key = entry.getKey();
Value value = entry.getValue();
Value resolved;
if (value.isBinding()) {
resolved = value.getAsBinding().evaluate(context, out, index);
if (resolved == Null.INSTANCE) {
resolved = value.getAsBinding().evaluate(context, in, index);
}
} else {
resolved = value;
}
out.add(key, resolved);
}
data = out;
}
/**
* A utility method to create a child data context, with its own scope and index from the data of
* this data context.
*
* @param context The proteus context used to evaluate {@link FunctionBinding} to evaluate the
* scope.
* @param scope The scope for the new data context
* @param dataIndex The data index to used by the new data context.
* @return A new data context with scope evaluated.
*/
public DataContext createChild(
@NonNull ProteusContext context, @NonNull Map<String, Value> scope, int dataIndex) {
return create(context, data, dataIndex, scope);
}
/**
* Returns a clone of this data context with {@link #hasOwnProperties} set to {@code false}.
*
* @return a new cloned data context.
*/
public DataContext copy() {
return new DataContext(this);
}
public ObjectValue getData() {
return data;
}
public void setData(ObjectValue data) {
this.data = data;
}
@Nullable
public Map<String, Value> getScope() {
return scope;
}
public boolean hasOwnProperties() {
return hasOwnProperties;
}
public int getIndex() {
return index;
}
}
| 6,985 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusContext.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusContext.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.content.Context;
import android.content.ContextWrapper;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toolbar;
import android.widget.VideoView;
import android.widget.ViewFlipper;
import android.widget.ViewSwitcher;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.Style;
import com.flipkart.android.proteus.value.Value;
import java.util.HashMap;
import java.util.Map;
/**
* ProteusContext
*
* @author aditya.sharat
*/
public class ProteusContext extends ContextWrapper {
private static final Map<String, String> sInternalViewMap = new HashMap<>();
static {
sInternalViewMap.put("LinearLayout", LinearLayout.class.getName());
sInternalViewMap.put("ViewGroup", ViewGroup.class.getName());
sInternalViewMap.put("FrameLayout", FrameLayout.class.getName());
sInternalViewMap.put("RelativeLayout", RelativeLayout.class.getName());
sInternalViewMap.put("ScrollView", ScrollView.class.getName());
sInternalViewMap.put("ViewFlipper", ViewFlipper.class.getName());
sInternalViewMap.put("ViewSwitcher", ViewSwitcher.class.getName());
sInternalViewMap.put("View", View.class.getName());
sInternalViewMap.put("ImageView", ImageView.class.getName());
sInternalViewMap.put("VideoView", VideoView.class.getName());
sInternalViewMap.put("CheckBox", CheckBox.class.getName());
sInternalViewMap.put("Toolbar", Toolbar.class.getName());
sInternalViewMap.put("TextView", TextView.class.getName());
sInternalViewMap.put("ImageButton", ImageButton.class.getName());
sInternalViewMap.put("Button", Button.class.getName());
sInternalViewMap.put("EditText", EditText.class.getName());
sInternalViewMap.put("ProgressBar", ProgressBar.class.getName());
sInternalViewMap.put("SeekBar", SeekBar.class.getName());
// TODO: add other views
}
private Style style;
@NonNull private final ProteusResources resources;
@Nullable private final ProteusLayoutInflater.Callback callback;
@Nullable private final ProteusLayoutInflater.ImageLoader loader;
private ProteusLayoutInflater inflater;
private final ProteusParserFactory internalParserFactory =
new ProteusParserFactory() {
@Nullable
@Override
public <T extends View> ViewTypeParser<T> getParser(@NonNull String type) {
if (type.contains(".")) {
return null;
}
String s = sInternalViewMap.get(type);
if (s == null) {
return null;
}
return ProteusContext.this.getParser(s);
}
};
private ProteusParserFactory parserFactory;
ProteusContext(
Context base,
@NonNull ProteusResources resources,
@Nullable ProteusLayoutInflater.ImageLoader loader,
@Nullable ProteusLayoutInflater.Callback callback) {
super(base);
this.callback = callback;
this.loader = loader;
this.resources = resources;
}
@Nullable
public ProteusLayoutInflater.Callback getCallback() {
return callback;
}
@NonNull
public FunctionManager getFunctionManager() {
return resources.getFunctionManager();
}
@NonNull
public Function getFunction(@NonNull String name) {
return resources.getFunction(name);
}
@Nullable
public Layout getLayout(@NonNull String name) {
return resources.getLayout(name);
}
@Nullable
public ProteusLayoutInflater.ImageLoader getLoader() {
return loader;
}
public void setParserFactory(@NonNull ProteusParserFactory factory) {
this.parserFactory = factory;
}
@NonNull
public ProteusLayoutInflater getInflater(@NonNull IdGenerator idGenerator) {
if (null == this.inflater) {
this.inflater = new SimpleLayoutInflater(this, idGenerator);
}
return this.inflater;
}
@NonNull
public ProteusLayoutInflater getInflater() {
return getInflater(new SimpleIdGenerator());
}
@Nullable
public <T extends View> ViewTypeParser<T> getParser(String type) {
ViewTypeParser<T> parser = null;
if (parserFactory != null) {
parser = parserFactory.getParser(type);
}
if (parser == null) {
if (!type.contains(".")) {
parser = internalParserFactory.getParser(type);
}
}
if (parser == null) {
if (resources.getParsers().containsKey(type)) {
//noinspection unchecked
parser = resources.getParsers().get(type);
}
}
return parser;
}
@NonNull
public ProteusResources getProteusResources() {
return resources;
}
@Nullable
public Style getStyle(String name) {
return resources.getStyle(name);
}
/**
* @return The default style, typically from the application theme or the current activity
*/
public Style getStyle() {
return style;
}
public Value obtainStyledAttribute(View parent, View view, String name) {
View current = view;
boolean replaceNextParent = false;
if (current == null || view.getParent() == null) {
replaceNextParent = true;
}
while (current instanceof ProteusView) {
ProteusView proteusView = (ProteusView) current;
ProteusView.Manager viewManager = proteusView.getViewManager();
Style style = viewManager.getTheme();
if (style != null) {
Value value = style.getValue(name, this, null);
if (value != null) {
return value;
}
// try searching on the themeOverlay
Value materialThemeOverlay = style.getValue("materialThemeOverlay", this, null);
if (materialThemeOverlay != null) {
Value overlayValue =
AttributeProcessor.staticPreCompile(
materialThemeOverlay.getAsPrimitive(), this, getFunctionManager());
if (overlayValue != null) {
Value overlay = overlayValue.getAsStyle().getValue(name, this, null);
if (overlay != null) {
return overlay;
}
}
}
}
if (replaceNextParent) {
if (!parent.equals(current)) {
current = parent;
} else {
current = null;
}
} else {
current = (View) current.getParent();
}
}
return style.getValue(name, this, null);
}
/** Sets the style to use for all the views that are inflated with this context */
public void setStyle(Style style) {
this.style = style;
}
/**
* Builder
*
* @author adityasharat
*/
public static class Builder {
@NonNull private final Context base;
@NonNull private final FunctionManager functionManager;
@NonNull private final Map<String, ViewTypeParser> parsers;
@Nullable private ProteusLayoutInflater.ImageLoader loader;
@Nullable private ProteusLayoutInflater.Callback callback;
@Nullable private LayoutManager layoutManager;
@Nullable private StyleManager styleManager;
private StringManager stringManager;
private DrawableManager drawableManager;
private ColorManager colorManager;
private DimensionManager dimensionManager;
Builder(
@NonNull Context context,
@NonNull Map<String, ViewTypeParser> parsers,
@NonNull FunctionManager functionManager) {
this.base = context;
this.parsers = parsers;
this.functionManager = functionManager;
}
public Builder setImageLoader(@Nullable ProteusLayoutInflater.ImageLoader loader) {
this.loader = loader;
return this;
}
public Builder setCallback(@Nullable ProteusLayoutInflater.Callback callback) {
this.callback = callback;
return this;
}
public Builder setLayoutManager(@Nullable LayoutManager layoutManager) {
this.layoutManager = layoutManager;
return this;
}
public Builder setStyleManager(@Nullable StyleManager styleManager) {
this.styleManager = styleManager;
return this;
}
public Builder setStringManager(StringManager stringManager) {
this.stringManager = stringManager;
return this;
}
public Builder setDrawableManager(DrawableManager drawableManager) {
this.drawableManager = drawableManager;
return this;
}
public Builder setColorManager(ColorManager colorManager) {
this.colorManager = colorManager;
return this;
}
public Builder setDimensionManager(DimensionManager dimensionManager) {
this.dimensionManager = dimensionManager;
return this;
}
public ProteusContext build() {
ProteusResources resources =
new ProteusResources(
parsers,
layoutManager,
functionManager,
styleManager,
stringManager,
drawableManager,
colorManager,
dimensionManager);
return new ProteusContext(base, resources, loader, callback);
}
}
}
| 10,069 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SimpleLayoutInflater.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/SimpleLayoutInflater.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.exceptions.ProteusInflateException;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Primitive;
import com.flipkart.android.proteus.value.Value;
import java.util.Iterator;
import java.util.Map;
import java.util.Objects;
/**
* A layout builder which can parse json to construct an android view out of it. It uses the
* registered parsers to convert the json string to a view and then assign attributes.
*
* <p>Modified to allow unknown views.
*/
public class SimpleLayoutInflater implements ProteusLayoutInflater {
private static final String TAG = "SimpleLayoutInflater";
@NonNull protected final ProteusContext context;
@NonNull protected final IdGenerator idGenerator;
SimpleLayoutInflater(@NonNull ProteusContext context, @NonNull IdGenerator idGenerator) {
this.context = context;
this.idGenerator = idGenerator;
}
@SuppressWarnings("rawtypes")
@Override
@Nullable
public ViewTypeParser getParser(@NonNull Layout type) {
return context.getParser(type.type);
}
@NonNull
@Override
public ProteusView inflate(
@NonNull Layout layout,
@NonNull ObjectValue data,
@Nullable ViewGroup parent,
int dataIndex) {
/*
* Get the the view type parser for this layout type
*/
final ViewTypeParser parser = getParser(layout);
if (parser == null) {
/*
* If parser is not registered ask the application land for the view
*/
return onUnknownViewEncountered(layout.type, parent, layout, data, dataIndex);
}
/*
* Create a view of {@code layout.type}
*/
final ProteusView view = createView(parser, layout, data, parent, dataIndex);
if (view.getViewManager() == null) {
/*
* Do post creation logic
*/
onAfterCreateView(parser, view, parent, dataIndex);
/*
* Create View Manager for {@code layout.type}
*/
final ProteusView.Manager viewManager =
createViewManager(parser, view, layout, data, parent, dataIndex);
/*
* Set the View Manager on the view.
*/
view.setViewManager(viewManager);
}
/*
* Handle each attribute and set it on the view.
*/
if (layout.attributes != null) {
Iterator<Layout.Attribute> iterator = layout.attributes.iterator();
Layout.Attribute attribute;
String defaultStyleName = parser.getDefaultStyleName();
if (defaultStyleName != null) {
applyStyle(parent, defaultStyleName, view);
}
// handle theme attribute or style first so children can inherit from it
int theme = parser.getAttributeId("style");
int index = layout.attributes.indexOf(new Layout.Attribute(theme, null));
if (index != -1) {
Layout.Attribute themeAttribute = layout.attributes.get(index);
if (themeAttribute != null) {
handleAttribute(parser, view, parent, themeAttribute.id, themeAttribute.value);
}
}
boolean applyStyle = index == -1;
theme = parser.getAttributeId("android:theme");
index = layout.attributes.indexOf(new Layout.Attribute(theme, null));
if (index != -1) {
Layout.Attribute themeAttribute = layout.attributes.get(index);
if (themeAttribute != null) {
handleAttribute(parser, view, parent, themeAttribute.id, themeAttribute.value);
}
}
// then handle the children
ViewTypeParser<View> viewGroupParser = context.getParser(ViewGroup.class.getName());
// never null
assert viewGroupParser != null;
int children = -1;
if (view instanceof ViewGroup) {
children = parser.getAttributeId("children");
index = layout.attributes.indexOf(new Layout.Attribute(children, null));
if (index != -1) {
Layout.Attribute childrenAttribute = layout.attributes.get(index);
if (childrenAttribute != null) {
handleAttribute(parser, view, parent, childrenAttribute.id, childrenAttribute.value);
}
}
}
while (iterator.hasNext()) {
attribute = iterator.next();
if (children != -1 && attribute.id == children) {
continue;
}
if (theme != -1 && attribute.id == theme) {
continue;
}
handleAttribute(parser, view, parent, attribute.id, attribute.value);
}
}
if (layout.extras != null && parent != null) {
for (Map.Entry<String, Value> entry : layout.extras.entrySet()) {
ViewTypeParser<View> parentParser = context.getParser(getType(parent));
if (parentParser != null) {
int id = parentParser.getAttributeId(entry.getKey());
if (id != -1) {
parentParser.handleAttribute(parent, view.getAsView(), id, entry.getValue());
}
}
}
}
return view;
}
private void applyStyle(View parent, String name, ProteusView view) {
Value value =
AttributeProcessor.staticPreCompile(
new Primitive(name), context, context.getFunctionManager());
if (value != null) {
applyStyle(parent, view, value);
}
}
private void applyStyle(View parent, ProteusView view, Value value) {
if (value.isStyle()) {
value.getAsStyle().applyStyle(parent, view, true);
} else if (value.isAttributeResource()) {
Value style =
context.obtainStyledAttribute(
parent, view.getAsView(), value.getAsAttributeResource().getName());
if (style != null && style.isStyle()) {
style.getAsStyle().applyTheme(parent, view);
} else if (style != null && style.isPrimitive()) {
applyStyle(parent, style.toString(), view);
} else {
Log.d(TAG, "Unable to apply style: " + value + " style value: " + style);
}
}
}
@NonNull
@Override
public ProteusView inflate(@NonNull Layout layout, @NonNull ObjectValue data, int dataIndex) {
return inflate(layout, data, null, dataIndex);
}
@NonNull
@Override
public ProteusView inflate(@NonNull Layout layout, @NonNull ObjectValue data) {
return inflate(layout, data, null, -1);
}
@NonNull
@Override
public ProteusView inflate(
@NonNull String name, @NonNull ObjectValue data, @Nullable ViewGroup parent, int dataIndex) {
Layout layout = context.getLayout(name);
if (null == layout) {
throw new ProteusInflateException("layout : '" + name + "' not found");
}
return inflate(layout, data, parent, dataIndex);
}
@NonNull
@Override
public ProteusView inflate(@NonNull String name, @NonNull ObjectValue data, int dataIndex) {
return inflate(name, data, null, dataIndex);
}
@NonNull
@Override
public ProteusView inflate(@NonNull String name, @NonNull ObjectValue data) {
ProteusView inflate = inflate(name, data, null, -1);
return inflate;
}
@Override
public int getUniqueViewId(@NonNull String id) {
return idGenerator.getUnique(id);
}
@NonNull
@Override
public IdGenerator getIdGenerator() {
return idGenerator;
}
protected ProteusView createView(
@NonNull ViewTypeParser parser,
@NonNull Layout layout,
@NonNull ObjectValue data,
@Nullable ViewGroup parent,
int dataIndex) {
return parser.createView(context, layout, data, parent, dataIndex);
}
protected ProteusView.Manager createViewManager(
@NonNull ViewTypeParser parser,
@NonNull ProteusView view,
@NonNull Layout layout,
@NonNull ObjectValue data,
@Nullable ViewGroup parent,
int dataIndex) {
return parser.createViewManager(context, view, layout, data, parser, parent, dataIndex);
}
protected void onAfterCreateView(
@NonNull ViewTypeParser parser,
@NonNull ProteusView view,
@Nullable ViewGroup parent,
int index) {
parser.onAfterCreateView(view, parent, index);
}
@NonNull
protected ProteusView onUnknownViewEncountered(
String type, ViewGroup parent, Layout layout, ObjectValue data, int dataIndex) {
if (ProteusConstants.isLoggingEnabled()) {
Log.d(TAG, "No ViewTypeParser for: " + type);
}
if (context.getCallback() != null) {
ProteusView view =
context.getCallback().onUnknownViewType(context, parent, type, layout, data, dataIndex);
//noinspection ConstantConditions because we need to throw a ProteusInflateException
// specifically
if (view == null) {
throw new ProteusInflateException(
"inflater Callback#onUnknownViewType() must not return null");
}
return view;
}
throw new ProteusInflateException(
"Layout contains type: 'include' but inflater callback is null");
}
@SuppressWarnings({"rawtypes", "unchecked"})
protected boolean handleAttribute(
@NonNull ViewTypeParser parser,
@NonNull ProteusView view,
ViewGroup parent,
int attribute,
@NonNull Value value) {
if (ProteusConstants.isLoggingEnabled()) {
Log.d(TAG, "Handle '" + attribute + "' : " + value);
}
return parser.handleAttribute(parent, view.getAsView(), attribute, value);
}
private String getType(View view) {
String name = view.getClass().getName();
if (name.contains("Proteus")) {
name = Objects.requireNonNull(view.getClass().getSuperclass()).getName();
}
return name;
}
}
| 10,350 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusLayoutInflater.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusLayoutInflater.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.DrawableValue;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Value;
/**
* @author kirankumar
* @author adityasharat
*/
public interface ProteusLayoutInflater {
/**
* This methods inflates a {@link ProteusView}
*
* @param layout The {@link Layout} which defines the layout for the {@link View} to be inflated.
* @param data The {@link ObjectValue} which will be used to replace bindings with values in the
* {@link View}.
* @param parent The intended parent view for the {@link View} that will be inflated.
* @param dataIndex An index of data, if it is associated with some index of an array. Pass 0 by
* default.
* @return An native android view
*/
@NonNull
ProteusView inflate(
@NonNull Layout layout, @NonNull ObjectValue data, @Nullable ViewGroup parent, int dataIndex);
/**
* This methods inflates a {@link ProteusView}
*
* @param layout The {@link Layout} which defines the layout for the {@link View} to be inflated.
* @param data The {@link ObjectValue} which will be used to replace bindings with values in the
* {@link View}.
* @param dataIndex An index of data, if it is associated with some index of an array. Pass 0 by
* default.
* @return An native android view
*/
@NonNull
ProteusView inflate(@NonNull Layout layout, @NonNull ObjectValue data, int dataIndex);
/**
* This methods inflates a {@link ProteusView}
*
* @param layout The {@link Layout} which defines the layout for the {@link View} to be inflated.
* @param data The {@link ObjectValue} which will be used to replace bindings with values in the
* {@link View}.
* @return An native android view
*/
@NonNull
ProteusView inflate(@NonNull Layout layout, @NonNull ObjectValue data);
/**
* This methods inflates a {@link ProteusView}
*
* @param name The name of the layout to be inflated
* @param data The {@link ObjectValue} which will be used to replace bindings with values in the
* {@link View}.
* @param parent The intended parent view for the {@link View} that will be inflated.
* @param dataIndex An index of data, if it is associated with some index of an array. Pass 0 by
* default.
* @return An native android view
*/
@NonNull
ProteusView inflate(
@NonNull String name, @NonNull ObjectValue data, @Nullable ViewGroup parent, int dataIndex);
/**
* This methods inflates a {@link ProteusView}
*
* @param name The name of the layout to be inflated
* @param data The {@link ObjectValue} which will be used to replace bindings with values in the
* {@link View}.
* @param dataIndex An index of data, if it is associated with some index of an array. Pass 0 by
* default.
* @return An native android view
*/
@NonNull
ProteusView inflate(@NonNull String name, @NonNull ObjectValue data, int dataIndex);
/**
* This methods inflates a {@link ProteusView}
*
* @param name The name of the layout to be inflated
* @param data The {@link ObjectValue} which will be used to replace bindings with values in the
* {@link View}.
* @return An native android view
*/
@NonNull
ProteusView inflate(@NonNull String name, @NonNull ObjectValue data);
/**
* Returns the {@link ViewTypeParser} for the specified view type.
*
* @param type The name of the view type.
* @return The {@link ViewTypeParser} associated to the specified view type
*/
@Nullable
ViewTypeParser getParser(@NonNull Layout type);
/**
* Give the View ID for this string. This will generally be given by the instance of ID Generator
* which will be available with the Layout Inflater. This is similar to R.id auto generated
*
* @return int value for this id. This will never be -1.
*/
int getUniqueViewId(@NonNull String id);
/**
* All consumers of this should ensure that they save the instance state of the ID generator along
* with the activity/fragment and resume it when the Layout Inflater is being re-initialized
*
* @return Returns the Id Generator for this Layout Inflater
*/
@NonNull
IdGenerator getIdGenerator();
/** The Layout Inflaters callback interface */
interface Callback {
/**
* This call back is called when the inflater encounters a view type which is no registered with
* it.
*
* @param context The Proteus Context
* @param type The type of the layout
* @param layout The layout
* @param data The data which should be bound to this view
* @param index The data index
* @return The native view to be returned
*/
@NonNull
ProteusView onUnknownViewType(
ProteusContext context,
ViewGroup parent,
String type,
Layout layout,
ObjectValue data,
int index);
/**
* This callback is called when any user interaction occurs on a view
*
* @param event The Event type
* @param value Value set to the event attribute
* @param view The view that triggered the event
*/
void onEvent(String event, Value value, ProteusView view);
}
/** Used for loading drawables/images/bitmaps asynchronously */
interface ImageLoader {
/**
* Useful for asynchronous download of bitmap.
*
* @param url the url for the drawable/bitmap/image
* @param callback the callback to set the drawable/bitmap
*/
void getBitmap(View view, String url, DrawableValue.AsyncCallback callback);
}
}
| 6,430 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusParserFactory.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ProteusParserFactory.java | package com.flipkart.android.proteus;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
/**
* Interface for changing the parser for a specific type of layout before inflating. e.g converting
* a {@code Button} into {@code com.google.android.material.button.MaterialButton} This is used to
* mimic the behavior of {@link android.view.LayoutInflater.Factory2}
*/
public interface ProteusParserFactory {
@Nullable
<T extends View> ViewTypeParser<T> getParser(@NonNull String type);
}
| 541 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ViewTypeParser.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/ViewTypeParser.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.content.res.XmlResourceParser;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.managers.ViewManager;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import com.flipkart.android.proteus.toolbox.ProteusHelper;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Value;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/**
* @author adityasharat
*/
@SuppressWarnings("JavaDoc")
public abstract class ViewTypeParser<V extends View> {
private static XmlResourceParser sParser = null;
@Nullable public ViewTypeParser<V> parent;
@SuppressWarnings({"rawtypes"})
private AttributeProcessor[] processors = new AttributeProcessor[0];
private Map<String, AttributeSet.Attribute> attributes = new HashMap<>();
private int offset = 0;
private AttributeSet attributeSet;
/**
* @return
*/
@NonNull
public abstract String getType();
/**
* @return
*/
@Nullable
public abstract String getParentType();
@Nullable
protected String getDefaultStyleName() {
return null;
}
/**
* @param context
* @param layout
* @param data
* @param parent
* @param dataIndex
* @return
*/
@NonNull
public abstract ProteusView createView(
@NonNull ProteusContext context,
@NonNull Layout layout,
@NonNull ObjectValue data,
@Nullable ViewGroup parent,
int dataIndex);
/**
* @param context
* @param view
* @param layout
* @param data
* @param caller
* @param parent
* @param dataIndex @return
*/
@NonNull
public ProteusView.Manager createViewManager(
@NonNull ProteusContext context,
@NonNull ProteusView view,
@NonNull Layout layout,
@NonNull ObjectValue data,
@Nullable ViewTypeParser<V> caller,
@Nullable ViewGroup parent,
int dataIndex) {
if (null != this.parent && caller != this.parent) {
return this.parent.createViewManager(context, view, layout, data, caller, parent, dataIndex);
} else {
DataContext dataContext = createDataContext(context, layout, data, parent, dataIndex);
return new ViewManager(
context, caller != null ? caller : this, view.getAsView(), layout, dataContext);
}
}
/**
* @param context
* @param layout
* @param data
* @param parent
* @param dataIndex
* @return
*/
@NonNull
protected DataContext createDataContext(
ProteusContext context,
@NonNull Layout layout,
@NonNull ObjectValue data,
@Nullable ViewGroup parent,
int dataIndex) {
DataContext dataContext, parentDataContext = null;
Map<String, Value> map = layout.data;
if (parent instanceof ProteusView) {
parentDataContext = ((ProteusView) parent).getViewManager().getDataContext();
}
if (map == null) {
if (parentDataContext == null) {
dataContext = DataContext.create(context, data, dataIndex);
} else {
dataContext = parentDataContext.copy();
}
} else {
if (parentDataContext == null) {
dataContext = DataContext.create(context, data, dataIndex, map);
} else {
dataContext = parentDataContext.createChild(context, map, dataIndex);
}
}
return dataContext;
}
/**
* @param view
* @param parent
* @param dataIndex
*/
public void onAfterCreateView(
@NonNull ProteusView view, @Nullable ViewGroup parent, int dataIndex) {
View v = view.getAsView();
if (null == v.getLayoutParams()) {
ViewGroup.LayoutParams layoutParams;
if (parent != null) {
layoutParams = generateDefaultLayoutParams(parent);
} else {
layoutParams =
new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
v.setLayoutParams(layoutParams);
}
}
/** */
protected abstract void addAttributeProcessors();
/**
* @param parent
* @param view
* @param attributeId
* @param value
* @return
*/
public boolean handleAttribute(View parent, V view, int attributeId, Value value) {
int position = getPosition(attributeId);
if (position < 0) {
return null != this.parent && this.parent.handleAttribute(parent, view, attributeId, value);
}
try {
//noinspection unchecked
AttributeProcessor<V> processor = processors[position];
processor.process(parent, view, value);
return true;
} catch (Throwable e) {
String name = "Unknown attribute";
String attributeValue = String.valueOf(value);
if (view instanceof ProteusView) {
name = ProteusHelper.getAttributeName(((ProteusView) view), attributeId);
}
Log.e(
"ViewTypeParser", "Unable to handle attribute: " + name + " value: " + attributeValue, e);
return false;
}
}
/**
* @param view
* @param children
* @return
*/
public boolean handleChildren(V view, Value children) {
return null != parent && parent.handleChildren(view, children);
}
/**
* @param parent
* @param view
* @return
*/
public boolean addView(ProteusView parent, ProteusView view) {
return null != this.parent && this.parent.addView(parent, view);
}
/**
* @param parent
* @param extras
* @return
*/
@NonNull
public AttributeSet prepare(
@Nullable ViewTypeParser<V> parent, @Nullable Map<String, AttributeProcessor<V>> extras) {
this.parent = parent;
this.processors = new AttributeProcessor[0];
this.attributes = new HashMap<>();
this.offset = null != parent ? parent.getAttributeSet().getOffset() : 0;
addAttributeProcessors();
if (extras != null) {
addAttributeProcessors(extras);
}
this.attributeSet =
new AttributeSet(
attributes.size() > 0 ? attributes : null,
null != parent ? parent.getAttributeSet() : null,
processors.length);
return attributeSet;
}
/**
* @param name
* @return
*/
public int getAttributeId(String name) {
AttributeSet.Attribute attribute = attributeSet.getAttribute(name);
return null != attribute ? attribute.id : -1;
}
/**
* @return
*/
@NonNull
public AttributeSet getAttributeSet() {
return this.attributeSet;
}
protected void addAttributeProcessors(@NonNull Map<String, AttributeProcessor<V>> processors) {
for (Map.Entry<String, AttributeProcessor<V>> entry : processors.entrySet()) {
addAttributeProcessor(entry.getKey(), entry.getValue());
}
}
public void addLayoutParamsAttributeProcessor(String name, AttributeProcessor<V> processor) {
addAttributeProcessor(processor);
attributes.put(
name, new AttributeSet.Attribute(getAttributeId(processors.length - 1), processor, true));
}
/**
* @param name
* @param processor
*/
public void addAttributeProcessor(String name, AttributeProcessor<V> processor) {
addAttributeProcessor(processor);
attributes.put(
name, new AttributeSet.Attribute(getAttributeId(processors.length - 1), processor));
}
private void addAttributeProcessor(AttributeProcessor<V> handler) {
processors = Arrays.copyOf(processors, processors.length + 1);
processors[processors.length - 1] = handler;
}
private int getOffset() {
return offset;
}
private int getPosition(int attributeId) {
return attributeId + getOffset();
}
private int getAttributeId(int position) {
return position - getOffset();
}
@SuppressWarnings("DanglingJavadoc")
private ViewGroup.LayoutParams generateDefaultLayoutParams(@NonNull ViewGroup parent) {
/**
* This whole method is a hack! To generate layout params, since no other way exists. Refer :
* http://stackoverflow.com/questions/7018267/generating-a-layoutparams-based-on-the-type-of-parent
*/
if (null == sParser) {
synchronized (ViewTypeParser.class) {
if (null == sParser) {
initializeAttributeSet(parent);
}
}
}
return parent.generateLayoutParams(sParser);
}
private void initializeAttributeSet(@NonNull ViewGroup parent) {
sParser = parent.getResources().getLayout(R.layout.layout_params_hack);
try {
//noinspection StatementWithEmptyBody
while (sParser.nextToken() != XmlPullParser.START_TAG) {
// Skip everything until the view tag.
}
} catch (XmlPullParserException | IOException e) {
e.printStackTrace();
}
}
/**
* @author adityasharat
*/
public static class AttributeSet {
@NonNull private final Map<String, Attribute> attributes;
@Nullable private final AttributeSet parent;
private final int offset;
AttributeSet(
@Nullable Map<String, Attribute> attributes, @Nullable AttributeSet parent, int offset) {
this.attributes = null != attributes ? attributes : new HashMap<>();
this.parent = parent;
int parentOffset = null != parent ? parent.getOffset() : 0;
this.offset = parentOffset - offset;
}
@Nullable
public Attribute getAttribute(String name) {
Attribute attribute = attributes.get(name);
if (null != attribute) {
return attribute;
} else if (null != parent) {
return parent.getAttribute(name);
} else {
return null;
}
}
public Map<String, Attribute> getLayoutParamsAttributes() {
Map<String, Attribute> attributeMap = new HashMap<>();
for (Map.Entry<String, Attribute> attr : attributes.entrySet()) {
if (attr.getValue().isLayoutParams) {
attributeMap.put(attr.getKey(), attr.getValue());
}
}
if (parent != null) {
attributeMap.putAll(parent.getLayoutParamsAttributes());
}
return attributeMap;
}
public Map<String, Attribute> getAttributes() {
Map<String, Attribute> attributeMap = new HashMap<>();
for (Map.Entry<String, Attribute> attr : attributes.entrySet()) {
if (!attr.getValue().isLayoutParams) {
attributeMap.put(attr.getKey(), attr.getValue());
}
}
if (parent != null) {
attributeMap.putAll(parent.getAttributes());
}
return attributeMap;
}
int getOffset() {
return offset;
}
public static class Attribute {
public final boolean isLayoutParams;
public final int id;
@NonNull public final AttributeProcessor<?> processor;
Attribute(int id, @NonNull AttributeProcessor<?> processor) {
this(id, processor, false);
}
Attribute(int id, @NonNull AttributeProcessor<?> processor, boolean isLayoutParams) {
this.processor = processor;
this.id = id;
this.isLayoutParams = isLayoutParams;
}
}
}
}
| 11,795 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
SimpleIdGenerator.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/SimpleIdGenerator.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicInteger;
/**
* SimpleIdGenerator
*
* <p>
*
* <p>An built in implementation of {@link IdGenerator} interface
*
* @author aditya.sharat
*/
public class SimpleIdGenerator implements IdGenerator {
public static final Parcelable.Creator<SimpleIdGenerator> CREATOR =
new Creator<SimpleIdGenerator>() {
@Override
public SimpleIdGenerator createFromParcel(Parcel source) {
return new SimpleIdGenerator(source);
}
@Override
public SimpleIdGenerator[] newArray(int size) {
return new SimpleIdGenerator[size];
}
};
private final HashMap<String, Integer> idMap = new HashMap<>();
private final AtomicInteger sNextGeneratedId;
public SimpleIdGenerator() {
sNextGeneratedId = new AtomicInteger(1);
}
public SimpleIdGenerator(Parcel source) {
sNextGeneratedId = new AtomicInteger(source.readInt());
source.readMap(idMap, null);
}
/**
* Flatten this object in to a Parcel.
*
* @param dest The Parcel in which the object should be written.
* @param flags Additional flags about how the object should be written. May be 0 or {@link
* #PARCELABLE_WRITE_RETURN_VALUE}.
*/
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(sNextGeneratedId.get());
dest.writeMap(idMap);
}
/**
* Generates and returns a unique id, for the given key. If key exists, returns old value. Ensure
* that all
*
* @param idKey
* @return a unique ID integer for use with {@link android.view.View#setId(int)}.
*/
@Override
public synchronized int getUnique(String idKey) {
Integer existingId = idMap.get(idKey);
if (existingId == null) {
int newId = generateViewId();
idMap.put(idKey, newId);
existingId = newId;
}
return existingId;
}
/**
* Taken from Android View Source code API 17+
*
* <p>Generate a value suitable for use. This value will not collide with ID values generated at
* inflate time by aapt for R.id.
*
* @return a generated ID value
*/
private int generateViewId() {
for (; ; ) {
final int result = sNextGeneratedId.get();
// aapt-generated IDs have the high byte nonzero; clamp to the range under that.
int newValue = result + 1;
if (newValue > 0x00FFFFFF) {
newValue = 1; // Roll over to 1, not 0.
}
if (sNextGeneratedId.compareAndSet(result, newValue)) {
return result;
}
}
}
/**
* Describe the kinds of special objects contained in this Parcelable's marshalled representation.
*
* @return a bitmask indicating the set of special object types marshalled by the Parcelable.
*/
@Override
public int describeContents() {
return 0;
}
}
| 3,541 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
DimensionManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/DimensionManager.java | package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.Value;
import java.util.Map;
public abstract class DimensionManager {
@NonNull
protected abstract Map<String, Value> getDimensions();
@Nullable
public Value getDimension(@NonNull String name) {
return getDimensions().get(name);
}
}
| 403 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
IdGenerator.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/IdGenerator.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import android.os.Parcelable;
/**
* SimpleIdGenerator
*
* <p>Simulates the R class. Useful to given unique ID for use in {@link
* android.view.View#setId(int)} method. An ID which doesn't conflict with aapt's ID is ensured.
* Please ensure that all dynamic ID call go through this class to ensure uniqueness with other
* dynamic IDs.
*
* @author aditya.sharat
*/
public interface IdGenerator extends Parcelable {
/**
* Generates and returns a unique id, for the given key. If key exists, returns old value. Ensure
* that all
*
* @param id the value for which the ID is returns.
* @return a unique ID integer for use with {@link android.view.View#setId(int)}.
*/
int getUnique(String id);
}
| 1,373 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
BoundAttribute.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/BoundAttribute.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.managers.ViewManager;
import com.flipkart.android.proteus.value.Binding;
import com.flipkart.android.proteus.value.ObjectValue;
/**
* BoundAttribute holds the attribute id to binding pair which is used in the update flow of a
* {@link ProteusView} which is executed when {@link ViewManager#update(ObjectValue)} is invoked.
*
* @author kirankumar
* @author adityasharat
*/
public class BoundAttribute {
/** The {@code int} attribute id of the pair. */
public final int attributeId;
/** The {@link Binding} for the layout attributes value. */
@NonNull public final Binding binding;
public BoundAttribute(int attributeId, @NonNull Binding binding) {
this.attributeId = attributeId;
this.binding = binding;
}
}
| 1,460 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
StringManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/StringManager.java | package com.flipkart.android.proteus;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.value.Value;
import java.util.Locale;
import java.util.Map;
public abstract class StringManager {
/**
* Subclasses must provide the strings found on the given tag
*
* @param tag the suffix of the values folder, eg. values-en, if null the default value folder
* should be used
* @return Map of Strings with their names as key
*/
public abstract Map<String, Value> getStrings(@Nullable String tag);
@Nullable
public Value get(String name, Locale locale) {
String tag = locale.toLanguageTag();
// Try first with the language specific value
if (getStrings(tag) != null && getStrings(tag).get(name) != null) {
return getStrings(tag).get(name);
}
// fallback to the values folder
return getStrings(null) != null ? getStrings(null).get(name) : null;
}
}
| 925 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Styles.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/Styles.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus;
import com.flipkart.android.proteus.value.Value;
import java.util.HashMap;
import java.util.Map;
/**
* Styles
*
* @author Aditya Sharat
*/
public class Styles extends HashMap<String, Map<String, Value>> {
public Map<String, Value> getStyle(String name) {
return this.get(name);
}
public boolean contains(String name) {
return this.containsKey(name);
}
}
| 1,028 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusInflateException.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/exceptions/ProteusInflateException.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.exceptions;
import android.view.InflateException;
/**
* ProteusInflateException
*
* @author adityasharat
*/
public class ProteusInflateException extends InflateException {
public ProteusInflateException(String message) {
super(message);
}
}
| 905 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ViewGroupManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/managers/ViewGroupManager.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.managers;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.DataContext;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.ProteusView;
import com.flipkart.android.proteus.ViewTypeParser;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import java.util.Map;
/**
* ViewGroupManager
*
* @author adityasharat
*/
public class ViewGroupManager extends ViewManager {
public boolean hasDataBoundChildren;
public ViewGroupManager(
@NonNull ProteusContext context,
@NonNull ViewTypeParser parser,
@NonNull View view,
@NonNull Layout layout,
@NonNull DataContext dataContext) {
super(context, parser, view, layout, dataContext);
hasDataBoundChildren = false;
}
@Override
public void update(@Nullable ObjectValue data) {
super.update(data);
updateChildren();
}
@Override
public Map<String, ViewTypeParser.AttributeSet.Attribute> getLayoutParamsAttributes() {
return parser.getAttributeSet().getLayoutParamsAttributes();
}
protected void updateChildren() {
if (!hasDataBoundChildren && view instanceof ViewGroup) {
ViewGroup parent = (ViewGroup) view;
int count = parent.getChildCount();
View child;
for (int index = 0; index < count; index++) {
child = parent.getChildAt(index);
if (child instanceof ProteusView) {
((ProteusView) child).getViewManager().update(dataContext.getData());
}
}
}
}
}
| 2,300 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ViewManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/managers/ViewManager.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.managers;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.BoundAttribute;
import com.flipkart.android.proteus.DataContext;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.ProteusView;
import com.flipkart.android.proteus.ViewTypeParser;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import com.flipkart.android.proteus.toolbox.ProteusHelper;
import com.flipkart.android.proteus.value.Layout;
import com.flipkart.android.proteus.value.ObjectValue;
import com.flipkart.android.proteus.value.Primitive;
import com.flipkart.android.proteus.value.Style;
import com.flipkart.android.proteus.value.Value;
import com.flipkart.android.proteus.view.UnknownView;
import com.flipkart.android.proteus.view.UnknownViewGroup;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* ViewManager
*
* @author aditya.sharat
*/
public class ViewManager implements ProteusView.Manager {
@NonNull protected final ProteusContext context;
@NonNull protected View view;
@NonNull protected final Layout layout;
@NonNull protected final DataContext dataContext;
@NonNull protected final ViewTypeParser parser;
@Nullable protected final List<BoundAttribute> boundAttributes;
@Nullable protected Object extras;
@Nullable protected Style theme;
@Nullable protected Style style;
private View.OnDragListener onDragListener;
private View.OnClickListener onClickListener;
private View.OnLongClickListener onLongClickListener;
public ViewManager(
@NonNull ProteusContext context,
@NonNull ViewTypeParser parser,
@NonNull View view,
@NonNull Layout layout,
@NonNull DataContext dataContext) {
this.context = context;
this.parser = parser;
this.view = view;
this.layout = layout;
this.dataContext = dataContext;
if (null != layout.attributes) {
List<BoundAttribute> boundAttributes = new ArrayList<>();
for (Layout.Attribute attribute : layout.attributes) {
if (attribute.value.isBinding()) {
boundAttributes.add(new BoundAttribute(attribute.id, attribute.value.getAsBinding()));
}
}
if (boundAttributes.size() > 0) {
this.boundAttributes = boundAttributes;
} else {
this.boundAttributes = null;
}
} else {
this.boundAttributes = null;
}
}
@Override
public void update(@Nullable ObjectValue data) {
// update the data context so all child views can refer to new data
if (data != null) {
updateDataContext(data);
}
// update the bound attributes of this view
if (this.boundAttributes != null) {
for (BoundAttribute boundAttribute : this.boundAttributes) {
this.handleBinding(boundAttribute);
}
}
}
@Nullable
@Override
public View findViewById(@NonNull String id) {
return view.findViewById(context.getInflater().getUniqueViewId(id));
}
public View.OnDragListener getOnDragListener() {
return onDragListener;
}
public void setOnDragListener(View.OnDragListener onDragListener) {
view.setOnDragListener(onDragListener);
this.onDragListener = onDragListener;
}
public void setOnClickListener(View.OnClickListener onClickListener) {
view.setOnClickListener(onClickListener);
this.onClickListener = onClickListener;
}
public View.OnClickListener getOnClickListener() {
return onClickListener;
}
public void setOnLongClickListener(View.OnLongClickListener onLongClickListener) {
view.setOnLongClickListener(onLongClickListener);
this.onLongClickListener = onLongClickListener;
}
public View.OnLongClickListener getOnLongClickListener() {
return onLongClickListener;
}
@NonNull
@Override
public ProteusContext getContext() {
return this.context;
}
@NonNull
@Override
public Layout getLayout() {
return this.layout;
}
@NonNull
public DataContext getDataContext() {
return dataContext;
}
@Nullable
@Override
public Object getExtras() {
return this.extras;
}
@Override
public void setExtras(@Nullable Object extras) {
this.extras = extras;
}
private void updateDataContext(ObjectValue data) {
if (dataContext.hasOwnProperties()) {
dataContext.update(context, data);
} else {
dataContext.setData(data);
}
}
@Override
public void setStyle(@Nullable Style style) {
this.style = style;
}
@Override
@Nullable
public Style getStyle() {
return this.style;
}
public void setTheme(Style theme) {
this.theme = theme;
}
public Style getTheme() {
return theme;
}
@Override
public Map<String, ViewTypeParser.AttributeSet.Attribute> getAvailableAttributes() {
Map<String, ViewTypeParser.AttributeSet.Attribute> attributes =
new TreeMap<>(parser.getAttributeSet().getAttributes());
attributes.putAll(parser.getAttributeSet().getLayoutParamsAttributes());
if (view.getParent() instanceof ProteusView) {
ProteusView parent = ((ProteusView) view.getParent());
ProteusView.Manager viewManager = parent.getViewManager();
attributes.putAll(viewManager.getLayoutParamsAttributes());
}
return attributes;
}
@Override
public <T extends View> ViewTypeParser<T> getViewTypeParser() {
return parser;
}
@Override
public void removeAttribute(String attributeName) {
if (layout.attributes != null) {
int attributeId = ProteusHelper.getAttributeId((ProteusView) view, attributeName);
Layout.Attribute attribute = new Layout.Attribute(attributeId, null);
layout.attributes.remove(attribute);
}
if (layout.extras != null) {
layout.extras.remove(attributeName);
}
View.OnDragListener listener = getOnDragListener();
View.OnClickListener onClickListener = getOnClickListener();
View.OnLongClickListener onLongClickListener = getOnLongClickListener();
// when an attribute is removed, there is no way to undo the
// attributes that have already been set so we just recreate
// the view and add it again to the layout
if (!(view instanceof UnknownView) && !(view instanceof UnknownViewGroup)) {
ViewParent viewParent = view.getParent();
if (viewParent instanceof ViewGroup) {
ViewGroup parent = (ViewGroup) viewParent;
int index = parent.indexOfChild(view);
parent.removeView(view);
ProteusView view = context.getInflater().inflate(layout, new ObjectValue(), parent, -1);
this.view = view.getAsView();
view.setViewManager(this);
setOnClickListeners(view, onClickListener, onLongClickListener, listener);
parent.addView(view.getAsView(), index);
}
}
}
private void setOnClickListeners(
ProteusView view,
View.OnClickListener onClickListener,
View.OnLongClickListener onLongClickListener,
View.OnDragListener onDragListener) {
view.getViewManager().setOnClickListener(onClickListener);
view.getViewManager().setOnLongClickListener(onLongClickListener);
if (view.getAsView() instanceof ViewGroup) {
view.getViewManager().setOnDragListener(onDragListener);
ViewGroup viewGroup = (ViewGroup) view.getAsView();
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View childAt = viewGroup.getChildAt(i);
if (childAt instanceof ProteusView) {
setOnClickListeners(
(ProteusView) childAt, onClickListener, onLongClickListener, onDragListener);
}
}
}
}
@Override
public void updateAttribute(String name, Value value) {
removeAttribute(name);
if (value.isPrimitive()) {
Value result =
AttributeProcessor.staticPreCompile(
value.getAsPrimitive(), context, context.getFunctionManager());
if (result != null) {
value = result;
}
}
int attributeId = ProteusHelper.getAttributeId((ProteusView) view, name);
boolean isExtra = !ProteusHelper.isAttributeFromView((ProteusView) view, name, attributeId);
ViewTypeParser<View> parser =
ProteusHelper.getViewTypeParser((ProteusView) view, name, isExtra);
if (this.parser.equals(parser)) {
if (layout.attributes == null) {
layout.attributes = new ArrayList<>();
}
layout.attributes.remove(new Layout.Attribute(attributeId, null));
layout.attributes.add(new Layout.Attribute(attributeId, value));
parser.handleAttribute((View) view.getParent(), view, attributeId, value);
} else {
if (layout.extras == null) {
layout.extras = new ObjectValue();
}
if (value != null) {
layout.extras.addProperty(name, value.getAsString());
if (parser != null) {
parser.handleAttribute((View) view.getParent(), view, attributeId, value);
}
}
}
}
public void updateAttribute(String name, String string) {
Primitive primitive = new Primitive(string);
Value value =
AttributeProcessor.staticPreCompile(primitive, context, context.getFunctionManager());
if (value == null) {
value = new Primitive(string);
}
updateAttribute(name, value);
}
public String getAttributeName(int id) {
for (Map.Entry<String, ViewTypeParser.AttributeSet.Attribute> entry :
parser.getAttributeSet().getAttributes().entrySet()) {
String k = entry.getKey();
ViewTypeParser.AttributeSet.Attribute v = entry.getValue();
if (v.id == id) {
return k;
}
}
if (view.getParent() instanceof ProteusView) {
ProteusView parent = (ProteusView) view.getParent();
//noinspection rawtypes
ViewTypeParser parser = parent.getViewManager().getViewTypeParser();
for (Map.Entry<String, ViewTypeParser.AttributeSet.Attribute> entry :
parser.getAttributeSet().getAttributes().entrySet()) {
String k = entry.getKey();
ViewTypeParser.AttributeSet.Attribute v = entry.getValue();
if (v.id == id) {
return k;
}
}
}
return "Unknown";
}
private void handleBinding(BoundAttribute boundAttribute) {
//noinspection unchecked
parser.handleAttribute(
(View) view.getParent(), view, boundAttribute.attributeId, boundAttribute.binding);
}
}
| 11,132 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
AdapterBasedViewManager.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/managers/AdapterBasedViewManager.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.managers;
import android.view.View;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.DataContext;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.ViewTypeParser;
import com.flipkart.android.proteus.value.Layout;
/**
* AdapterBasedViewManager.
*
* @author adityasharat
*/
public class AdapterBasedViewManager extends ViewGroupManager {
public AdapterBasedViewManager(
@NonNull ProteusContext context,
@NonNull ViewTypeParser parser,
@NonNull View view,
@NonNull Layout layout,
@NonNull DataContext dataContext) {
super(context, parser, view, layout, dataContext);
}
/**
* Ignore updating the children in this case, that should be handled by the adapter attached to
* the view.
*/
@Override
protected void updateChildren() {}
}
| 1,499 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Color.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Color.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.Context;
import android.content.res.ColorStateList;
import android.text.TextUtils;
import android.util.Log;
import android.util.LruCache;
import android.util.StateSet;
import android.view.View;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.processor.ColorResourceProcessor;
import com.flipkart.android.proteus.toolbox.ProteusHelper;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* ColorValue
*
* @author aditya.sharat
*/
public abstract class Color extends Value {
private static final String COLOR_PREFIX_LITERAL = "#";
private static HashMap<String, Integer> sAttributesMap = null;
@NonNull
public static Color valueOf(@Nullable String value) {
return valueOf(value, Int.BLACK);
}
@NonNull
public static Color valueOf(@Nullable String value, @NonNull Color defaultValue) {
if (null == value || value.length() == 0) {
return defaultValue;
}
Color color = ColorCache.cache.get(value);
if (null == color) {
if (isColor(value)) {
try {
@ColorInt int colorInt = android.graphics.Color.parseColor(value);
color = new Int(colorInt);
} catch (IllegalArgumentException e) {
Log.e("Color", "Unknown value: " + value);
color = new Int(android.graphics.Color.TRANSPARENT);
}
} else {
color = defaultValue;
}
ColorCache.cache.put(value, color);
}
return color;
}
public static Color valueOf(ObjectValue value, Context context) {
if (value.isPrimitive("type")) {
String colorType = value.getAsString("type");
if (TextUtils.equals(colorType, "selector")) {
if (value.isArray("children")) {
Array children = value.get("children").getAsArray();
Iterator<Value> iterator = children.iterator();
ObjectValue child;
int listAllocated = 20;
int listSize = 0;
int[] colorList = new int[listAllocated];
int[][] stateSpecList = new int[listAllocated][];
while (iterator.hasNext()) {
child = iterator.next().getAsObject();
if (child.size() == 0) {
continue;
}
int j = 0;
Integer baseColor = null;
float alphaMod = 1.0f;
int[] stateSpec = new int[child.size() - 1];
boolean ignoreItem = false;
for (Map.Entry<String, Value> entry : child.entrySet()) {
if (ignoreItem) {
break;
}
if (!entry.getValue().isPrimitive()) {
continue;
}
Integer attributeId = getAttribute(entry.getKey());
if (null != attributeId) {
switch (attributeId) {
case android.R.attr.type:
if (!TextUtils.equals("item", entry.getValue().getAsString())) {
ignoreItem = true;
}
break;
case android.R.attr.color:
String colorRes = entry.getValue().getAsString();
if (!TextUtils.isEmpty(colorRes)) {
baseColor = apply(colorRes);
}
break;
case android.R.attr.alpha:
String alphaStr = entry.getValue().getAsString();
if (!TextUtils.isEmpty(alphaStr)) {
alphaMod = Float.parseFloat(alphaStr);
}
break;
default:
stateSpec[j++] = entry.getValue().getAsBoolean() ? attributeId : -attributeId;
break;
}
}
}
if (!ignoreItem) {
stateSpec = StateSet.trimStateSet(stateSpec, j);
if (null == baseColor) {
throw new IllegalStateException("No ColorValue Specified");
}
if (listSize + 1 >= listAllocated) {
listAllocated = idealIntArraySize(listSize + 1);
int[] ncolor = new int[listAllocated];
System.arraycopy(colorList, 0, ncolor, 0, listSize);
int[][] nstate = new int[listAllocated][];
System.arraycopy(stateSpecList, 0, nstate, 0, listSize);
colorList = ncolor;
stateSpecList = nstate;
}
final int color = modulateColorAlpha(baseColor, alphaMod);
colorList[listSize] = color;
stateSpecList[listSize] = stateSpec;
listSize++;
}
}
if (listSize > 0) {
int[] colors = new int[listSize];
int[][] stateSpecs = new int[listSize][];
System.arraycopy(colorList, 0, colors, 0, listSize);
System.arraycopy(stateSpecList, 0, stateSpecs, 0, listSize);
return new StateList(stateSpecs, colors);
}
}
}
}
return Int.getDefaultColor();
}
private static int apply(String value) {
Color color = valueOf(value);
int colorInt;
if (color instanceof Int) {
colorInt = ((Int) color).value;
} else {
colorInt = Int.getDefaultColor().value;
}
return colorInt;
}
public static boolean isColor(String color) {
return color.startsWith(COLOR_PREFIX_LITERAL);
}
private static HashMap<String, Integer> getAttributesMap() {
if (null == sAttributesMap) {
synchronized (Color.class) {
if (null == sAttributesMap) {
sAttributesMap = new HashMap<>(15);
sAttributesMap.put("type", android.R.attr.type);
sAttributesMap.put("color", android.R.attr.color);
sAttributesMap.put("alpha", android.R.attr.alpha);
sAttributesMap.put("state_pressed", android.R.attr.state_pressed);
sAttributesMap.put("state_focused", android.R.attr.state_focused);
sAttributesMap.put("state_selected", android.R.attr.state_selected);
sAttributesMap.put("state_checkable", android.R.attr.state_checkable);
sAttributesMap.put("state_checked", android.R.attr.state_checked);
sAttributesMap.put("state_enabled", android.R.attr.state_enabled);
sAttributesMap.put("state_window_focused", android.R.attr.state_window_focused);
}
}
}
return sAttributesMap;
}
private static Integer getAttribute(String attribute) {
return getAttributesMap().get(attribute);
}
private static int idealByteArraySize(int need) {
for (int i = 4; i < 32; i++) {
if (need <= (1 << i) - 12) {
return (1 << i) - 12;
}
}
return need;
}
private static int idealIntArraySize(int need) {
return idealByteArraySize(need * 4) / 4;
}
private static int constrain(int amount, int low, int high) {
return amount < low ? low : (amount > high ? high : amount);
}
private static int modulateColorAlpha(int baseColor, float alphaMod) {
if (alphaMod == 1.0f) {
return baseColor;
}
final int baseAlpha = android.graphics.Color.alpha(baseColor);
final int alpha = constrain((int) (baseAlpha * alphaMod + 0.5f), 0, 255);
return (baseColor & 0xFFFFFF) | (alpha << 24);
}
public Result apply(View parent, View view) {
return apply(view.getContext());
}
public abstract Result apply(Context context);
private static class ColorCache {
static final LruCache<String, Color> cache = new LruCache<>(64);
}
public static class Int extends Color {
public static final Int BLACK = new Int(0);
public static Int getDefaultColor() {
return BLACK;
}
@ColorInt public final int value;
Int(@ColorInt int value) {
this.value = value;
}
public static Int valueOf(int number) {
if (number == 0) {
return BLACK;
}
String value = String.valueOf(number);
Color color = ColorCache.cache.get(value);
if (null == color) {
color = new Int(number);
ColorCache.cache.put(value, color);
}
return (Int) color;
}
@Override
public int getAsInt() {
return value;
}
@Override
public Value copy() {
return this;
}
@Override
public Result apply(Context context) {
return Result.color(value);
}
@NonNull
@Override
public String toString() {
return "#" + Integer.toHexString(value);
}
}
public static class LazyStateList extends Color {
private final int[][] states;
private final float[] alphas;
private final Value[] colors;
public LazyStateList(int[][] states, Value[] colors, float[] alphas) {
this.states = states;
this.colors = colors;
this.alphas = alphas;
}
public static LazyStateList valueOf(int[][] states, Value[] colors, float[] alphas) {
return new LazyStateList(states, colors, alphas);
}
private int getColor(View parent, View view, ProteusContext context, Value value) {
if (value.isPrimitive()) {
return getColor(parent, view, context, value.getAsPrimitive());
} else if (value.isResource()) {
return getColor(parent, view, context, value.getAsResource());
} else if (value.isAttributeResource()) {
return getColor(parent, view, context, value.getAsAttributeResource());
} else if (value.isColor()) {
return value.getAsColor().getAsInt();
}
return 0;
}
private int getColor(View parent, View view, ProteusContext context, Resource resource) {
Color color = resource.getColor(context);
if (color != null) {
return getColor(parent, view, context, color);
}
return 0;
}
private int getColor(
View parent, View view, ProteusContext context, AttributeResource attributeResource) {
String name = attributeResource.getName();
Value value = context.obtainStyledAttribute(parent, view, name);
if (value != null) {
return getColor(parent, view, context, value);
}
return 0;
}
private int getColor(View parent, View view, ProteusContext context, Primitive primitive) {
Value value = ColorResourceProcessor.staticCompile(primitive, context);
if (value == null) {
return 0;
}
return getColor(parent, view, context, value);
}
public Result apply(View parent, View view) {
ProteusContext proteusContext = ProteusHelper.getProteusContext(view);
int[] colorInts = new int[colors.length];
for (int i = 0; i < colors.length; i++) {
Value color = colors[i];
if (color.isColor()) {
colorInts[i] = color.getAsInt();
} else {
colorInts[i] = getColor(parent, view, proteusContext, color);
colorInts[i] = Color.modulateColorAlpha(colorInts[i], alphas[i]);
}
}
return new Result(0, new ColorStateList(states, colorInts));
}
@Override
public Result apply(Context context) {
throw new UnsupportedOperationException("Use #apply(View) instead");
}
@Override
public Value copy() {
return new LazyStateList(this.states, this.colors, this.alphas);
}
}
public static class StateList extends Color {
public final int[][] states;
public final int[] colors;
StateList(int[][] states, int[] colors) {
this.states = states;
this.colors = colors;
}
public static StateList valueOf(int[][] states, int[] colors) {
return new StateList(states, colors);
}
@Override
public Value copy() {
return this;
}
@Override
public Result apply(Context context) {
ColorStateList colors = new ColorStateList(states, this.colors);
return Result.colors(colors);
}
}
public static class Result {
public final int color;
@Nullable public final ColorStateList colors;
private Result(int color, @Nullable ColorStateList colors) {
this.color = color;
this.colors = colors;
}
public static Result color(int color) {
return create(color, null);
}
public static Result colors(@NonNull ColorStateList colors) {
return create(colors.getDefaultColor(), colors);
}
public static Result create(int color, @Nullable ColorStateList colors) {
return new Result(color, colors);
}
}
}
| 13,240 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
NestedBinding.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/NestedBinding.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.Context;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.ProteusContext;
import java.util.Iterator;
import java.util.Map;
/**
* NestedBinding
*
* @author adityasharat
*/
public class NestedBinding extends Binding {
public static final String NESTED_BINDING_KEY = "@";
private final Value value;
private NestedBinding(Value value) {
this.value = value;
}
/**
* @param value
* @return
*/
@NonNull
public static NestedBinding valueOf(@NonNull final Value value) {
return new NestedBinding(value);
}
@NonNull
public Value getValue() {
return value;
}
@NonNull
@Override
public Value evaluate(ProteusContext context, Value data, int index) {
return evaluate(context, value, data, index);
}
@NonNull
@Override
public String toString() {
return getClass().getName() + "@" + Integer.toHexString(hashCode());
}
private Value evaluate(ProteusContext context, Binding binding, Value data, int index) {
return binding.getAsBinding().evaluate(context, data, index);
}
private Value evaluate(Context context, ObjectValue object, Value data, int index) {
ObjectValue evaluated = new ObjectValue();
String key;
Value value;
for (Map.Entry<String, Value> entry : object.entrySet()) {
key = entry.getKey();
value = evaluate(context, entry.getValue(), data, index);
evaluated.add(key, value);
}
return evaluated;
}
private Value evaluate(Context context, Array array, Value data, int index) {
Array evaluated = new Array(array.size());
Iterator<Value> iterator = array.iterator();
while (iterator.hasNext()) {
evaluated.add(evaluate(context, iterator.next(), data, index));
}
return evaluated;
}
private Value evaluate(Context context, Value value, Value data, int index) {
Value evaluated = value;
if (value.isBinding()) {
evaluated = evaluate(context, value.getAsBinding(), data, index);
} else if (value.isObject()) {
evaluated = evaluate(context, value.getAsObject(), data, index);
} else if (value.isArray()) {
evaluated = evaluate(context, value.getAsArray(), data, index);
}
return evaluated;
}
@Override
public Binding copy() {
return this;
}
}
| 2,963 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Resource.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Resource.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.util.LruCache;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringDef;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import com.flipkart.android.proteus.toolbox.ProteusHelper;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* ColorResource
*
* @author aditya.sharat
*/
public class Resource extends Value {
public static final String RESOURCE_PREFIX_ANIMATION = "@anim/";
public static final String RESOURCE_PREFIX_BOOLEAN = "@bool/";
public static final String RESOURCE_PREFIX_COLOR = "@color/";
public static final String RESOURCE_PREFIX_DIMENSION = "@dimen/";
public static final String RESOURCE_PREFIX_DRAWABLE = "@drawable/";
public static final String RESOURCE_PREFIX_STRING = "@string/";
public static final String ANDROID_RESOURCE_PREFIX_ANIMATION = "@android:anim/";
public static final String ANDROID_RESOURCE_PREFIX_BOOLEAN = "@android:bool/";
public static final String ANDROID_RESOURCE_PREFIX_COLOR = "@android:color/";
public static final String ANDROID_RESOURCE_PREFIX_DIMENSION = "@android:dimen/";
public static final String ANDROID_RESOURCE_PREFIX_DRAWABLE = "@android:drawable/";
public static final String ANDROID_RESOURCE_PREFIX_STRING = "@android:string/";
public static final String ANIM = "anim";
public static final String BOOLEAN = "bool";
public static final String COLOR = "color";
public static final String DIMEN = "dimen";
public static final String DRAWABLE = "drawable";
public static final String STRING = "string";
public static final Resource NOT_FOUND = new Resource(0);
public final int resId;
private final String name;
public Resource(String name) {
this.resId = -1;
this.name = name;
}
/**
* @param resId only provide this for android resources
* @param name the name of the resource, including the prefix
*/
public Resource(int resId, String name) {
this.resId = resId;
this.name = name;
}
private Resource(int id) {
this(null);
}
public static boolean isAnimation(String string) {
return string.startsWith(RESOURCE_PREFIX_ANIMATION)
|| string.startsWith(ANDROID_RESOURCE_PREFIX_ANIMATION);
}
public static boolean isBoolean(String string) {
return string.startsWith(RESOURCE_PREFIX_BOOLEAN)
|| string.startsWith(ANDROID_RESOURCE_PREFIX_BOOLEAN);
}
public static boolean isColor(String string) {
return string.startsWith(RESOURCE_PREFIX_COLOR)
|| string.startsWith(ANDROID_RESOURCE_PREFIX_COLOR);
}
public static boolean isDimension(String string) {
return string.startsWith(RESOURCE_PREFIX_DIMENSION)
|| string.startsWith(ANDROID_RESOURCE_PREFIX_DIMENSION);
}
public static boolean isDrawable(String string) {
return string.startsWith(RESOURCE_PREFIX_DRAWABLE)
|| string.startsWith(ANDROID_RESOURCE_PREFIX_DRAWABLE);
}
public static boolean isString(String string) {
return string.startsWith(RESOURCE_PREFIX_STRING)
|| string.startsWith(ANDROID_RESOURCE_PREFIX_STRING);
}
public static boolean isResource(String string) {
return isAnimation(string)
|| isBoolean(string)
|| isColor(string)
|| isDimension(string)
|| isDrawable(string)
|| isString(string);
}
@Nullable
public static Boolean getBoolean(int resId, Context context) {
try {
return context.getResources().getBoolean(resId);
} catch (Resources.NotFoundException e) {
return null;
}
}
@Nullable
public static Color getColor(String name, ProteusContext context) {
Value value = context.getProteusResources().getColor(name);
if (value != null && value.isResource()) {
value = value.getAsResource().getColor(context);
}
if (value != null && value.isColor()) {
return value.getAsColor();
}
return Color.valueOf(name);
}
@Nullable
public static ColorStateList getColorStateList(
String name, View parent, View view, ProteusContext context) {
Value color = context.getProteusResources().getColor(name);
if (color != null) {
if (color instanceof Color.StateList || color instanceof Color.LazyStateList) {
return color.getAsColor().apply(parent, view).colors;
}
}
return null;
}
@Nullable
public static Drawable getDrawable(int resId, Context context) {
try {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
return context.getResources().getDrawable(resId, context.getTheme());
} else {
//noinspection deprecation
return context.getResources().getDrawable(resId);
}
} catch (Resources.NotFoundException e) {
return null;
}
}
@Nullable
public static Dimension getDimension(String name, ProteusContext context) {
Value dimension = context.getProteusResources().getDimension(name);
if (dimension == null) {
return null;
}
if (dimension.toString().endsWith("dp")) {
return Dimension.valueOf(dimension.toString());
}
Value value =
AttributeProcessor.staticPreCompile(dimension, context, context.getFunctionManager());
while (value != null && !value.isDimension()) {
if (value.isResource()) {
return value.getAsResource().getDimension(context);
}
if (value.isAttributeResource()) {
value = context.obtainStyledAttribute(null, null, value.getAsAttributeResource().getName());
} else {
break;
}
}
return null;
}
@Nullable
public static String getString(int resId, Context context) {
try {
return context.getString(resId);
} catch (Resources.NotFoundException e) {
return null;
}
}
@Nullable
public static Resource valueOf(
String value, @Nullable @ResourceType String type, Context context) {
if (null == value) {
return null;
}
value = removeAfterSlash(value);
Resource resource = ResourceCache.cache.get(value);
if (null == resource) {
int resId = context.getResources().getIdentifier(value, type, "android");
resource = resId == 0 ? NOT_FOUND : new Resource(resId, value);
ResourceCache.cache.put(value, resource);
}
return NOT_FOUND == resource ? null : resource;
}
public static String removeAfterSlash(@NonNull String value) {
if (!value.contains("/")) {
return value;
}
int index = value.indexOf('/');
if (index + 1 > value.length()) {
return value;
}
return value.substring(index + 1);
}
public static Resource valueOf(String value, ProteusContext context) {
if (isAndroid(value)) {
return valueOf(value, getResourceType(value), context);
} else {
return xmlValueOf(value, getResourceType(value), context);
}
}
@ResourceType
public static String getResourceType(String value) {
if (isDrawable(value)) {
return DRAWABLE;
}
if (isString(value)) {
return STRING;
}
if (isColor(value)) {
return COLOR;
}
if (isBoolean(value)) {
return BOOLEAN;
}
return null;
}
public static Resource xmlValueOf(String value, String type, ProteusContext context) {
Resource resource = ResourceCache.cache.get(value);
if (resource != null) {
return resource;
}
resource = new Resource(value);
ResourceCache.cache.put(value, resource);
return resource;
}
public static boolean isAndroid(@NonNull String value) {
return value.startsWith("@android");
}
@NonNull
public static Resource valueOf(int resId) {
return new Resource(resId);
}
@Nullable
public Boolean getBoolean(Context context) {
return getBoolean(resId, context);
}
@Nullable
public Color getColor(ProteusContext context) {
return getColor(name, context);
}
@Nullable
public ColorStateList getColorStateList(View view) {
return getColorStateList(name, null, view, ProteusHelper.getProteusContext(view));
}
@Nullable
public ColorStateList getColorStateList(View parent, View view) {
return getColorStateList(name, parent, view, ProteusHelper.getProteusContext(view));
}
public DrawableValue getProteusDrawable(ProteusContext context) {
if (name != null) {
String drawableName = removeAfterSlash(name);
return context.getProteusResources().getDrawable(drawableName);
}
return null;
}
@Nullable
public Drawable getDrawable(ProteusContext context) {
return getDrawable(resId, context);
}
@Nullable
public Dimension getDimension(ProteusContext context) {
return getDimension(name, context);
}
@Nullable
public Integer getInteger(Context context) {
return getInteger(resId, context);
}
@Nullable
public String getString(ProteusContext context) {
String value = null;
if (name != null) {
if (isAndroid(name)) {
value = getString(resId, context);
}
if (value != null) {
return value;
}
Value string =
context.getProteusResources().getString(name.replace(RESOURCE_PREFIX_STRING, ""));
value = null != string ? string.getAsString() : null;
}
return value == null ? getString(resId, context) : value;
}
@Nullable
public Integer getInteger(int resId, Context context) {
return context.getResources().getInteger(resId);
}
@Override
public Value copy() {
return this;
}
@StringDef({ANIM, BOOLEAN, COLOR, DRAWABLE, DIMEN, STRING})
@Retention(RetentionPolicy.SOURCE)
public @interface ResourceType {}
private static class ResourceCache {
static final LruCache<String, Resource> cache = new LruCache<>(64);
}
@Override
public String toString() {
if (resId != -1) {
try {
return "@" + Resources.getSystem().getResourceName(resId);
} catch (Resources.NotFoundException ignored) {
}
}
return name;
}
}
| 10,892 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Dimension.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Dimension.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.Context;
import android.util.LruCache;
import android.util.TypedValue;
import android.view.ViewGroup;
import com.flipkart.android.proteus.parser.ParseHelper;
import com.flipkart.android.proteus.toolbox.BiMap;
import com.flipkart.android.proteus.toolbox.HashBiMap;
/**
* Dimension is a type of {@link Value} which hosts dimensions. Any android dimension string can be
* parsed into a {@code Dimension} object. Eg. "12dp", "16sp", etc. A {@code Dimension} object is
* immutable.
*
* @author aditya.sharat
*/
public class Dimension extends Value {
public static final int DIMENSION_UNIT_ENUM = -1;
public static final int DIMENSION_UNIT_PX = TypedValue.COMPLEX_UNIT_PX;
public static final int DIMENSION_UNIT_DP = TypedValue.COMPLEX_UNIT_DIP;
public static final int DIMENSION_UNIT_SP = TypedValue.COMPLEX_UNIT_SP;
public static final int DIMENSION_UNIT_PT = TypedValue.COMPLEX_UNIT_PT;
public static final int DIMENSION_UNIT_IN = TypedValue.COMPLEX_UNIT_IN;
public static final int DIMENSION_UNIT_MM = TypedValue.COMPLEX_UNIT_MM;
public static final String MATCH_PARENT = "match_parent";
public static final String FILL_PARENT = "fill_parent";
public static final String WRAP_CONTENT = "wrap_content";
public static final String SUFFIX_PX = "px";
public static final String SUFFIX_DP = "dp";
public static final String SUFFIX_SP = "sp";
public static final String SUFFIX_PT = "pt";
public static final String SUFFIX_IN = "in";
public static final String SUFFIX_MM = "mm";
public static final BiMap<String, Integer> sDimensionsMap = new HashBiMap<>(3);
public static final BiMap<String, Integer> sDimensionsUnitsMap = new HashBiMap<>(6);
public static final Dimension ZERO = new Dimension(0, DIMENSION_UNIT_PX);
static {
sDimensionsMap.put(FILL_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
sDimensionsMap.put(MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
sDimensionsMap.put(WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
sDimensionsUnitsMap.put(SUFFIX_PX, DIMENSION_UNIT_PX);
sDimensionsUnitsMap.put(SUFFIX_DP, DIMENSION_UNIT_DP);
sDimensionsUnitsMap.put(SUFFIX_SP, DIMENSION_UNIT_SP);
sDimensionsUnitsMap.put(SUFFIX_PT, DIMENSION_UNIT_PT);
sDimensionsUnitsMap.put(SUFFIX_IN, DIMENSION_UNIT_IN);
sDimensionsUnitsMap.put(SUFFIX_MM, DIMENSION_UNIT_MM);
}
public final double value;
public final int unit;
private Dimension(float value, int unit) {
this.value = value;
this.unit = unit;
}
private Dimension(String dimension) {
Integer parameter = sDimensionsMap.getValue(dimension);
double value;
int unit;
if (parameter != null) {
value = parameter;
unit = DIMENSION_UNIT_ENUM;
} else {
int length = dimension.length();
if (length < 2) {
value = 0;
unit = DIMENSION_UNIT_PX;
} else { // find the units and value by splitting at the second-last character of the
// dimension
Integer u = sDimensionsUnitsMap.getValue(dimension.substring(length - 2));
String stringValue = dimension.substring(0, length - 2);
if (u != null) {
value = ParseHelper.parseFloat(stringValue);
unit = u;
} else {
value = 0;
unit = DIMENSION_UNIT_PX;
}
}
}
this.value = value;
this.unit = unit;
}
/**
* This function returns a {@code Dimension} object holding the value extracted from the specified
* {@code String}
*
* @param dimension the value to be parsed.
*/
public static Dimension valueOf(String dimension) {
if (null == dimension) {
return ZERO;
}
Dimension d = DimensionCache.cache.get(dimension);
if (null == d) {
d = new Dimension(dimension);
DimensionCache.cache.put(dimension, d);
}
return d;
}
public static float apply(String dimension, Context context) {
return Dimension.valueOf(dimension).apply(context);
}
public float apply(Context context) {
double result = 0;
switch (unit) {
case DIMENSION_UNIT_ENUM:
result = value;
break;
case DIMENSION_UNIT_PX:
case DIMENSION_UNIT_DP:
case DIMENSION_UNIT_SP:
case DIMENSION_UNIT_PT:
case DIMENSION_UNIT_MM:
case DIMENSION_UNIT_IN:
result =
TypedValue.applyDimension(
unit, (float) value, context.getResources().getDisplayMetrics());
break;
}
return (float) result;
}
@Override
public Value copy() {
return this;
}
@Override
public String toString() {
final String value;
if (this.value % 1 == 0) {
value = String.valueOf((int) this.value);
} else {
value = String.valueOf(this.value);
}
final String unit;
if (this.unit == DIMENSION_UNIT_ENUM) {
return sDimensionsMap.getKey((int) this.value);
} else {
unit = sDimensionsUnitsMap.getKey(this.unit);
return value + unit;
}
}
private static class DimensionCache {
static final LruCache<String, Dimension> cache = new LruCache<>(64);
}
}
| 5,780 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ObjectValue.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/ObjectValue.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
/**
* ObjectValue
*
* @author aditya.sharat
*/
public class ObjectValue extends Value {
private final HashMap<String, Value> members = new HashMap<>();
@Override
public ObjectValue copy() {
ObjectValue result = new ObjectValue();
for (Map.Entry<String, Value> entry : members.entrySet()) {
result.add(entry.getKey(), entry.getValue().copy());
}
return result;
}
/**
* Adds a member, which is a name-value pair, to self. The name must be a String, but the value
* can be an arbitrary Value, thereby allowing you to inflate a full tree of Value rooted at this
* node.
*
* @param property name of the member.
* @param value the member object.
*/
public void add(String property, Value value) {
if (value == null) {
value = Null.INSTANCE;
}
members.put(property, value);
}
/**
* Removes the {@code property} from this {@link ObjectValue}.
*
* @param property name of the member that should be removed.
* @return the {@link Value} object that is being removed.
* @since 1.3
*/
public Value remove(String property) {
return members.remove(property);
}
/**
* Convenience method to add a primitive member. The specified value is converted to a Primitive
* of String.
*
* @param property name of the member.
* @param value the string value associated with the member.
*/
public void addProperty(String property, String value) {
add(property, createValue(value));
}
/**
* Convenience method to add a primitive member. The specified value is converted to a Primitive
* of Number.
*
* @param property name of the member.
* @param value the number value associated with the member.
*/
public void addProperty(String property, Number value) {
add(property, createValue(value));
}
/**
* Convenience method to add a boolean member. The specified value is converted to a Primitive of
* Boolean.
*
* @param property name of the member.
* @param value the number value associated with the member.
*/
public void addProperty(String property, Boolean value) {
add(property, createValue(value));
}
/**
* Convenience method to add a char member. The specified value is converted to a Primitive of
* Character.
*
* @param property name of the member.
* @param value the number value associated with the member.
*/
public void addProperty(String property, Character value) {
add(property, createValue(value));
}
/**
* Creates the proper {@link Value} object from the given {@code value} object.
*
* @param value the object to generate the {@link Value} for
* @return a {@link Value} if the {@code value} is not null, otherwise a {@link Null}
*/
private Value createValue(java.lang.Object value) {
return value == null ? Null.INSTANCE : new Primitive(value);
}
/**
* Returns a set of members of this object. The set is ordered, and the order is in which the
* values were added.
*
* @return a set of members of this object.
*/
public Set<Map.Entry<String, Value>> entrySet() {
return members.entrySet();
}
/**
* Returns the number of key/value pairs in the object.
*
* @return the number of key/value pairs in the object.
*/
public int size() {
return members.size();
}
/**
* Convenience method to check if a member with the specified name is present in this object.
*
* @param memberName name of the member that is being checked for presence.
* @return true if there is a member with the specified name, false otherwise.
*/
public boolean has(String memberName) {
return members.containsKey(memberName);
}
public boolean isPrimitive(String memberName) {
return has(memberName) && get(memberName).isPrimitive();
}
public boolean isBoolean(String memberName) {
if (has(memberName) && get(memberName).isPrimitive()) {
return getAsPrimitive(memberName).isBoolean();
}
return false;
}
public boolean isNumber(String memberName) {
if (has(memberName) && get(memberName).isPrimitive()) {
return getAsPrimitive(memberName).isNumber();
}
return false;
}
public boolean isObject(String memberName) {
return has(memberName) && get(memberName).isObject();
}
public boolean isArray(String memberName) {
return has(memberName) && get(memberName).isArray();
}
public boolean isNull(String memberName) {
return has(memberName) && get(memberName).isNull();
}
public boolean isLayout(String memberName) {
return has(memberName) && get(memberName).isLayout();
}
public boolean isBinding(String memberName) {
return has(memberName) && get(memberName).isBinding();
}
/**
* Returns the member with the specified name.
*
* @param memberName name of the member that is being requested.
* @return the member matching the name. Null if no such member exists.
*/
public Value get(String memberName) {
return members.get(memberName);
}
public Value get(String memberName, Value def) {
Value value = members.get(memberName);
if (value == null) {
return def;
}
return value;
}
/**
* Convenience method to get the specified member as a Value.
*
* @param memberName name of the member being requested.
* @return the Primitive corresponding to the specified member.
*/
public Primitive getAsPrimitive(String memberName) {
return (Primitive) members.get(memberName);
}
@Nullable
public Boolean getAsBoolean(String memberName) {
if (isBoolean(memberName)) {
return getAsPrimitive(memberName).getAsBoolean();
}
return null;
}
public boolean getAsBoolean(String memberName, boolean defaultValue) {
if (isBoolean(memberName)) {
return getAsPrimitive(memberName).getAsBoolean();
}
return defaultValue;
}
@Nullable
public Integer getAsInteger(String memberName) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsInt();
}
return null;
}
public int getAsInteger(String memberName, int defaultValue) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsInt();
}
return defaultValue;
}
@Nullable
public Float getAsFloat(String memberName) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsFloat();
}
return null;
}
public float getAsFloat(String memberName, float defaultValue) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsFloat();
}
return defaultValue;
}
@Nullable
public Double getAsDouble(String memberName) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsDouble();
}
return null;
}
public double getAsDouble(String memberName, double defaultValue) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsDouble();
}
return defaultValue;
}
@Nullable
public Long getAsLong(String memberName) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsLong();
}
return null;
}
public long getAsLong(String memberName, long defaultValue) {
if (isNumber(memberName)) {
return getAsPrimitive(memberName).getAsLong();
}
return defaultValue;
}
@Nullable
public String getAsString(String memberName) {
if (isPrimitive(memberName)) {
return getAsPrimitive(memberName).getAsString();
}
return null;
}
/**
* Convenience method to get the specified member as a Array.
*
* @param memberName name of the member being requested.
* @return the Array corresponding to the specified member.
*/
public Array getAsArray(String memberName) {
return (Array) members.get(memberName);
}
/**
* Convenience method to get the specified member as a ObjectValue.
*
* @param memberName name of the member being requested.
* @return the ObjectValue corresponding to the specified member.
*/
@Nullable
public ObjectValue getAsObject(String memberName) {
if (isObject(memberName)) {
return (ObjectValue) members.get(memberName);
}
return null;
}
@Nullable
public Layout getAsLayout(String memberName) {
if (isLayout(memberName)) {
return (Layout) members.get(memberName);
}
return null;
}
@Nullable
public Binding getAsBinding(String memberName) {
if (isBinding(memberName)) {
return (Binding) members.get(memberName);
}
return null;
}
@NonNull
@Override
public String toString() {
return members.entrySet().stream()
.map(it -> it.getKey() + ": " + it.getValue())
.collect(Collectors.joining("\n"));
}
@Override
public boolean equals(java.lang.Object o) {
return (o == this) || (o instanceof ObjectValue && ((ObjectValue) o).members.equals(members));
}
@Override
public int hashCode() {
return members.hashCode();
}
}
| 9,820 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
DrawableValue.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/DrawableValue.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.LevelListDrawable;
import android.graphics.drawable.RippleDrawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.ProteusLayoutInflater;
import com.flipkart.android.proteus.exceptions.ProteusInflateException;
import com.flipkart.android.proteus.parser.ParseHelper;
import com.flipkart.android.proteus.processor.ColorResourceProcessor;
import com.flipkart.android.proteus.processor.DimensionAttributeProcessor;
import com.flipkart.android.proteus.processor.DrawableResourceProcessor;
import com.flipkart.android.proteus.toolbox.SimpleArrayIterator;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* DrawableValue
*
* @author aditya.sharat
*/
public abstract class DrawableValue extends Value {
private static final String TYPE = "type";
private static final String CHILDREN = "children";
private static final String DRAWABLE_SELECTOR = "selector";
private static final String DRAWABLE_SHAPE = "shape";
private static final String DRAWABLE_LAYER_LIST = "layer-list";
private static final String DRAWABLE_LEVEL_LIST = "level-list";
private static final String DRAWABLE_RIPPLE = "ripple";
private static final String DRAWABLE_INSET = "inset";
private static final String TYPE_CORNERS = "corners";
private static final String TYPE_GRADIENT = "gradient";
private static final String TYPE_PADDING = "padding";
private static final String TYPE_SIZE = "size";
private static final String TYPE_SOLID = "solid";
private static final String TYPE_STROKE = "stroke";
@Nullable
public static DrawableValue valueOf(String value, ProteusContext context) {
if (Color.isColor(value)) {
return ColorValue.valueOf(value);
} else {
return UrlValue.valueOf(value);
}
}
public static DrawableValue valueOf(@NonNull File file) {
if (!file.exists()) {
return null;
}
return new FileValue(file);
}
@Nullable
public static DrawableValue valueOf(ObjectValue value, ProteusContext context) {
String type = value.getAsString(TYPE);
//noinspection ConstantConditions
switch (type) {
case DRAWABLE_SELECTOR:
return StateListValue.valueOf(value.getAsArray(CHILDREN), context);
case DRAWABLE_SHAPE:
return ShapeValue.valueOf(value, context);
case DRAWABLE_LAYER_LIST:
return LayerListValue.valueOf(value.getAsArray(CHILDREN), context);
case DRAWABLE_LEVEL_LIST:
return LevelListValue.valueOf(value.getAsArray(CHILDREN), context);
case DRAWABLE_RIPPLE:
return RippleValue.valueOf(value, context);
case DRAWABLE_INSET:
return new InsetValue(value, context);
default:
return null;
}
}
@NonNull
public static Drawable convertBitmapToDrawable(Bitmap original, ProteusContext context) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
int width = original.getWidth();
int height = original.getHeight();
float scaleWidth = displayMetrics.scaledDensity;
float scaleHeight = displayMetrics.scaledDensity;
Matrix matrix = new Matrix();
matrix.postScale(scaleWidth, scaleHeight);
Bitmap resizedBitmap = Bitmap.createBitmap(original, 0, 0, width, height, matrix, true);
return new BitmapDrawable(context.getResources(), resizedBitmap);
}
public abstract void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback);
@Override
public Value copy() {
return this;
}
public interface Callback {
void apply(Drawable drawable);
}
private static class FileValue extends DrawableValue {
private final File mFile;
private FileValue(File file) {
mFile = file;
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
Glide.with(view)
.asDrawable()
.load(mFile)
.into(
new CustomTarget<Drawable>() {
@Override
public void onResourceReady(
@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
callback.apply(resource);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {}
});
}
}
public static class ColorValue extends DrawableValue {
public static final ColorValue BLACK = new ColorValue(Color.Int.getDefaultColor());
public final Value color;
private ColorValue(Value color) {
this.color = color;
}
public static ColorValue valueOf(String value) {
return new ColorValue(Color.valueOf(value));
}
public static ColorValue valueOf(Value value, ProteusContext context) {
return new ColorValue(ColorResourceProcessor.staticCompile(value, context));
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
Drawable drawable = new ColorDrawable(ColorResourceProcessor.evaluate(color, view).color);
callback.apply(drawable);
}
@NonNull
@Override
public String toString() {
return color.toString();
}
}
public static class InsetValue extends DrawableValue {
private static final String INSET_LEFT = "android:insetLeft";
private static final String INSET_TOP = "android:insetTop";
private static final String INSET_RIGHT = "android:insetRight";
private static final String INSET_BOTTOM = "android:insetBottom";
private Dimension insetLeft;
private Dimension insetTop;
private Dimension insetRight;
private Dimension insetBottom;
private final DrawableValue drawableValue;
private InsetValue(ObjectValue value, ProteusContext context) {
Primitive insetLeft;
Primitive insetTop;
Primitive insetRight;
Primitive insetBottom;
insetLeft = value.getAsPrimitive(INSET_LEFT);
insetTop = value.getAsPrimitive(INSET_TOP);
insetRight = value.getAsPrimitive(INSET_RIGHT);
insetBottom = value.getAsPrimitive(INSET_BOTTOM);
if (insetLeft != null) {
this.insetLeft = Dimension.valueOf(insetLeft.toString());
}
if (insetTop != null) {
this.insetTop = Dimension.valueOf(insetTop.toString());
}
if (insetRight != null) {
this.insetRight = Dimension.valueOf(insetRight.toString());
}
if (insetBottom != null) {
this.insetBottom = Dimension.valueOf(insetBottom.toString());
}
DrawableValue drawableValue = null;
if (value.has(CHILDREN)) {
Value children = value.get(CHILDREN);
if (children.isArray()) {
Value first = children.getAsArray().get(0);
if (first.isObject()) {
drawableValue = DrawableValue.valueOf(first.getAsObject(), context);
}
}
}
this.drawableValue = drawableValue;
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
if (drawableValue != null) {
final int insetLeft;
final int insetTop;
final int insetRight;
final int insetBottom;
if (this.insetLeft != null) {
insetLeft = (int) this.insetLeft.apply(context);
} else {
insetLeft = -1;
}
if (this.insetTop != null) {
insetTop = (int) this.insetTop.apply(context);
} else {
insetTop = -1;
}
if (this.insetRight != null) {
insetRight = (int) this.insetRight.apply(context);
} else {
insetRight = -1;
}
if (this.insetBottom != null) {
insetBottom = (int) this.insetBottom.apply(context);
} else {
insetBottom = -1;
}
drawableValue.apply(
view,
context,
loader,
drawable -> {
InsetDrawable insetDrawable =
new InsetDrawable(drawable, insetLeft, insetTop, insetRight, insetBottom);
callback.apply(insetDrawable);
});
}
}
}
public static class ShapeValue extends DrawableValue {
private static final int SHAPE_NONE = -1;
private static final String SHAPE_RECTANGLE = "rectangle";
private static final String SHAPE_OVAL = "oval";
private static final String SHAPE_LINE = "line";
private static final String SHAPE_RING = "ring";
private static final String SHAPE = "shape";
public final int shape;
@Nullable public final Gradient gradient;
@Nullable private final DrawableElement[] elements;
private ShapeValue(ObjectValue value, ProteusContext context) {
this.shape = getShape(value.getAsString(SHAPE));
Gradient gradient = null;
DrawableElement[] elements = null;
if (value.has(CHILDREN)) {
Value childrenValue = value.get(CHILDREN);
if (childrenValue.isArray()) {
Array children = childrenValue.getAsArray();
if (children != null) {
Iterator<Value> iterator = children.iterator();
if (children.size() > 0) {
elements = new DrawableElement[children.size()];
int index = 0;
while (iterator.hasNext()) {
ObjectValue child = iterator.next().getAsObject();
String typeKey = child.getAsString(TYPE);
DrawableElement element = null;
//noinspection ConstantConditions
switch (typeKey) {
case TYPE_CORNERS:
element = Corners.valueOf(child, context);
break;
case TYPE_PADDING:
break;
case TYPE_SIZE:
element = Size.valueOf(child, context);
break;
case TYPE_SOLID:
element = Solid.valueOf(child, context);
break;
case TYPE_STROKE:
element = Stroke.valueOf(child, context);
break;
case TYPE_GRADIENT:
gradient = Gradient.valueOf(child, context);
element = gradient;
break;
}
if (null != element) {
elements[index] = element;
index++;
}
}
}
}
}
}
this.elements = elements;
this.gradient = gradient;
}
private ShapeValue(
int shape, @Nullable Gradient gradient, @Nullable DrawableElement[] elements) {
this.shape = shape;
this.gradient = gradient;
this.elements = elements;
}
public static ShapeValue valueOf(ObjectValue value, ProteusContext context) {
return new ShapeValue(value, context);
}
public static ShapeValue valueOf(
int shape, @Nullable Gradient gradient, @Nullable DrawableElement[] elements) {
return new ShapeValue(shape, gradient, elements);
}
private static int getShape(String shape) {
if (shape == null) {
return SHAPE_NONE;
}
switch (shape) {
case SHAPE_RECTANGLE:
return GradientDrawable.RECTANGLE;
case SHAPE_OVAL:
return GradientDrawable.OVAL;
case SHAPE_LINE:
return GradientDrawable.LINE;
case SHAPE_RING:
return GradientDrawable.RING;
default:
return SHAPE_NONE;
}
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
GradientDrawable drawable = null != gradient ? gradient.init(view) : new GradientDrawable();
if (-1 != shape) {
drawable.setShape(shape);
}
if (null != elements) {
for (DrawableElement element : elements) {
element.apply(view, drawable);
}
}
callback.apply(drawable);
}
}
public static class LayerListValue extends DrawableValue {
private static final String ID_STR = "id";
private static final String DRAWABLE_STR = "drawable";
private final int[] ids;
private final Value[] layers;
private LayerListValue(Array layers, ProteusContext context) {
this.ids = new int[layers.size()];
this.layers = new Value[layers.size()];
Pair<Integer, Value> pair;
int index = 0;
Iterator<Value> iterator = layers.iterator();
while (iterator.hasNext()) {
pair = parseLayer(iterator.next().getAsObject(), context);
this.ids[index] = pair.first;
this.layers[index] = pair.second;
index++;
}
}
public LayerListValue(int[] ids, Value[] layers) {
this.ids = ids;
this.layers = layers;
}
public static LayerListValue valueOf(Array layers, ProteusContext context) {
return new LayerListValue(layers, context);
}
public static LayerListValue valueOf(@NonNull int[] ids, @NonNull Value[] layers) {
return new LayerListValue(ids, layers);
}
public static Pair<Integer, Value> parseLayer(ObjectValue layer, ProteusContext context) {
String id = layer.getAsString(ID_STR);
int resId = View.NO_ID;
if (id != null) {
resId = ParseHelper.getAndroidXmlResId(id);
}
Value drawable = layer.get(DRAWABLE_STR);
Value out = DrawableResourceProcessor.staticCompile(drawable, context);
return new Pair<>(resId, out);
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
final Drawable[] drawables = new Drawable[layers.length];
int index = 0;
for (Value layer : layers) {
drawables[index] = DrawableResourceProcessor.evaluate(layer, view);
index++;
}
LayerDrawable layerDrawable = new LayerDrawable(drawables);
// we could have avoided the following loop if layer drawable
// had a method to add drawable and set id at same time
for (int i = 0; i < drawables.length; i++) {
layerDrawable.setId(i, ids[i]);
}
callback.apply(layerDrawable);
}
public Iterator<Integer> getIds() {
return SimpleArrayIterator.createIntArrayIterator(ids);
}
public Iterator<Value> getLayers() {
return new SimpleArrayIterator<>(layers);
}
}
public static class StateListValue extends DrawableValue {
private static final String DRAWABLE_STR = "drawable";
public static final Map<String, Integer> sStateMap = new HashMap<>();
static {
sStateMap.put("android:state_pressed", android.R.attr.state_pressed);
sStateMap.put("android:state_enabled", android.R.attr.state_enabled);
sStateMap.put("android:state_focused", android.R.attr.state_focused);
sStateMap.put("android:state_hovered", android.R.attr.state_hovered);
sStateMap.put("android:state_selected", android.R.attr.state_selected);
sStateMap.put("android:state_checkable", android.R.attr.state_checkable);
sStateMap.put("android:state_checked", android.R.attr.state_checked);
sStateMap.put("android:state_activated", android.R.attr.state_activated);
sStateMap.put("android:state_window_focused", android.R.attr.state_window_focused);
}
public final int[][] states;
private final Value[] values;
private StateListValue(int[][] states, Value[] values) {
this.states = states;
this.values = values;
}
private StateListValue(Array states, ProteusContext context) {
this.states = new int[states.size()][];
this.values = new Value[states.size()];
Iterator<Value> iterator = states.iterator();
Pair<int[], Value> pair;
int index = 0;
while (iterator.hasNext()) {
pair = parseState(iterator.next().getAsObject(), context);
this.states[index] = pair.first;
this.values[index] = pair.second;
index++;
}
}
public static StateListValue valueOf(int[][] states, Value[] values) {
return new StateListValue(states, values);
}
public static StateListValue valueOf(Array states, ProteusContext context) {
return new StateListValue(states, context);
}
@NonNull
private static Pair<int[], Value> parseState(ObjectValue value, ProteusContext context) {
Value drawable = DrawableResourceProcessor.staticCompile(value.get(DRAWABLE_STR), context);
int[] states = new int[value.getAsObject().entrySet().size() - 1];
int index = 0;
for (Map.Entry<String, Value> entry : value.getAsObject().entrySet()) {
Integer stateInteger = sStateMap.get(entry.getKey());
if (stateInteger != null) {
// e.g state_pressed = true state_pressed = false
states[index] = ParseHelper.parseBoolean(entry.getValue()) ? stateInteger : -stateInteger;
index++;
} else {
throw new IllegalArgumentException(entry.getKey() + " is not a valid state");
}
}
return new Pair<>(states, drawable);
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
final StateListDrawable stateListDrawable = new StateListDrawable();
int size = states.length;
for (int i = 0; i < size; i++) {
stateListDrawable.addState(states[i], DrawableResourceProcessor.evaluate(values[i], view));
}
callback.apply(stateListDrawable);
}
public Iterator<Value> getValues() {
return new SimpleArrayIterator<>(values);
}
}
public static class LevelListValue extends DrawableValue {
private final Level[] levels;
private LevelListValue(Array levels, ProteusContext context) {
this.levels = new Level[levels.size()];
int index = 0;
Iterator<Value> iterator = levels.iterator();
while (iterator.hasNext()) {
this.levels[index] = new Level(iterator.next().getAsObject(), context);
index++;
}
}
private LevelListValue(Level[] levels) {
this.levels = levels;
}
public static LevelListValue valueOf(Array layers, ProteusContext context) {
return new LevelListValue(layers, context);
}
public static LevelListValue value(Level[] levels) {
return new LevelListValue(levels);
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
final LevelListDrawable levelListDrawable = new LevelListDrawable();
for (Level level : levels) {
level.apply(view, levelListDrawable);
}
}
public Iterator<Level> getLevels() {
return new SimpleArrayIterator<>(levels);
}
public static class Level {
public static final String MIN_LEVEL = "minLevel";
public static final String MAX_LEVEL = "maxLevel";
public static final String DRAWABLE = "drawable";
public final int minLevel;
public final int maxLevel;
@NonNull public final Value drawable;
Level(ObjectValue value, ProteusContext context) {
//noinspection ConstantConditions
minLevel = value.getAsInteger(MIN_LEVEL);
//noinspection ConstantConditions
maxLevel = value.getAsInteger(MAX_LEVEL);
drawable = DrawableResourceProcessor.staticCompile(value.get(DRAWABLE), context);
}
private Level(int minLevel, int maxLevel, @NonNull Value drawable) {
this.minLevel = minLevel;
this.maxLevel = maxLevel;
this.drawable = drawable;
}
@NonNull
public static Level valueOf(
int minLevel, int maxLevel, @NonNull Value drawable, ProteusContext context) {
return new Level(
minLevel, maxLevel, DrawableResourceProcessor.staticCompile(drawable, context));
}
public void apply(View view, final LevelListDrawable levelListDrawable) {
levelListDrawable.addLevel(
minLevel, maxLevel, DrawableResourceProcessor.evaluate(drawable, view));
}
}
}
public static class RippleValue extends DrawableValue {
public static final String COLOR = "android:color";
public static final String MASK = "mask";
public static final String CONTENT = "android:content";
public static final String DEFAULT_BACKGROUND = "android:defaultBackground";
public static final String MASK_ID = "@android:id/mask";
@NonNull public final Value color;
@Nullable public final Value mask;
@Nullable public final Value content;
@Nullable public final Value defaultBackground;
public RippleValue(
@NonNull Value color,
@Nullable Value mask,
@Nullable Value content,
@Nullable Value defaultBackground) {
this.color = color;
this.mask = mask;
this.content = content;
this.defaultBackground = defaultBackground;
}
private RippleValue(ObjectValue object, ProteusContext context) {
color = object.get(COLOR);
mask = getMask(object, context);
content = DrawableResourceProcessor.staticCompile(object.get(CONTENT), context);
defaultBackground =
DrawableResourceProcessor.staticCompile(object.get(DEFAULT_BACKGROUND), context);
}
private Value getMask(ObjectValue object, ProteusContext context) {
Array children = object.getAsArray("children");
if (children == null) {
return null;
}
for (int i = 0; i < children.size(); i++) {
Value child = children.get(i);
if (child.isObject()) {
ObjectValue childObject = child.getAsObject();
String type = childObject.getAsString("type");
String id = childObject.getAsString("android:id");
if ("item".equals(type) && MASK_ID.equals(id)) {
return getMaskItem(childObject, context);
}
}
}
return null;
}
private Value getMaskItem(ObjectValue object, ProteusContext context) {
Array children = object.getAsArray("children");
if (children == null) {
return null;
}
for (int i = 0; i < children.size(); i++) {
Value child = children.get(i);
if (child.isObject()) {
return DrawableResourceProcessor.staticCompile(child, context);
}
}
return null;
}
public static RippleValue valueOf(
@NonNull Value color,
@Nullable Value mask,
@Nullable Value content,
@Nullable Value defaultBackground) {
return new RippleValue(color, mask, content, defaultBackground);
}
public static RippleValue valueOf(ObjectValue value, ProteusContext context) {
return new RippleValue(value, context);
}
@Override
public void apply(
View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
Callback callback) {
ColorStateList colorStateList;
Drawable contentDrawable = null;
Drawable maskDrawable = null;
Drawable resultDrawable = null;
Color.Result result = ColorResourceProcessor.evaluate(color, view);
if (null != result.colors) {
colorStateList = result.colors;
} else {
int[][] states = new int[][] {new int[] {}};
int[] colors = new int[] {result.color};
colorStateList = new ColorStateList(states, colors);
}
if (null != content) {
contentDrawable = DrawableResourceProcessor.evaluate(content, view);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (null != mask) {
maskDrawable = DrawableResourceProcessor.evaluate(mask, view);
}
resultDrawable = new RippleDrawable(colorStateList, contentDrawable, maskDrawable);
} else if (null != defaultBackground) {
resultDrawable = DrawableResourceProcessor.evaluate(defaultBackground, view);
} else if (contentDrawable != null) {
int pressedColor =
colorStateList.getColorForState(
new int[] {android.R.attr.state_pressed}, colorStateList.getDefaultColor());
int focusedColor =
colorStateList.getColorForState(new int[] {android.R.attr.state_focused}, pressedColor);
ColorDrawable pressedColorDrawable = new ColorDrawable(pressedColor);
ColorDrawable focusedColorDrawable = new ColorDrawable(focusedColor);
StateListDrawable stateListDrawable = new StateListDrawable();
stateListDrawable.addState(
new int[] {android.R.attr.state_enabled, android.R.attr.state_pressed},
pressedColorDrawable);
stateListDrawable.addState(
new int[] {android.R.attr.state_enabled, android.R.attr.state_focused},
focusedColorDrawable);
stateListDrawable.addState(new int[] {android.R.attr.state_enabled}, contentDrawable);
resultDrawable = stateListDrawable;
}
callback.apply(resultDrawable);
}
}
public static class UrlValue extends DrawableValue {
public final String url;
private UrlValue(String url) {
this.url = url;
}
public static UrlValue valueOf(String url) {
return new UrlValue(url);
}
@Override
public void apply(
final View view,
ProteusContext context,
ProteusLayoutInflater.ImageLoader loader,
final Callback callback) {
loader.getBitmap(
view,
url,
new AsyncCallback() {
@Override
protected void apply(@NonNull Drawable drawable) {
callback.apply(drawable);
}
@Override
protected void apply(@NonNull Bitmap bitmap) {
callback.apply(convertBitmapToDrawable(bitmap, context));
}
});
}
@NonNull
@Override
public String toString() {
return url;
}
}
/** */
private abstract static class DrawableElement extends Value {
public abstract void apply(View view, GradientDrawable drawable);
@Override
public Value copy() {
return this;
}
}
public static class Gradient extends DrawableElement {
public static final String ANGLE = "android:angle";
public static final String CENTER_X = "android:centerX";
public static final String CENTER_Y = "android:centerY";
public static final String CENTER_COLOR = "android:centerColor";
public static final String END_COLOR = "android:endColor";
public static final String GRADIENT_RADIUS = "android:gradientRadius";
public static final String START_COLOR = "android:startColor";
public static final String GRADIENT_TYPE = "android:gradientType";
public static final String USE_LEVEL = "android:useLevel";
private static final int GRADIENT_TYPE_NONE = -1;
private static final String LINEAR_GRADIENT = "linear";
private static final String RADIAL_GRADIENT = "radial";
private static final String SWEEP_GRADIENT = "sweep";
@Nullable public final Integer angle;
@Nullable public final Float centerX;
@Nullable public final Float centerY;
@Nullable public final Value centerColor;
@Nullable public final Value endColor;
@Nullable public final Value gradientRadius;
@Nullable public final Value startColor;
public final int gradientType;
@Nullable public final Boolean useLevel;
private Gradient(ObjectValue gradient, ProteusContext context) {
angle = gradient.getAsInteger(ANGLE);
centerX = gradient.getAsFloat(CENTER_X);
centerY = gradient.getAsFloat(CENTER_Y);
Value value;
value = gradient.get(START_COLOR);
if (value != null) {
startColor = ColorResourceProcessor.staticCompile(value, context);
} else {
startColor = null;
}
value = gradient.get(CENTER_COLOR);
if (value != null) {
centerColor = ColorResourceProcessor.staticCompile(value, context);
} else {
centerColor = null;
}
value = gradient.get(END_COLOR);
if (value != null) {
endColor = ColorResourceProcessor.staticCompile(value, context);
} else {
endColor = null;
}
value = gradient.get(GRADIENT_RADIUS);
if (value != null) {
gradientRadius = DimensionAttributeProcessor.staticCompile(value, context);
} else {
gradientRadius = null;
}
gradientType = getGradientType(gradient.getAsString(GRADIENT_TYPE));
useLevel = gradient.getAsBoolean(USE_LEVEL);
}
public static Gradient valueOf(ObjectValue value, ProteusContext context) {
return new Gradient(value, context);
}
public static GradientDrawable.Orientation getOrientation(@Nullable Integer angle) {
GradientDrawable.Orientation orientation = GradientDrawable.Orientation.LEFT_RIGHT;
if (null != angle) {
angle %= 360;
if (angle % 45 == 0) {
switch (angle) {
case 0:
orientation = GradientDrawable.Orientation.LEFT_RIGHT;
break;
case 45:
orientation = GradientDrawable.Orientation.BL_TR;
break;
case 90:
orientation = GradientDrawable.Orientation.BOTTOM_TOP;
break;
case 135:
orientation = GradientDrawable.Orientation.BR_TL;
break;
case 180:
orientation = GradientDrawable.Orientation.RIGHT_LEFT;
break;
case 225:
orientation = GradientDrawable.Orientation.TR_BL;
break;
case 270:
orientation = GradientDrawable.Orientation.TOP_BOTTOM;
break;
case 315:
orientation = GradientDrawable.Orientation.TL_BR;
break;
}
}
}
return orientation;
}
public static GradientDrawable init(@Nullable int[] colors, @Nullable Integer angle) {
return colors != null
? new GradientDrawable(getOrientation(angle), colors)
: new GradientDrawable();
}
@Override
public void apply(View view, final GradientDrawable drawable) {
if (null != centerX && null != centerY) {
drawable.setGradientCenter(centerX, centerY);
}
if (null != gradientRadius) {
drawable.setGradientRadius(DimensionAttributeProcessor.evaluate(gradientRadius, view));
}
if (GRADIENT_TYPE_NONE != gradientType) {
drawable.setGradientType(gradientType);
}
}
private int getGradientType(@Nullable String type) {
if (null == type) {
return GRADIENT_TYPE_NONE;
}
switch (type) {
case LINEAR_GRADIENT:
return GradientDrawable.LINEAR_GRADIENT;
case RADIAL_GRADIENT:
return GradientDrawable.RADIAL_GRADIENT;
case SWEEP_GRADIENT:
return GradientDrawable.SWEEP_GRADIENT;
default:
return GRADIENT_TYPE_NONE;
}
}
public GradientDrawable init(View view) {
int[] colors;
if (centerColor != null) {
colors = new int[3];
colors[0] = ColorResourceProcessor.evaluate(startColor, view).color;
colors[1] = ColorResourceProcessor.evaluate(centerColor, view).color;
colors[2] = ColorResourceProcessor.evaluate(endColor, view).color;
} else {
colors = new int[2];
colors[0] = ColorResourceProcessor.evaluate(startColor, view).color;
colors[1] = ColorResourceProcessor.evaluate(endColor, view).color;
}
return init(colors, angle);
}
}
public static class Corners extends DrawableElement {
public static final String RADIUS = "android:radius";
public static final String TOP_LEFT_RADIUS = "android:topLeftRadius";
public static final String TOP_RIGHT_RADIUS = "android:topRightRadius";
public static final String BOTTOM_LEFT_RADIUS = "android:bottomLeftRadius";
public static final String BOTTOM_RIGHT_RADIUS = "android:bottomRightRadius";
@Nullable private final Value radius;
@Nullable private final Value topLeftRadius;
@Nullable private final Value topRightRadius;
@Nullable private final Value bottomLeftRadius;
@Nullable private final Value bottomRightRadius;
private Corners(ObjectValue corner, ProteusContext context) {
radius = DimensionAttributeProcessor.staticCompile(corner.get(RADIUS), context);
topLeftRadius =
DimensionAttributeProcessor.staticCompile(corner.get(TOP_LEFT_RADIUS), context);
topRightRadius =
DimensionAttributeProcessor.staticCompile(corner.get(TOP_RIGHT_RADIUS), context);
bottomLeftRadius =
DimensionAttributeProcessor.staticCompile(corner.get(BOTTOM_LEFT_RADIUS), context);
bottomRightRadius =
DimensionAttributeProcessor.staticCompile(corner.get(BOTTOM_RIGHT_RADIUS), context);
}
public static Corners valueOf(ObjectValue corner, ProteusContext context) {
return new Corners(corner, context);
}
@Override
public void apply(View view, GradientDrawable gradientDrawable) {
if (null != radius) {
gradientDrawable.setCornerRadius(DimensionAttributeProcessor.evaluate(radius, view));
}
float fTopLeftRadius = DimensionAttributeProcessor.evaluate(topLeftRadius, view);
float fTopRightRadius = DimensionAttributeProcessor.evaluate(topRightRadius, view);
float fBottomRightRadius = DimensionAttributeProcessor.evaluate(bottomRightRadius, view);
float fBottomLeftRadius = DimensionAttributeProcessor.evaluate(bottomLeftRadius, view);
if (fTopLeftRadius != 0
|| fTopRightRadius != 0
|| fBottomRightRadius != 0
|| fBottomLeftRadius != 0) {
// The corner radii are specified in clockwise order (see Path.addRoundRect())
gradientDrawable.setCornerRadii(
new float[] {
fTopLeftRadius, fTopLeftRadius,
fTopRightRadius, fTopRightRadius,
fBottomRightRadius, fBottomRightRadius,
fBottomLeftRadius, fBottomLeftRadius
});
}
}
}
public static class Solid extends DrawableElement {
public static final String COLOR = "android:color";
private final Value color;
private Solid(ObjectValue value, ProteusContext context) {
color = ColorResourceProcessor.staticCompile(value.get(COLOR), context);
}
public static Solid valueOf(ObjectValue value, ProteusContext context) {
return new Solid(value, context);
}
@Override
public void apply(View view, final GradientDrawable gradientDrawable) {
Color.Result result = ColorResourceProcessor.evaluate(color, view);
if (null != result.colors && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
gradientDrawable.setColor(result.colors);
} else {
gradientDrawable.setColor(result.color);
}
}
}
public static class Size extends DrawableElement {
private static final String WIDTH = "android:width";
private static final String HEIGHT = "android:height";
private final Value width;
private final Value height;
private Size(ObjectValue value, ProteusContext context) {
width = DimensionAttributeProcessor.staticCompile(value.get(WIDTH), context);
height = DimensionAttributeProcessor.staticCompile(value.get(HEIGHT), context);
}
public static Size valueOf(ObjectValue value, ProteusContext context) {
return new Size(value, context);
}
@Override
public void apply(View view, GradientDrawable gradientDrawable) {
gradientDrawable.setSize(
(int) DimensionAttributeProcessor.evaluate(width, view),
(int) DimensionAttributeProcessor.evaluate(height, view));
}
}
public static class Stroke extends DrawableElement {
public static final String WIDTH = "android:width";
public static final String COLOR = "android:color";
public static final String DASH_WIDTH = "android:dashWidth";
public static final String DASH_GAP = "android:dashGap";
public final Value width;
public final Value color;
public final Value dashWidth;
public final Value dashGap;
private Stroke(ObjectValue stroke, ProteusContext context) {
width = DimensionAttributeProcessor.staticCompile(stroke.get(WIDTH), context);
color = ColorResourceProcessor.staticCompile(stroke.get(COLOR), context);
dashWidth = DimensionAttributeProcessor.staticCompile(stroke.get(DASH_WIDTH), context);
dashGap = DimensionAttributeProcessor.staticCompile(stroke.get(DASH_GAP), context);
}
public static Stroke valueOf(ObjectValue stroke, ProteusContext context) {
return new Stroke(stroke, context);
}
@Override
public void apply(View view, GradientDrawable gradientDrawable) {
if (null == dashWidth) {
gradientDrawable.setStroke(
(int) DimensionAttributeProcessor.evaluate(width, view),
ColorResourceProcessor.evaluate(color, view).color);
} else if (null != dashGap) {
gradientDrawable.setStroke(
(int) DimensionAttributeProcessor.evaluate(width, view),
ColorResourceProcessor.evaluate(color, view).color,
DimensionAttributeProcessor.evaluate(dashWidth, view),
DimensionAttributeProcessor.evaluate(dashGap, view));
}
}
}
/**
* AsyncCallback
*
* @author aditya.sharat
*/
public abstract static class AsyncCallback {
private boolean recycled;
protected AsyncCallback() {}
public void setBitmap(@NonNull Bitmap bitmap) {
if (recycled) {
throw new ProteusInflateException("Cannot make calls to a recycled instance!");
}
apply(bitmap);
recycled = true;
}
public void setDrawable(@NonNull Drawable drawable) {
if (recycled) {
throw new ProteusInflateException("Cannot make calls to a recycled instance!");
}
apply(drawable);
recycled = true;
}
protected abstract void apply(@NonNull Drawable drawable);
protected abstract void apply(@NonNull Bitmap bitmap);
}
}
| 40,169 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Layout.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Layout.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.toolbox.Utils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* Layout
*
* @author aditya.sharat
*/
public class Layout extends Value {
@NonNull public String type;
@Nullable public List<Attribute> attributes;
@Nullable public final Map<String, Value> data;
@Nullable public ObjectValue extras;
public Layout(@NonNull String type) {
this(type, new ArrayList<>(), new HashMap<>(), new ObjectValue());
}
public Layout(
@NonNull String type,
@Nullable List<Attribute> attributes,
@Nullable Map<String, Value> data,
@Nullable ObjectValue extras) {
this.type = type;
this.attributes = attributes;
this.data = data;
this.extras = extras;
}
@Override
public Layout copy() {
List<Attribute> attributes = null;
if (this.attributes != null) {
attributes = new ArrayList<>(this.attributes.size());
for (Attribute attribute : this.attributes) {
attributes.add(attribute.copy());
}
}
return new Layout(type, attributes, data, extras);
}
public Layout merge(Layout include) {
List<Attribute> attributes = null;
if (this.attributes != null) {
attributes = new ArrayList<>(this.attributes.size());
attributes.addAll(this.attributes);
}
if (include.attributes != null) {
if (attributes == null) {
attributes = new ArrayList<>(include.attributes.size());
}
attributes.addAll(include.attributes);
}
Map<String, Value> data = null;
if (this.data != null) {
data = this.data;
}
if (include.data != null) {
if (data == null) {
data = new LinkedHashMap<>(include.data.size());
}
data.putAll(include.data);
}
ObjectValue extras = new ObjectValue();
if (this.extras != null) {
extras = Utils.addAllEntries(extras, this.extras);
}
if (include.extras != null) {
if (extras == null) {
extras = new ObjectValue();
}
Utils.addAllEntries(extras, include.extras);
}
return new Layout(type, attributes, data, extras);
}
@NonNull
@Override
public String toString() {
return type;
}
@NonNull
public List<Attribute> getAttributes() {
if (null == attributes) {
return Collections.emptyList();
}
return attributes;
}
/**
* Attribute
*
* @author aditya.sharat
*/
public static class Attribute {
public final int id;
public final Value value;
public Attribute(int id, Value value) {
this.id = id;
this.value = value;
}
protected Attribute copy() {
return new Attribute(id, value.copy());
}
@Override
public int hashCode() {
return Integer.hashCode(id);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Attribute attribute = (Attribute) o;
return id == attribute.id;
}
}
}
| 3,854 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
AttributeResource.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/AttributeResource.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.LruCache;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.ProteusConstants;
import com.flipkart.android.proteus.ProteusContext;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* AttributeResource
*
* @author adityasharat
*/
public class AttributeResource extends Value {
public static final AttributeResource NULL = new AttributeResource(-1);
private static final String ATTR_START_LITERAL = "?";
private static final String ATTR_LITERAL = "attr/";
private static final Pattern sAttributePattern =
Pattern.compile("(\\?)(\\S*)(:?)(attr/?)(\\S*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
private static final Map<String, Class> sHashMap = new HashMap<>();
public final int attributeId;
private final String value;
public AttributeResource(String value) {
attributeId = -1;
this.value = value;
}
private AttributeResource(final int attributeId) {
this.attributeId = attributeId;
value = String.valueOf(attributeId);
}
private AttributeResource(String value, Context context)
throws ClassNotFoundException, NoSuchFieldException, IllegalAccessException {
this.value = value;
String attributeName;
String packageName = null;
Matcher matcher = sAttributePattern.matcher(value);
if (matcher.matches()) {
attributeName = matcher.group(5);
packageName = matcher.group(2);
} else {
attributeName = value.substring(1);
}
Class clazz;
if (null != packageName && !packageName.isEmpty()) {
packageName = packageName.substring(0, packageName.length() - 1);
} else {
packageName = context.getPackageName();
}
String className = packageName + ".R$attr";
clazz = sHashMap.get(className);
if (null == clazz) {
clazz = Class.forName(className);
sHashMap.put(className, clazz);
}
Field field = clazz.getField(attributeName);
attributeId = field.getInt(null);
}
public String getValue() {
return value;
}
public String getName() {
Matcher matcher = sAttributePattern.matcher(value);
if (matcher.matches()) {
String name = matcher.group(5);
if (value.startsWith("?android:attr")) {
return "android:" + name;
}
return name;
}
return value;
}
public static boolean isAttributeResource(String value) {
return value.startsWith(ATTR_START_LITERAL) && value.contains(ATTR_LITERAL);
}
public static AttributeResource valueOf(String value) {
return new AttributeResource(value);
}
@Nullable
public static AttributeResource valueOf(String value, Context context) {
AttributeResource attribute = AttributeCache.cache.get(value);
if (null == attribute) {
try {
attribute = new AttributeResource(value, context);
} catch (Exception e) {
if (ProteusConstants.isLoggingEnabled()) {
e.printStackTrace();
}
attribute = NULL;
}
AttributeCache.cache.put(value, attribute);
}
return NULL == attribute ? null : attribute;
}
@Nullable
public static AttributeResource valueOf(int value) {
return new AttributeResource(value);
}
public TypedArray apply(@NonNull Context context) {
return context.obtainStyledAttributes(new int[] {attributeId});
}
public Value resolve(View parent, View view, ProteusContext context) {
return context.obtainStyledAttribute(parent, view, getName());
}
@Override
public Value copy() {
return this;
}
public String toString() {
return value;
}
private static class AttributeCache {
static final LruCache<String, AttributeResource> cache = new LruCache<>(16);
}
}
| 4,590 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
VectorDrawable.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/VectorDrawable.java | package com.flipkart.android.proteus.value;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.InflateException;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.ProteusContext;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import org.xmlpull.v1.XmlPullParserException;
public class VectorDrawable extends Drawable {
private static final String LOGTAG = VectorDrawable.class.getSimpleName();
private static final String SHAPE_SIZE = "size";
private static final String SHAPE_VIEWPORT = "viewport";
private static final String SHAPE_PATH = "path";
private static final String SHAPE_VECTOR = "vector";
private static final int LINECAP_BUTT = 0;
private static final int LINECAP_ROUND = 1;
private static final int LINECAP_SQUARE = 2;
private static final int LINEJOIN_MITER = 0;
private static final int LINEJOIN_ROUND = 1;
private static final int LINEJOIN_BEVEL = 2;
private final VectorDrawableState mVectorState;
private int mAlpha = 0xFF;
private ProteusContext mContext;
public VectorDrawable() {
mVectorState = new VectorDrawableState(null);
}
public VectorDrawable(ObjectValue value, ProteusContext context) {
mVectorState = new VectorDrawableState(null);
mContext = context;
}
@Override
public void draw(@NonNull Canvas canvas) {
canvas.drawColor(0xffFFFFFF);
final int saveCount = canvas.save();
final Rect bounds = getBounds();
canvas.translate(bounds.left, bounds.top);
mVectorState.mVPathRenderer.draw(canvas, bounds.width(), bounds.height());
canvas.restoreToCount(saveCount);
}
@Override
public void setAlpha(int i) {}
@Override
public void setColorFilter(@Nullable ColorFilter colorFilter) {}
@Override
public int getIntrinsicWidth() {
return (int) mVectorState.mVPathRenderer.mBaseWidth;
}
@Override
public int getIntrinsicHeight() {
return (int) mVectorState.mVPathRenderer.mBaseHeight;
}
@Override
public int getOpacity() {
return PixelFormat.TRANSLUCENT;
}
@Nullable
@Override
public ConstantState getConstantState() {
return mVectorState;
}
public void inflate(ObjectValue value) {
VPathRenderer vPathRenderer = inflateInternal(value);
setPathRenderer(vPathRenderer);
}
boolean noSizeTag = true;
boolean noViewportTag = true;
boolean noPathTag = true;
private void parse(VGroup currentGroup, VPathRenderer renderer, ObjectValue value) {
String name = value.getAsString("type");
if (SHAPE_PATH.equals(name)) {
final VPath path = new VPath();
path.inflate(value);
currentGroup.add(path);
noPathTag = false;
} else if (SHAPE_SIZE.equals(name)) {
renderer.parseSize(value);
noSizeTag = false;
}
Value children = value.get("children");
if (children != null && children.isArray()) {
for (int i = 0; i < children.getAsArray().size(); i++) {
parse(currentGroup, renderer, children.getAsArray().get(i).getAsObject());
}
}
}
private VPathRenderer inflateInternal(ObjectValue value) {
final VPathRenderer pathRenderer = new VPathRenderer();
VGroup currentGroup = new VGroup();
parse(currentGroup, pathRenderer, value);
pathRenderer.mBaseWidth = Dimension.valueOf(value.get("width").getAsString()).apply(mContext);
pathRenderer.mBaseHeight = Dimension.valueOf(value.get("height").getAsString()).apply(mContext);
pathRenderer.mViewportWidth =
Dimension.valueOf(value.get("viewportWidth").getAsString()).apply(mContext);
pathRenderer.mViewportHeight =
Dimension.valueOf(value.get("viewportHeight").getAsString()).apply(mContext);
if (noPathTag) {
final StringBuilder tag = new StringBuilder();
if (noSizeTag) {
tag.append(SHAPE_SIZE);
}
if (noViewportTag) {
if (tag.length() > 0) {
tag.append(" & ");
}
tag.append(SHAPE_SIZE);
}
if (noPathTag) {
if (tag.length() > 0) {
tag.append(" or ");
}
tag.append(SHAPE_PATH);
}
throw new InflateException("no " + tag + " defined");
}
pathRenderer.mCurrentGroup = currentGroup;
pathRenderer.parseFinish();
return pathRenderer;
}
private void setPathRenderer(VPathRenderer pathRenderer) {
mVectorState.mVPathRenderer = pathRenderer;
}
private static class VectorDrawableState extends ConstantState {
int mChangingConfigurations;
VPathRenderer mVPathRenderer;
Rect mPadding;
public VectorDrawableState(VectorDrawableState copy) {
if (copy != null) {
mChangingConfigurations = copy.mChangingConfigurations;
mVPathRenderer = new VPathRenderer(copy.mVPathRenderer);
mPadding = new Rect(copy.mPadding);
}
}
@Override
public Drawable newDrawable() {
return new VectorDrawable(null, null);
}
@Override
public Drawable newDrawable(Resources res) {
return new VectorDrawable(null, null);
}
@Override
public Drawable newDrawable(Resources res, Theme theme) {
return new VectorDrawable(null, null);
}
@Override
public int getChangingConfigurations() {
return mChangingConfigurations;
}
}
private static class VPathRenderer {
private final Path mPath = new Path();
private final Path mRenderPath = new Path();
private final Matrix mMatrix = new Matrix();
private VPath[] mCurrentPaths;
private Paint mStrokePaint;
private Paint mFillPaint;
private PathMeasure mPathMeasure;
private VGroup mCurrentGroup = new VGroup();
float mBaseWidth = 1;
float mBaseHeight = 1;
float mViewportWidth;
float mViewportHeight;
public VPathRenderer() {}
public VPathRenderer(VPathRenderer copy) {
mCurrentGroup = copy.mCurrentGroup;
if (copy.mCurrentPaths != null) {
mCurrentPaths = new VPath[copy.mCurrentPaths.length];
for (int i = 0; i < mCurrentPaths.length; i++) {
mCurrentPaths[i] = new VPath(copy.mCurrentPaths[i]);
}
}
mBaseWidth = copy.mBaseWidth;
mBaseHeight = copy.mBaseHeight;
mViewportWidth = copy.mViewportHeight;
mViewportHeight = copy.mViewportHeight;
}
public boolean canApplyTheme() {
final ArrayList<VPath> paths = mCurrentGroup.mVGList;
for (int j = paths.size() - 1; j >= 0; j--) {
final VPath path = paths.get(j);
if (path.canApplyTheme()) {
return true;
}
}
return false;
}
public void applyTheme(Theme t) {
final ArrayList<VPath> paths = mCurrentGroup.mVGList;
for (int j = paths.size() - 1; j >= 0; j--) {
final VPath path = paths.get(j);
if (path.canApplyTheme()) {
path.applyTheme(t);
}
}
}
public void draw(Canvas canvas, int w, int h) {
if (mCurrentPaths == null) {
Log.e(LOGTAG, "mCurrentPaths == null");
return;
}
for (int i = 0; i < mCurrentPaths.length; i++) {
if (mCurrentPaths[i] != null) {
drawPath(mCurrentPaths[i], canvas, w, h);
}
}
}
private void drawPath(VPath vPath, Canvas canvas, int w, int h) {
final float scale = Math.min(h / mViewportHeight, w / mViewportWidth);
vPath.toPath(mPath);
final Path path = mPath;
if (vPath.mTrimPathStart != 0.0f || vPath.mTrimPathEnd != 1.0f) {
float start = (vPath.mTrimPathStart + vPath.mTrimPathOffset) % 1.0f;
float end = (vPath.mTrimPathEnd + vPath.mTrimPathOffset) % 1.0f;
if (mPathMeasure == null) {
mPathMeasure = new PathMeasure();
}
mPathMeasure.setPath(mPath, false);
float len = mPathMeasure.getLength();
start = start * len;
end = end * len;
path.reset();
if (start > end) {
mPathMeasure.getSegment(start, len, path, true);
mPathMeasure.getSegment(0f, end, path, true);
} else {
mPathMeasure.getSegment(start, end, path, true);
}
path.rLineTo(0, 0); // fix bug in measure
}
mRenderPath.reset();
mMatrix.reset();
mMatrix.postRotate(vPath.mRotate, vPath.mPivotX, vPath.mPivotY);
mMatrix.postScale(scale, scale, mViewportWidth / 2f, mViewportHeight / 2f);
mMatrix.postTranslate(w / 2f - mViewportWidth / 2f, h / 2f - mViewportHeight / 2f);
mRenderPath.addPath(path, mMatrix);
if (vPath.mClip) {
canvas.clipPath(mRenderPath, Region.Op.REPLACE);
}
if (vPath.mFillColor != 0) {
if (mFillPaint == null) {
mFillPaint = new Paint();
mFillPaint.setStyle(Paint.Style.FILL);
mFillPaint.setAntiAlias(true);
}
mFillPaint.setColor(vPath.mFillColor);
canvas.drawPath(mRenderPath, mFillPaint);
}
if (vPath.mStrokeColor != 0) {
if (mStrokePaint == null) {
mStrokePaint = new Paint();
mStrokePaint.setStyle(Paint.Style.STROKE);
mStrokePaint.setAntiAlias(true);
}
final Paint strokePaint = mStrokePaint;
if (vPath.mStrokeLineJoin != null) {
strokePaint.setStrokeJoin(vPath.mStrokeLineJoin);
}
if (vPath.mStrokeLineCap != null) {
strokePaint.setStrokeCap(vPath.mStrokeLineCap);
}
strokePaint.setStrokeMiter(vPath.mStrokeMiterlimit * scale);
strokePaint.setColor(vPath.mStrokeColor);
strokePaint.setStrokeWidth(vPath.mStrokeWidth * scale);
canvas.drawPath(mRenderPath, strokePaint);
}
}
/**
* Build the "current" path based on the current group TODO: improve memory use & performance or
* move to C++
*/
public void parseFinish() {
final Collection<VPath> paths = mCurrentGroup.getPaths();
mCurrentPaths = paths.toArray(new VPath[paths.size()]);
for (int i = 0; i < mCurrentPaths.length; i++) {
mCurrentPaths[i] = new VPath(mCurrentPaths[i]);
}
}
private void parseViewport(Resources r, AttributeSet attrs) throws XmlPullParserException {
// final TypedArray a = r.obtainAttributes(attrs,
// R.styleable.VectorDrawableViewport);
// mViewportWidth = a.getFloat(R.styleable.VectorDrawableViewport_viewportWidth,
// 0);
// mViewportHeight = a.getFloat(R.styleable.VectorDrawableViewport_viewportHeight,
// 0);
// if (mViewportWidth == 0 || mViewportHeight == 0) {
// throw new XmlPullParserException(a.getPositionDescription()+
// "<viewport> tag requires viewportWidth & viewportHeight to be set");
// }
// a.recycle();
}
private void parseSize(Resources r, AttributeSet attrs) throws XmlPullParserException {
// final TypedArray a = r.obtainAttributes(attrs, R.styleable.VectorDrawableSize);
// mBaseWidth = a.getDimension(R.styleable.VectorDrawableSize_width, 0);
// mBaseHeight = a.getDimension(R.styleable.VectorDrawableSize_height, 0);
// if (mBaseWidth == 0 || mBaseHeight == 0) {
// throw new XmlPullParserException(a.getPositionDescription()+
// "<size> tag requires width & height to be set");
// }
// a.recycle();
}
private void parseSize(ObjectValue value) {}
}
private static class VPath {
private static final int MAX_STATES = 10;
private int[] mThemeAttrs;
int mStrokeColor = 0;
float mStrokeWidth = 0;
float mStrokeOpacity = Float.NaN;
int mFillColor = 0;
int mFillRule;
float mFillOpacity = Float.NaN;
float mRotate = 0;
float mPivotX = 0;
float mPivotY = 0;
float mTrimPathStart = 0;
float mTrimPathEnd = 1;
float mTrimPathOffset = 0;
boolean mClip = false;
Paint.Cap mStrokeLineCap = Paint.Cap.BUTT;
Paint.Join mStrokeLineJoin = Paint.Join.MITER;
float mStrokeMiterlimit = 4;
private VNode[] mNode = null;
private String mId;
private int[] mCheckState = new int[MAX_STATES];
private boolean[] mCheckValue = new boolean[MAX_STATES];
private int mNumberOfStates = 0;
public VPath() {
// Empty constructor.
}
public VPath(VPath p) {
copyFrom(p);
}
public void toPath(Path path) {
path.reset();
if (mNode != null) {
VNode.createPath(mNode, path);
}
}
public String getID() {
return mId;
}
private Paint.Cap getStrokeLineCap(int id, Paint.Cap defValue) {
switch (id) {
case LINECAP_BUTT:
return Paint.Cap.BUTT;
case LINECAP_ROUND:
return Paint.Cap.ROUND;
case LINECAP_SQUARE:
return Paint.Cap.SQUARE;
default:
return defValue;
}
}
private Paint.Join getStrokeLineJoin(int id, Paint.Join defValue) {
switch (id) {
case LINEJOIN_MITER:
return Paint.Join.MITER;
case LINEJOIN_ROUND:
return Paint.Join.ROUND;
case LINEJOIN_BEVEL:
return Paint.Join.BEVEL;
default:
return defValue;
}
}
public void inflate(ObjectValue values) {
mClip = values.getAsBoolean("clipToPath", false);
mId = "nameasdasd";
mNode = parsePath(values.getAsString("pathData"));
mFillColor = 0xffFE6262;
mStrokeColor = 0xffFE6262;
mStrokeWidth = 20;
updateColorAlphas();
}
public void inflate(Resources r, AttributeSet attrs, Theme theme) {
final TypedArray a =
null; // obtainAttributes(r, theme, attrs, R.styleable.VectorDrawablePath);
// final int[] themeAttrs = a.extractThemeAttrs();
// mThemeAttrs = themeAttrs;
// NOTE: The set of attributes loaded here MUST match the
// set of attributes loaded in applyTheme.
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_clipToPath]
// == 0) {
// mClip = a.getBoolean(R.styleable.VectorDrawablePath_clipToPath, mClip);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_name] == 0)
// {
// mId = a.getString(R.styleable.VectorDrawablePath_name);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_pathData] ==
// 0) {
// mNode = parsePath(a.getString(R.styleable.VectorDrawablePath_pathData));
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_fill] == 0)
// {
// mFillColor = a.getColor(R.styleable.VectorDrawablePath_fill, mFillColor);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_fillOpacity]
// == 0) {
// mFillOpacity = a.getFloat(R.styleable.VectorDrawablePath_fillOpacity,
// mFillOpacity);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_rotation] ==
// 0) {
// mRotate = a.getFloat(R.styleable.VectorDrawablePath_rotation, mRotate);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_pivotX] ==
// 0) {
// mPivotX = a.getFloat(R.styleable.VectorDrawablePath_pivotX, mPivotX);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_pivotY] ==
// 0) {
// mPivotY = a.getFloat(R.styleable.VectorDrawablePath_pivotY, mPivotY);
// }
// if (themeAttrs == null
// || themeAttrs[R.styleable.VectorDrawablePath_strokeLineCap] == 0) {
// mStrokeLineCap = getStrokeLineCap(
// a.getInt(R.styleable.VectorDrawablePath_strokeLineCap, -1),
// mStrokeLineCap);
// }
// if (themeAttrs == null
// || themeAttrs[R.styleable.VectorDrawablePath_strokeLineJoin] == 0) {
// mStrokeLineJoin = getStrokeLineJoin(
// a.getInt(R.styleable.VectorDrawablePath_strokeLineJoin, -1),
// mStrokeLineJoin);
// }
// if (themeAttrs == null
// || themeAttrs[R.styleable.VectorDrawablePath_strokeMiterLimit] == 0) {
// mStrokeMiterlimit = a.getFloat(
// R.styleable.VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_stroke] ==
// 0) {
// mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_stroke,
// mStrokeColor);
// }
// if (themeAttrs == null
// || themeAttrs[R.styleable.VectorDrawablePath_strokeOpacity] == 0) {
// mStrokeOpacity = a.getFloat(
// R.styleable.VectorDrawablePath_strokeOpacity, mStrokeOpacity);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_strokeWidth]
// == 0) {
// mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_strokeWidth,
// mStrokeWidth);
// }
// if (themeAttrs == null || themeAttrs[R.styleable.VectorDrawablePath_trimPathEnd]
// == 0) {
// mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_trimPathEnd,
// mTrimPathEnd);
// }
// if (themeAttrs == null
// || themeAttrs[R.styleable.VectorDrawablePath_trimPathOffset] == 0) {
// mTrimPathOffset = a.getFloat(
// R.styleable.VectorDrawablePath_trimPathOffset, mTrimPathOffset);
// }
// if (themeAttrs == null
// || themeAttrs[R.styleable.VectorDrawablePath_trimPathStart] == 0) {
// mTrimPathStart = a.getFloat(
// R.styleable.VectorDrawablePath_trimPathStart, mTrimPathStart);
// }
updateColorAlphas();
a.recycle();
}
public boolean canApplyTheme() {
return mThemeAttrs != null;
}
public void applyTheme(Theme t) {
if (mThemeAttrs == null) {
return;
}
// final TypedArray a = t.resolveAttributes(
// mThemeAttrs, R.styleable.VectorDrawablePath);
// mClip = a.getBoolean(R.styleable.VectorDrawablePath_clipToPath, mClip);
// if (a.hasValue(R.styleable.VectorDrawablePath_name)) {
// mId = a.getString(R.styleable.VectorDrawablePath_name);
// }
// if (a.hasValue(R.styleable.VectorDrawablePath_pathData)) {
// mNode = parsePath(a.getString(R.styleable.VectorDrawablePath_pathData));
// }
// mFillColor = a.getColor(R.styleable.VectorDrawablePath_fill, mFillColor);
// mFillOpacity = a.getFloat(R.styleable.VectorDrawablePath_fillOpacity,
// mFillOpacity);
// mRotate = a.getFloat(R.styleable.VectorDrawablePath_rotation, mRotate);
// mPivotX = a.getFloat(R.styleable.VectorDrawablePath_pivotX, mPivotX);
// mPivotY = a.getFloat(R.styleable.VectorDrawablePath_pivotY, mPivotY);
// mStrokeLineCap = getStrokeLineCap(a.getInt(
// R.styleable.VectorDrawablePath_strokeLineCap, -1), mStrokeLineCap);
// mStrokeLineJoin = getStrokeLineJoin(a.getInt(
// R.styleable.VectorDrawablePath_strokeLineJoin, -1), mStrokeLineJoin);
// mStrokeMiterlimit = a.getFloat(
// R.styleable.VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit);
// mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_stroke, mStrokeColor);
// mStrokeOpacity = a.getFloat(
// R.styleable.VectorDrawablePath_strokeOpacity, mStrokeOpacity);
// mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_strokeWidth,
// mStrokeWidth);
// mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_trimPathEnd,
// mTrimPathEnd);
// mTrimPathOffset = a.getFloat(
// R.styleable.VectorDrawablePath_trimPathOffset, mTrimPathOffset);
// mTrimPathStart = a.getFloat(
// R.styleable.VectorDrawablePath_trimPathStart, mTrimPathStart);
updateColorAlphas();
}
private void updateColorAlphas() {
if (!Float.isNaN(mFillOpacity)) {
mFillColor &= 0x00FFFFFF;
mFillColor |= ((int) (0xFF * mFillOpacity)) << 24;
}
if (!Float.isNaN(mStrokeOpacity)) {
mStrokeColor &= 0x00FFFFFF;
mStrokeColor |= ((int) (0xFF * mStrokeOpacity)) << 24;
}
}
private static int nextStart(String s, int end) {
char c;
while (end < s.length()) {
c = s.charAt(end);
if (((c - 'A') * (c - 'Z') <= 0) || (((c - 'a') * (c - 'z') <= 0))) {
return end;
}
end++;
}
return end;
}
private void addNode(ArrayList<VNode> list, char cmd, float[] val) {
list.add(new VectorDrawable.VNode(cmd, val));
}
/**
* parse the floats in the string this is an optimized version of parseFloat(s.split(",|\\s"));
*
* @param s the string containing a command and list of floats
* @return array of floats
*/
private static float[] getFloats(String s) {
if (s.charAt(0) == 'z' | s.charAt(0) == 'Z') {
return new float[0];
}
try {
float[] tmp = new float[s.length()];
int count = 0;
int pos = 1, end;
while ((end = extract(s, pos)) >= 0) {
if (pos < end) {
tmp[count++] = Float.parseFloat(s.substring(pos, end));
}
pos = end + 1;
}
// handle the final float if there is one
if (pos < s.length()) {
tmp[count++] = Float.parseFloat(s.substring(pos, s.length()));
}
return Arrays.copyOf(tmp, count);
} catch (NumberFormatException e) {
Log.e(LOGTAG, "error in parsing \"" + s + "\"");
throw e;
}
}
/**
* calculate the position of the next comma or space
*
* @param s the string to search
* @param start the position to start searching
* @return the position of the next comma or space or -1 if none found
*/
private static int extract(String s, int start) {
int space = s.indexOf(' ', start);
int comma = s.indexOf(',', start);
if (space == -1) {
return comma;
}
if (comma == -1) {
return space;
}
return (comma > space) ? space : comma;
}
private VectorDrawable.VNode[] parsePath(String value) {
int start = 0;
int end = 1;
ArrayList<VectorDrawable.VNode> list = new ArrayList<>();
while (end < value.length()) {
end = nextStart(value, end);
String s = value.substring(start, end);
float[] val = getFloats(s);
addNode(list, s.charAt(0), val);
start = end;
end++;
}
if ((end - start) == 1 && start < value.length()) {
addNode(list, value.charAt(start), new float[0]);
}
return list.toArray(new VectorDrawable.VNode[list.size()]);
}
public void copyFrom(VPath p1) {
mNode = new VNode[p1.mNode.length];
for (int i = 0; i < mNode.length; i++) {
mNode[i] = new VNode(p1.mNode[i]);
}
mId = p1.mId;
mStrokeColor = p1.mStrokeColor;
mFillColor = p1.mFillColor;
mStrokeWidth = p1.mStrokeWidth;
mRotate = p1.mRotate;
mPivotX = p1.mPivotX;
mPivotY = p1.mPivotY;
mTrimPathStart = p1.mTrimPathStart;
mTrimPathEnd = p1.mTrimPathEnd;
mTrimPathOffset = p1.mTrimPathOffset;
mStrokeLineCap = p1.mStrokeLineCap;
mStrokeLineJoin = p1.mStrokeLineJoin;
mStrokeMiterlimit = p1.mStrokeMiterlimit;
mNumberOfStates = p1.mNumberOfStates;
for (int i = 0; i < mNumberOfStates; i++) {
mCheckState[i] = p1.mCheckState[i];
mCheckValue[i] = p1.mCheckValue[i];
}
mFillRule = p1.mFillRule;
}
}
private static class VGroup {
private final HashMap<String, VPath> mVGPathMap = new HashMap<String, VPath>();
private final ArrayList<VPath> mVGList = new ArrayList<VPath>();
public void add(VPath path) {
String id = path.getID();
mVGPathMap.put(id, path);
mVGList.add(path);
}
/**
* Must return in order of adding
*
* @return ordered list of paths
*/
public Collection<VPath> getPaths() {
return mVGList;
}
}
private static class VNode {
private char mType;
private float[] mParams;
public VNode(char type, float[] params) {
mType = type;
mParams = params;
}
public VNode(VNode n) {
mType = n.mType;
mParams = Arrays.copyOf(n.mParams, n.mParams.length);
}
public static void createPath(VNode[] node, Path path) {
float[] current = new float[4];
char previousCommand = 'm';
for (int i = 0; i < node.length; i++) {
addCommand(path, current, previousCommand, node[i].mType, node[i].mParams);
previousCommand = node[i].mType;
}
}
private static void addCommand(
Path path, float[] current, char previousCmd, char cmd, float[] val) {
int incr = 2;
float currentX = current[0];
float currentY = current[1];
float ctrlPointX = current[2];
float ctrlPointY = current[3];
float reflectiveCtrlPointX;
float reflectiveCtrlPointY;
switch (cmd) {
case 'z':
case 'Z':
path.close();
return;
case 'm':
case 'M':
case 'l':
case 'L':
case 't':
case 'T':
incr = 2;
break;
case 'h':
case 'H':
case 'v':
case 'V':
incr = 1;
break;
case 'c':
case 'C':
incr = 6;
break;
case 's':
case 'S':
case 'q':
case 'Q':
incr = 4;
break;
case 'a':
case 'A':
incr = 7;
break;
}
for (int k = 0; k < val.length; k += incr) {
switch (cmd) {
case 'm': // moveto - Start a new sub-path (relative)
path.rMoveTo(val[k + 0], val[k + 1]);
currentX += val[k + 0];
currentY += val[k + 1];
break;
case 'M': // moveto - Start a new sub-path
path.moveTo(val[k + 0], val[k + 1]);
currentX = val[k + 0];
currentY = val[k + 1];
break;
case 'l': // lineto - Draw a line from the current point (relative)
path.rLineTo(val[k + 0], val[k + 1]);
currentX += val[k + 0];
currentY += val[k + 1];
break;
case 'L': // lineto - Draw a line from the current point
path.lineTo(val[k + 0], val[k + 1]);
currentX = val[k + 0];
currentY = val[k + 1];
break;
case 'z': // closepath - Close the current subpath
case 'Z': // closepath - Close the current subpath
path.close();
break;
case 'h': // horizontal lineto - Draws a horizontal line (relative)
path.rLineTo(val[k + 0], 0);
currentX += val[k + 0];
break;
case 'H': // horizontal lineto - Draws a horizontal line
path.lineTo(val[k + 0], currentY);
currentX = val[k + 0];
break;
case 'v': // vertical lineto - Draws a vertical line from the current point (r)
path.rLineTo(0, val[k + 0]);
currentY += val[k + 0];
break;
case 'V': // vertical lineto - Draws a vertical line from the current point
path.lineTo(currentX, val[k + 0]);
currentY = val[k + 0];
break;
case 'c': // curveto - Draws a cubic Bézier curve (relative)
path.rCubicTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3], val[k + 4], val[k + 5]);
ctrlPointX = currentX + val[k + 2];
ctrlPointY = currentY + val[k + 3];
currentX += val[k + 4];
currentY += val[k + 5];
break;
case 'C': // curveto - Draws a cubic Bézier curve
path.cubicTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3], val[k + 4], val[k + 5]);
currentX = val[k + 4];
currentY = val[k + 5];
ctrlPointX = val[k + 2];
ctrlPointY = val[k + 3];
break;
case 's': // smooth curveto - Draws a cubic Bézier curve (reflective cp)
reflectiveCtrlPointX = 0;
reflectiveCtrlPointY = 0;
if (previousCmd == 'c'
|| previousCmd == 's'
|| previousCmd == 'C'
|| previousCmd == 'S') {
reflectiveCtrlPointX = currentX - ctrlPointX;
reflectiveCtrlPointY = currentY - ctrlPointY;
}
path.rCubicTo(
reflectiveCtrlPointX,
reflectiveCtrlPointY,
val[k + 0],
val[k + 1],
val[k + 2],
val[k + 3]);
ctrlPointX = currentX + val[k + 0];
ctrlPointY = currentY + val[k + 1];
currentX += val[k + 2];
currentY += val[k + 3];
break;
case 'S': // shorthand/smooth curveto Draws a cubic Bézier curve(reflective cp)
reflectiveCtrlPointX = currentX;
reflectiveCtrlPointY = currentY;
if (previousCmd == 'c'
|| previousCmd == 's'
|| previousCmd == 'C'
|| previousCmd == 'S') {
reflectiveCtrlPointX = 2 * currentX - ctrlPointX;
reflectiveCtrlPointY = 2 * currentY - ctrlPointY;
}
path.cubicTo(
reflectiveCtrlPointX,
reflectiveCtrlPointY,
val[k + 0],
val[k + 1],
val[k + 2],
val[k + 3]);
ctrlPointX = val[k + 0];
ctrlPointY = val[k + 1];
currentX = val[k + 2];
currentY = val[k + 3];
break;
case 'q': // Draws a quadratic Bézier (relative)
path.rQuadTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3]);
ctrlPointX = currentX + val[k + 0];
ctrlPointY = currentY + val[k + 1];
currentX += val[k + 2];
currentY += val[k + 3];
break;
case 'Q': // Draws a quadratic Bézier
path.quadTo(val[k + 0], val[k + 1], val[k + 2], val[k + 3]);
ctrlPointX = val[k + 0];
ctrlPointY = val[k + 1];
currentX = val[k + 2];
currentY = val[k + 3];
break;
case 't': // Draws a quadratic Bézier curve(reflective control point)(relative)
reflectiveCtrlPointX = 0;
reflectiveCtrlPointY = 0;
if (previousCmd == 'q'
|| previousCmd == 't'
|| previousCmd == 'Q'
|| previousCmd == 'T') {
reflectiveCtrlPointX = currentX - ctrlPointX;
reflectiveCtrlPointY = currentY - ctrlPointY;
}
path.rQuadTo(reflectiveCtrlPointX, reflectiveCtrlPointY, val[k + 0], val[k + 1]);
ctrlPointX = currentX + reflectiveCtrlPointX;
ctrlPointY = currentY + reflectiveCtrlPointY;
currentX += val[k + 0];
currentY += val[k + 1];
break;
case 'T': // Draws a quadratic Bézier curve (reflective control point)
reflectiveCtrlPointX = currentX;
reflectiveCtrlPointY = currentY;
if (previousCmd == 'q'
|| previousCmd == 't'
|| previousCmd == 'Q'
|| previousCmd == 'T') {
reflectiveCtrlPointX = 2 * currentX - ctrlPointX;
reflectiveCtrlPointY = 2 * currentY - ctrlPointY;
}
path.quadTo(reflectiveCtrlPointX, reflectiveCtrlPointY, val[k + 0], val[k + 1]);
ctrlPointX = reflectiveCtrlPointX;
ctrlPointY = reflectiveCtrlPointY;
currentX = val[k + 0];
currentY = val[k + 1];
break;
case 'a': // Draws an elliptical arc
// (rx ry x-axis-rotation large-arc-flag sweep-flag x y)
drawArc(
path,
currentX,
currentY,
val[k + 5] + currentX,
val[k + 6] + currentY,
val[k + 0],
val[k + 1],
val[k + 2],
val[k + 3] != 0,
val[k + 4] != 0);
currentX += val[k + 5];
currentY += val[k + 6];
ctrlPointX = currentX;
ctrlPointY = currentY;
break;
case 'A': // Draws an elliptical arc
drawArc(
path,
currentX,
currentY,
val[k + 5],
val[k + 6],
val[k + 0],
val[k + 1],
val[k + 2],
val[k + 3] != 0,
val[k + 4] != 0);
currentX = val[k + 5];
currentY = val[k + 6];
ctrlPointX = currentX;
ctrlPointY = currentY;
break;
}
previousCmd = cmd;
}
current[0] = currentX;
current[1] = currentY;
current[2] = ctrlPointX;
current[3] = ctrlPointY;
}
private static void drawArc(
Path p,
float x0,
float y0,
float x1,
float y1,
float a,
float b,
float theta,
boolean isMoreThanHalf,
boolean isPositiveArc) {
/* Convert rotation angle from degrees to radians */
double thetaD = Math.toRadians(theta);
/* Pre-compute rotation matrix entries */
double cosTheta = Math.cos(thetaD);
double sinTheta = Math.sin(thetaD);
/* Transform (x0, y0) and (x1, y1) into unit space */
/* using (inverse) rotation, followed by (inverse) scale */
double x0p = (x0 * cosTheta + y0 * sinTheta) / a;
double y0p = (-x0 * sinTheta + y0 * cosTheta) / b;
double x1p = (x1 * cosTheta + y1 * sinTheta) / a;
double y1p = (-x1 * sinTheta + y1 * cosTheta) / b;
/* Compute differences and averages */
double dx = x0p - x1p;
double dy = y0p - y1p;
double xm = (x0p + x1p) / 2;
double ym = (y0p + y1p) / 2;
/* Solve for intersecting unit circles */
double dsq = dx * dx + dy * dy;
if (dsq == 0.0) {
Log.w("VectorDrawable", " Points are coincident");
return; /* Points are coincident */
}
double disc = 1.0 / dsq - 1.0 / 4.0;
if (disc < 0.0) {
Log.w("VectorDrawable", "Points are too far apart " + dsq);
float adjust = (float) (Math.sqrt(dsq) / 1.99999);
drawArc(p, x0, y0, x1, y1, a * adjust, b * adjust, theta, isMoreThanHalf, isPositiveArc);
return; /* Points are too far apart */
}
double s = Math.sqrt(disc);
double sdx = s * dx;
double sdy = s * dy;
double cx;
double cy;
if (isMoreThanHalf == isPositiveArc) {
cx = xm - sdy;
cy = ym + sdx;
} else {
cx = xm + sdy;
cy = ym - sdx;
}
double eta0 = Math.atan2((y0p - cy), (x0p - cx));
double eta1 = Math.atan2((y1p - cy), (x1p - cx));
double sweep = (eta1 - eta0);
if (isPositiveArc != (sweep >= 0)) {
if (sweep > 0) {
sweep -= 2 * Math.PI;
} else {
sweep += 2 * Math.PI;
}
}
cx *= a;
cy *= b;
double tcx = cx;
cx = cx * cosTheta - cy * sinTheta;
cy = tcx * sinTheta + cy * cosTheta;
arcToBezier(p, cx, cy, a, b, x0, y0, thetaD, eta0, sweep);
}
/**
* Converts an arc to cubic Bezier segments and records them in p.
*
* @param p The target for the cubic Bezier segments
* @param cx The x coordinate center of the ellipse
* @param cy The y coordinate center of the ellipse
* @param a The radius of the ellipse in the horizontal direction
* @param b The radius of the ellipse in the vertical direction
* @param e1x E(eta1) x coordinate of the starting point of the arc
* @param e1y E(eta2) y coordinate of the starting point of the arc
* @param theta The angle that the ellipse bounding rectangle makes with horizontal plane
* @param start The start angle of the arc on the ellipse
* @param sweep The angle (positive or negative) of the sweep of the arc on the ellipse
*/
private static void arcToBezier(
Path p,
double cx,
double cy,
double a,
double b,
double e1x,
double e1y,
double theta,
double start,
double sweep) {
// Taken from equations at: http://spaceroots.org/documents/ellipse/node8.html
// and http://www.spaceroots.org/documents/ellipse/node22.html
// Maximum of 45 degrees per cubic Bezier segment
int numSegments = Math.abs((int) Math.ceil(sweep * 4 / Math.PI));
double eta1 = start;
double cosTheta = Math.cos(theta);
double sinTheta = Math.sin(theta);
double cosEta1 = Math.cos(eta1);
double sinEta1 = Math.sin(eta1);
double ep1x = (-a * cosTheta * sinEta1) - (b * sinTheta * cosEta1);
double ep1y = (-a * sinTheta * sinEta1) + (b * cosTheta * cosEta1);
double anglePerSegment = sweep / numSegments;
for (int i = 0; i < numSegments; i++) {
double eta2 = eta1 + anglePerSegment;
double sinEta2 = Math.sin(eta2);
double cosEta2 = Math.cos(eta2);
double e2x = cx + (a * cosTheta * cosEta2) - (b * sinTheta * sinEta2);
double e2y = cy + (a * sinTheta * cosEta2) + (b * cosTheta * sinEta2);
double ep2x = -a * cosTheta * sinEta2 - b * sinTheta * cosEta2;
double ep2y = -a * sinTheta * sinEta2 + b * cosTheta * cosEta2;
double tanDiff2 = Math.tan((eta2 - eta1) / 2);
double alpha = Math.sin(eta2 - eta1) * (Math.sqrt(4 + (3 * tanDiff2 * tanDiff2)) - 1) / 3;
double q1x = e1x + alpha * ep1x;
double q1y = e1y + alpha * ep1y;
double q2x = e2x - alpha * ep2x;
double q2y = e2y - alpha * ep2y;
p.cubicTo((float) q1x, (float) q1y, (float) q2x, (float) q2y, (float) e2x, (float) e2y);
eta1 = eta2;
e1x = e2x;
e1y = e2y;
ep1x = ep2x;
ep1y = ep2y;
}
}
}
}
| 40,161 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Binding.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Binding.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.Context;
import android.util.Log;
import android.util.LruCache;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.Function;
import com.flipkart.android.proteus.FunctionManager;
import com.flipkart.android.proteus.ProteusConstants;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import com.flipkart.android.proteus.toolbox.Result;
import com.flipkart.android.proteus.toolbox.SimpleArrayIterator;
import com.flipkart.android.proteus.toolbox.Utils;
import java.util.Arrays;
import java.util.Iterator;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Binding is a type of {@link Value} which hosts a data binding. Any string that matches the
* pattern {@link #BINDING_PATTERN} is a valid binding. This class also hosts the methods to
* evaluate a binding on a dataset and assign a value on the dataset. A {@code Binding} object is
* immutable.
*
* @author adityasharat
*/
@SuppressWarnings("WeakerAccess")
public abstract class Binding extends Value {
public static final char BINDING_PREFIX_0 = '@';
public static final char BINDING_PREFIX_1 = '{';
public static final char BINDING_SUFFIX = '}';
public static final String INDEX = "$index";
public static final String ARRAY_DATA_LENGTH_REFERENCE = "$length";
public static final String ARRAY_DATA_LAST_INDEX_REFERENCE = "$last";
public static final Pattern BINDING_PATTERN =
Pattern.compile("@\\{fn:(\\S+?)\\(((?:(?<!\\\\)'.*?(?<!\\\\)'|.?)+)\\)\\}|@\\{(.+)\\}");
public static final Pattern FUNCTION_ARGS_DELIMITER =
Pattern.compile(",(?=(?:[^']*'[^']*')*[^']*$)");
public static final String DATA_PATH_DELIMITERS = ".]";
public static final char DELIMITER_OBJECT = '.';
public static final char DELIMITER_ARRAY_OPENING = '[';
public static final char DELIMITER_ARRAY_CLOSING = ']';
/**
* This function does a loose check if a {@code String} should even be considered for evaluation
* as a {@code Binding}. It checks if the 1st and 2nd character are equal to {@link
* #BINDING_PREFIX_0} and {@link #BINDING_PREFIX_1}, and the last character is {@link
* #BINDING_SUFFIX}.
*
* @param value the {@code String} to be tested.
* @return @{@code true} if and only if the prefix and suffix for match the binding pattern else
* {@code false}.
*/
public static boolean isBindingValue(@NonNull final String value) {
return value.length() > 3
&& value.charAt(0) == BINDING_PREFIX_0
&& value.charAt(1) == BINDING_PREFIX_1
&& value.charAt(value.length() - 1) == BINDING_SUFFIX;
}
/**
* This function returns a {@code Binding} object holding the value extracted from the specified
* {@code String}
*
* @param value the value to be parsed.
* @param context the {@link Context} of the caller.
* @param manager the {@link FunctionManager} to evaluate function bindings.
*/
public static Binding valueOf(
@NonNull final String value, ProteusContext context, FunctionManager manager) {
Matcher matcher = BINDING_PATTERN.matcher(value);
if (matcher.find()) {
if (matcher.group(3) != null) { // It is data binding
return DataBinding.valueOf(matcher.group(3));
} else { // It is function binding
return FunctionBinding.valueOf(matcher.group(1), matcher.group(2), context, manager);
}
} else {
throw new IllegalArgumentException(value + " is not a binding");
}
}
/**
* This method evaluates the {@code Binding} on the specified {@link Value} and returns the
* evaluated result. If it is unable to evaluate the {@code Binding} successfully it returns
* {@link Null}.
*
* @param context the {@link Context} of the caller.
* @param data the @{link Value} on which the binding will be evaluated.
* @param index the index to use if the {@code Binding} contains {@link #INDEX} as a token.
* @return the evaluated {@link Value}.
*/
@NonNull
public abstract Value evaluate(ProteusContext context, Value data, int index);
/**
* Returns a {@code String} representation of this {@code Binding}. This string can be parsed back
* into a {@code Binding} object using the function.
*
* @return a string representation of this {@code Binding}.
*/
@NonNull
public abstract String toString();
/**
* Returns a copy of this {@code Binding}, and since {@code Binding} is an immutable this method
* returns the object itself.
*
* @return the same object
*/
@Override
public Binding copy() {
return this;
}
/**
* DataBinding is a type of {@link Binding} which represents a simple data path.
* eg. @{a.b.c}, @{a.e.f[8]}.
*
* @author adityasharat
*/
public static class DataBinding extends Binding {
private static final LruCache<String, DataBinding> DATA_BINDING_CACHE = new LruCache<>(64);
@NonNull private final Token[] tokens;
private DataBinding(@NonNull Token[] tokens) {
this.tokens = tokens;
}
@NonNull
public static DataBinding valueOf(@NonNull String path) {
DataBinding binding = DATA_BINDING_CACHE.get(path);
if (null == binding) {
StringTokenizer tokenizer = new StringTokenizer(path, DATA_PATH_DELIMITERS, true);
Token[] tokens = new Token[0];
String token;
char first;
int length;
while (tokenizer.hasMoreTokens()) {
token = tokenizer.nextToken();
length = token.length();
first = token.charAt(0);
if (length == 1 && first == DELIMITER_OBJECT) {
continue;
}
if (length == 1 && first == DELIMITER_ARRAY_CLOSING) {
tokens = correctPreviousToken(tokens);
continue;
}
tokens = Arrays.copyOf(tokens, tokens.length + 1);
tokens[tokens.length - 1] = new Token(token, false, false);
}
binding = new DataBinding(tokens);
DATA_BINDING_CACHE.put(path, binding);
}
return binding;
}
private static void assign(
Token[] tokens, @NonNull Value value, @NonNull Value data, int dataIndex) {
Value current = data;
Token token;
int index = dataIndex;
for (int i = 0; i < tokens.length - 1; i++) {
token = tokens[i];
if (token.isArrayIndex) {
try {
index = getArrayIndex(token.value, dataIndex);
} catch (NumberFormatException e) {
return;
}
current = getArrayItem(current.getAsArray(), index, token.isArray);
} else if (token.isArray) {
current = getArray(current, token.value, index);
} else {
current = getObject(current, token, index);
}
}
token = tokens[tokens.length - 1];
if (token.isArrayIndex) {
try {
index = getArrayIndex(token.value, dataIndex);
} catch (NumberFormatException e) {
return;
}
getArrayItem(current.getAsArray(), index, false);
current.getAsArray().remove(index);
current.getAsArray().add(index, value);
} else {
current.getAsObject().add(token.value, value);
}
}
@NonNull
private static Value getObject(Value parent, Token token, int index) {
Value temp;
ObjectValue object;
if (parent.isArray()) {
temp = parent.getAsArray().get(index);
if (temp != null && temp.isObject()) {
object = temp.getAsObject();
} else {
object = new ObjectValue();
parent.getAsArray().remove(index);
parent.getAsArray().add(index, object);
}
} else {
temp = parent.getAsObject().get(token.value);
if (temp != null && temp.isObject()) {
object = temp.getAsObject();
} else {
object = new ObjectValue();
parent.getAsObject().add(token.value, object);
}
}
return object;
}
@NonNull
private static Array getArray(Value parent, String token, int index) {
Value temp;
Array array;
if (parent.isArray()) {
temp = parent.getAsArray().get(index);
if (temp != null && temp.isArray()) {
array = temp.getAsArray();
} else {
array = new Array();
parent.getAsArray().remove(index);
parent.getAsArray().add(index, array);
}
} else {
temp = parent.getAsObject().get(token);
if (temp != null && temp.isArray()) {
array = temp.getAsArray();
} else {
array = new Array();
parent.getAsObject().add(token, array);
}
}
return array;
}
@NonNull
private static Value getArrayItem(Array array, int index, boolean isArray) {
if (index >= array.size()) {
while (array.size() < index) {
array.add(Null.INSTANCE);
}
if (isArray) {
array.add(new Array());
} else {
array.add(new ObjectValue());
}
}
return array.get(index);
}
private static int getArrayIndex(@NonNull String token, int dataIndex)
throws NumberFormatException {
int index;
if (INDEX.equals(token)) {
index = dataIndex;
} else {
index = Integer.parseInt(token);
}
return index;
}
@NonNull
private static Token[] correctPreviousToken(Token[] tokens) {
Token previous = tokens[tokens.length - 1];
int index = previous.value.indexOf(DELIMITER_ARRAY_OPENING);
String prefix = previous.value.substring(0, index);
String suffix = previous.value.substring(index + 1, previous.value.length());
if (prefix.equals(ProteusConstants.EMPTY)) {
Token token = tokens[tokens.length - 1];
tokens[tokens.length - 1] = new Token(token.value, true, false);
} else {
tokens[tokens.length - 1] = new Token(prefix, true, false);
}
tokens = Arrays.copyOf(tokens, tokens.length + 1);
tokens[tokens.length - 1] = new Token(suffix, false, true);
return tokens;
}
@NonNull
private static Result resolve(Token[] tokens, Value data, int index) {
// replace INDEX with index value
if (tokens.length == 1 && INDEX.equals(tokens[0].value)) {
return Result.success(new Primitive(String.valueOf(index)));
} else {
Value elementToReturn = data;
Value tempElement;
Array tempArray;
for (int i = 0; i < tokens.length; i++) {
String segment = tokens[i].value;
if (elementToReturn == null) {
return Result.NO_SUCH_DATA_PATH_EXCEPTION;
}
if (elementToReturn.isNull()) {
return Result.NULL_EXCEPTION;
}
if ("".equals(segment)) {
continue;
}
if (elementToReturn.isArray()) {
tempArray = elementToReturn.getAsArray();
if (INDEX.equals(segment)) {
if (index < tempArray.size()) {
elementToReturn = tempArray.get(index);
} else {
return Result.NO_SUCH_DATA_PATH_EXCEPTION;
}
} else if (ARRAY_DATA_LENGTH_REFERENCE.equals(segment)) {
elementToReturn = new Primitive(tempArray.size());
} else if (ARRAY_DATA_LAST_INDEX_REFERENCE.equals(segment)) {
if (tempArray.size() == 0) {
return Result.NO_SUCH_DATA_PATH_EXCEPTION;
}
elementToReturn = tempArray.get(tempArray.size() - 1);
} else {
try {
index = Integer.parseInt(segment);
} catch (NumberFormatException e) {
return Result.INVALID_DATA_PATH_EXCEPTION;
}
if (index < tempArray.size()) {
elementToReturn = tempArray.get(index);
} else {
return Result.NO_SUCH_DATA_PATH_EXCEPTION;
}
}
} else if (elementToReturn.isObject()) {
tempElement = elementToReturn.getAsObject().get(segment);
if (tempElement != null) {
elementToReturn = tempElement;
} else {
return Result.NO_SUCH_DATA_PATH_EXCEPTION;
}
} else if (elementToReturn.isPrimitive()) {
return Result.INVALID_DATA_PATH_EXCEPTION;
} else {
return Result.NO_SUCH_DATA_PATH_EXCEPTION;
}
}
if (elementToReturn.isNull()) {
return Result.NULL_EXCEPTION;
}
return Result.success(elementToReturn);
}
}
@NonNull
@Override
public Value evaluate(ProteusContext context, Value data, int index) {
Result result = resolve(tokens, data, index);
return result.isSuccess() ? result.value : Null.INSTANCE;
}
@NonNull
@Override
public String toString() {
//noinspection StringBufferReplaceableByString
return new StringBuilder()
.append(BINDING_PREFIX_0)
.append(BINDING_PREFIX_1)
.append(Utils.join(Token.getValues(tokens), String.valueOf(DELIMITER_OBJECT)))
.append(BINDING_SUFFIX)
.toString();
}
public Iterator<Token> getTokens() {
return new SimpleArrayIterator<>(this.tokens);
}
public void assign(Value value, Value data, int index) {
assign(tokens, value, data, index);
}
}
/**
* FunctionBinding is a type of {@link Binding} which represents a function call. eg. @{
* fn:add(1,2) }, @{ fn:and(@{a.b}, @{a.c}) }. The format is @{ fn<name>:(<arguments>) },
* where <name> is the name of the function and <arguments> is are comma separated
* arguments. Note that the arguments can be values (strings should be in single quotes) or {@link
* DataBinding} but NOT {@code FunctionBinding}.
*
* @author adityasharat
*/
public static class FunctionBinding extends Binding {
@NonNull public final Function function;
@Nullable private final Value[] arguments;
public FunctionBinding(@NonNull Function function, @Nullable Value[] arguments) {
this.arguments = arguments;
this.function = function;
}
public static FunctionBinding valueOf(
@NonNull String name,
@NonNull String args,
ProteusContext context,
@NonNull FunctionManager manager) {
Function function = manager.get(name);
String[] tokens = FUNCTION_ARGS_DELIMITER.split(args);
Value[] arguments = new Value[tokens.length];
String token;
Value resolved;
for (int i = 0; i < tokens.length; i++) {
token = tokens[i].trim();
if (!token.isEmpty() && token.charAt(0) == '\'') {
token = token.substring(1, token.length() - 1);
resolved = new Primitive(token);
} else {
resolved = AttributeProcessor.staticPreCompile(new Primitive(token), context, manager);
}
arguments[i] = resolved != null ? resolved : new Primitive(token);
}
return new FunctionBinding(function, arguments);
}
private static Value[] resolve(ProteusContext context, Value[] in, Value data, int index) {
//noinspection ConstantConditions because we want it to crash, it is an illegal state anyway
Value[] out = new Value[in.length];
for (int i = 0; i < in.length; i++) {
out[i] = AttributeProcessor.evaluate(context, null, in[i], data, index);
}
return out;
}
public Iterator<Value> getTokens() {
return new SimpleArrayIterator<>(this.arguments);
}
@NonNull
@Override
public Value evaluate(ProteusContext context, Value data, int index) {
Value[] arguments = resolve(context, this.arguments, data, index);
try {
return this.function.call(context, data, index, arguments);
} catch (Exception e) {
if (ProteusConstants.isLoggingEnabled()) {
Log.e(Utils.LIB_NAME, e.getMessage(), e);
}
return Null.INSTANCE;
}
}
@NonNull
@Override
public String toString() {
return String.format(
"@{fn:%s(%s)}", function.getName(), Utils.join(arguments, ",", Utils.STYLE_SINGLE));
}
}
public static class Token {
@NonNull public final String value;
public final boolean isArray;
public final boolean isArrayIndex;
public final boolean isBinding = false;
public Token(@NonNull String value, boolean isArray, boolean isArrayIndex) {
this.value = value;
this.isArray = isArray;
this.isArrayIndex = isArrayIndex;
}
public static String[] getValues(Token[] tokens) {
String[] values = new String[tokens.length];
for (int i = 0; i < tokens.length; i++) {
values[i] = tokens[i].value;
}
return values;
}
}
}
| 17,707 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Primitive.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Primitive.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import com.flipkart.android.proteus.toolbox.LazilyParsedNumber;
import java.math.BigInteger;
/**
* Primitive
*
* @author aditya.sharat
*/
public class Primitive extends Value {
private static final Class<?>[] PRIMITIVE_TYPES = {
int.class,
long.class,
short.class,
float.class,
double.class,
byte.class,
boolean.class,
char.class,
Integer.class,
Long.class,
Short.class,
Float.class,
Double.class,
Byte.class,
Boolean.class,
Character.class
};
private java.lang.Object value;
/**
* Create a primitive containing a boolean value.
*
* @param bool the value to create the primitive with.
*/
public Primitive(Boolean bool) {
setValue(bool);
}
/**
* Create a primitive containing a {@link Number}.
*
* @param number the value to create the primitive with.
*/
public Primitive(Number number) {
setValue(number);
}
/**
* Create a primitive containing a String value.
*
* @param string the value to create the primitive with.
*/
public Primitive(String string) {
setValue(string);
}
/**
* Create a primitive containing a character. The character is turned into a one character String.
*
* @param c the value to create the primitive with.
*/
public Primitive(Character c) {
setValue(c);
}
/**
* Create a primitive using the specified ObjectValue. It must be an instance of {@link Number}, a
* Java primitive type, or a String.
*
* @param primitive the value to create the primitive with.
*/
Primitive(java.lang.Object primitive) {
setValue(primitive);
}
static boolean isPrimitiveOrString(java.lang.Object target) {
if (target instanceof String) {
return true;
}
Class<?> classOfPrimitive = target.getClass();
for (Class<?> standardPrimitive : PRIMITIVE_TYPES) {
if (standardPrimitive.isAssignableFrom(classOfPrimitive)) {
return true;
}
}
return false;
}
/**
* Returns true if the specified number is an integral type (Long, Integer, Short, Byte,
* BigInteger)
*/
private static boolean isIntegral(Primitive primitive) {
if (primitive.value instanceof Number) {
Number number = (Number) primitive.value;
return number instanceof BigInteger
|| number instanceof Long
|| number instanceof Integer
|| number instanceof Short
|| number instanceof Byte;
}
return false;
}
@Override
public Primitive copy() {
return this;
}
void setValue(java.lang.Object primitive) {
if (primitive instanceof Character) {
char c = (Character) primitive;
this.value = String.valueOf(c);
} else {
if (!(primitive instanceof Number || isPrimitiveOrString(primitive))) {
throw new IllegalArgumentException();
}
this.value = primitive;
}
}
/**
* Check whether this primitive contains a boolean value.
*
* @return true if this primitive contains a boolean value, false otherwise.
*/
public boolean isBoolean() {
return value instanceof Boolean;
}
/**
* convenience method to get this value as a {@link Boolean}.
*
* @return get this value as a {@link Boolean}.
*/
Boolean getAsBooleanWrapper() {
return (Boolean) value;
}
/**
* convenience method to get this value as a boolean value.
*
* @return get this value as a primitive boolean value.
*/
@Override
public boolean getAsBoolean() {
if (isBoolean()) {
return getAsBooleanWrapper();
} else {
// Check to see if the value as a String is "true" in any case.
return Boolean.parseBoolean(getAsString());
}
}
/**
* Check whether this primitive contains a Number.
*
* @return true if this primitive contains a Number, false otherwise.
*/
public boolean isNumber() {
return value instanceof Number;
}
/**
* convenience method to get this value as a Number.
*
* @return get this value as a Number.
* @throws NumberFormatException if the value contained is not a valid Number.
*/
public Number getAsNumber() {
return value instanceof String ? new LazilyParsedNumber((String) value) : (Number) value;
}
/**
* Check whether this primitive contains a String value.
*
* @return true if this primitive contains a String value, false otherwise.
*/
public boolean isString() {
return value instanceof String;
}
/**
* convenience method to get this value as a String.
*
* @return get this value as a String.
*/
@Override
public String getAsString() {
if (isNumber()) {
return getAsNumber().toString();
} else if (isBoolean()) {
return getAsBooleanWrapper().toString();
} else {
return (String) value;
}
}
/**
* convenience method to get this value as a primitive double.
*
* @return get this value as a primitive double.
* @throws NumberFormatException if the value contained is not a valid double.
*/
@Override
public double getAsDouble() {
return isNumber() ? getAsNumber().doubleValue() : Double.parseDouble(getAsString());
}
/**
* convenience method to get this value as a float.
*
* @return get this value as a float.
* @throws NumberFormatException if the value contained is not a valid float.
*/
@Override
public float getAsFloat() {
return isNumber() ? getAsNumber().floatValue() : Float.parseFloat(getAsString());
}
/**
* convenience method to get this value as a primitive long.
*
* @return get this value as a primitive long.
* @throws NumberFormatException if the value contained is not a valid long.
*/
@Override
public long getAsLong() {
return isNumber() ? getAsNumber().longValue() : Long.parseLong(getAsString());
}
/**
* convenience method to get this value as a primitive integer.
*
* @return get this value as a primitive integer.
* @throws NumberFormatException if the value contained is not a valid integer.
*/
@Override
public int getAsInt() {
return isNumber() ? getAsNumber().intValue() : Integer.parseInt(getAsString());
}
@Override
public char getAsCharacter() {
return getAsString().charAt(0);
}
@Override
public int hashCode() {
if (value == null) {
return 31;
}
// Using recommended hashing algorithm from Effective Java for longs and doubles
if (isIntegral(this)) {
long value = getAsNumber().longValue();
return (int) (value ^ (value >>> 32));
}
if (value instanceof Number) {
long value = Double.doubleToLongBits(getAsNumber().doubleValue());
return (int) (value ^ (value >>> 32));
}
return value.hashCode();
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
Primitive other = (Primitive) obj;
if (value == null) {
return other.value == null;
}
if (isIntegral(this) && isIntegral(other)) {
return getAsNumber().longValue() == other.getAsNumber().longValue();
}
if (value instanceof Number && other.value instanceof Number) {
double a = getAsNumber().doubleValue();
// Java standard types other than double return true for two NaN. So, need
// special handling for double.
double b = other.getAsNumber().doubleValue();
return a == b || (Double.isNaN(a) && Double.isNaN(b));
}
return value.equals(other.value);
}
@Override
public String toString() {
return getAsString();
}
public String getAsSingleQuotedString() {
return '\'' + getAsString() + '\'';
}
public String getAsDoubleQuotedString() {
return '\"' + getAsString() + '\"';
}
}
| 8,484 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Style.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Style.java | package com.flipkart.android.proteus.value;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.ProteusContext;
import com.flipkart.android.proteus.ProteusView;
import com.flipkart.android.proteus.processor.AttributeProcessor;
import com.flipkart.android.proteus.toolbox.ProteusHelper;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class Style extends Value {
private static final String STYLE_PREFIX = "@style/";
private final String name;
/** The name of the parent of this style */
private final String parent;
private final ObjectValue values = new ObjectValue();
public Style(@NonNull String name) {
this.name = name;
this.parent = null;
}
public Style(@NonNull String name, @Nullable String parent) {
this.name = name;
this.parent = parent;
}
/**
* Return whether a string value from xml is a style value This checks whether the string starts
* with {@code @style/}
*/
public static boolean isStyle(@NonNull String string) {
return string.startsWith(STYLE_PREFIX);
}
public static Value valueOf(String string, ProteusContext context) {
return context.getProteusResources().getStyle(string);
}
/**
* Get the the value from this style using its name
*
* @param name the name of the attribute
* @param defaultValue the value returned if the attribute does not exist
* @return the value corresponding to the name given
*/
@Nullable
public Value getValue(@NonNull String name, @Nullable Value defaultValue) {
Value value = values.get(name);
if (value != null) {
return value;
}
return defaultValue;
}
@Nullable
public Value getValue(@NonNull String name, ProteusContext context, @Nullable Value def) {
Style style = this;
while (style != null) {
Value value = style.getValue(name, null);
if (value != null) {
return value;
}
if (style.parent == null) {
style = null;
} else {
style = context.getStyle(style.parent);
}
}
return def;
}
public void applyStyle(View parent, ProteusView view, boolean b) {
ProteusView.Manager viewManager = view.getViewManager();
ProteusContext context = viewManager.getContext();
ObjectValue allValues = getAllValues(context);
for (Map.Entry<String, Value> entry : allValues.entrySet()) {
int id = ProteusHelper.getAttributeId(view, entry.getKey());
if (id == -1) {
id = ProteusHelper.getAttributeId(view, "app:" + entry.getKey());
}
if (id != -1) {
Value value = entry.getValue();
if (value.isPrimitive()) {
value =
AttributeProcessor.staticPreCompile(
value.getAsPrimitive(), context, context.getFunctionManager());
}
if (value == null) {
value = entry.getValue();
}
viewManager.getViewTypeParser().handleAttribute(parent, (View) view, id, value);
}
}
if (b) {
if (viewManager.getStyle() == null) {
viewManager.setStyle(this);
} else {
// ObjectValue styleValues = viewManager.getStyle().getValues();
// for (Map.Entry<String, Value> entry : this.getValues().entrySet()) {
// if (!styleValues.has(entry.getKey())) {
// styleValues.add(entry.getKey(), entry.getValue());
// }
// }
}
}
}
public void applyTheme(View parent, ProteusView view, boolean setTheme) {
ProteusView.Manager viewManager = view.getViewManager();
ProteusContext context = viewManager.getContext();
Set<Integer> handledAttributes = new HashSet<>();
if (setTheme) {
viewManager.setTheme(this);
}
Style style = this;
while (style != null) {
ObjectValue values = style.getValues();
for (Map.Entry<String, Value> entry : values.entrySet()) {
int id = ProteusHelper.getAttributeId(view, entry.getKey());
if (id == -1) {
id = ProteusHelper.getAttributeId(view, "app:" + entry.getKey());
}
if (id != -1) {
Value value = entry.getValue();
if (value.isPrimitive()) {
value =
AttributeProcessor.staticPreCompile(
value.getAsPrimitive(), context, context.getFunctionManager());
}
if (value == null) {
value = entry.getValue();
}
if (entry.getKey().equals("materialThemeOverlay")) {
System.out.println(value);
}
if (!handledAttributes.contains(id)) {
if (viewManager
.getViewTypeParser()
.handleAttribute(parent, view.getAsView(), id, value)) {
handledAttributes.add(id);
}
}
}
}
if (style.parent != null) {
style = context.getStyle(style.parent);
} else {
style = null;
}
}
}
/**
* Apply the attributes of this style to a {@link ProteusView} It will also apply the attributes
* of the parent theme if it has one
*
* @param parent
* @param view the view to apply the styles to
*/
public void applyTheme(View parent, ProteusView view) {
applyTheme(parent, view, false);
}
/**
* Add an attribute for this style
*
* @param name the name of the attribute
* @param value the value of the attribute
*/
public void addValue(String name, String value) {
values.addProperty(name, value);
}
public void addValue(String name, @NonNull Value value) {
values.addProperty(name, value.toString());
}
public ObjectValue getValues() {
return values;
}
public ObjectValue getAllValues(ProteusContext context) {
ObjectValue values = new ObjectValue();
Style current = this;
while (current != null) {
ObjectValue currentValues = current.getValues();
for (Map.Entry<String, Value> entry : currentValues.entrySet()) {
if (!values.has(entry.getKey())) {
values.add(entry.getKey(), entry.getValue());
}
}
if (current.parent != null) {
current = context.getStyle(current.parent);
} else {
current = null;
}
}
return values;
}
@Override
public String toString() {
return "Style{"
+ "name='"
+ name
+ '\''
+ ", parent='"
+ parent
+ '\''
+ ", values="
+ values
+ '}';
}
@Override
public Value copy() {
return new Style(this.name, this.parent);
}
}
| 6,735 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Value.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Value.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
/**
* Value
*
* @author aditya.sharat
*/
public abstract class Value {
/**
* Returns a deep copy of this value. Immutable elements like primitives and nulls are not copied.
*/
public abstract Value copy();
/**
* provides check for verifying if this value is an array or not.
*
* @return true if this value is of type {@link Array}, false otherwise.
*/
public boolean isArray() {
return this instanceof Array;
}
/**
* provides check for verifying if this value is a object or not.
*
* @return true if this value is of type {@link ObjectValue}, false otherwise.
*/
public boolean isObject() {
return this instanceof ObjectValue;
}
/**
* provides check for verifying if this value is a primitive or not.
*
* @return true if this value is of type {@link Primitive}, false otherwise.
*/
public boolean isPrimitive() {
return this instanceof Primitive;
}
/**
* provides check for verifying if this value represents a null value or not.
*
* @return true if this value is of type {@link Null}, false otherwise.
* @since 1.2
*/
public boolean isNull() {
return this instanceof Null;
}
/**
* @return
*/
public boolean isLayout() {
return this instanceof Layout;
}
/**
* @return
*/
public boolean isDimension() {
return this instanceof Dimension;
}
/**
* @return
*/
public boolean isStyleResource() {
return this instanceof StyleResource;
}
public boolean isStyle() {
return this instanceof Style;
}
/**
* @return
*/
public boolean isColor() {
return this instanceof Color;
}
/**
* @return
*/
public boolean isAttributeResource() {
return this instanceof AttributeResource;
}
/**
* @return
*/
public boolean isResource() {
return this instanceof Resource;
}
/**
* @return
*/
public boolean isBinding() {
return this instanceof Binding;
}
/**
* @return
*/
public boolean isDrawable() {
return this instanceof DrawableValue;
}
/**
* convenience method to get this value as a {@link ObjectValue}. If the value is of some other
* type, a {@link IllegalStateException} will result. Hence it is best to use this method after
* ensuring that this value is of the desired type by calling {@link #isObject()} first.
*
* @return get this value as a {@link ObjectValue}.
* @throws IllegalStateException if the value is of another type.
*/
public ObjectValue getAsObject() {
if (isObject()) {
return (ObjectValue) this;
}
throw new IllegalStateException("Not an ObjectValue: " + this);
}
/**
* convenience method to get this value as a {@link Array}. If the value is of some other type, a
* {@link IllegalStateException} will result. Hence it is best to use this method after ensuring
* that this value is of the desired type by calling {@link #isArray()} first.
*
* @return get this value as a {@link Array}.
* @throws IllegalStateException if the value is of another type.
*/
public Array getAsArray() {
if (isArray()) {
return (Array) this;
}
throw new IllegalStateException("This is not a Array.");
}
/**
* convenience method to get this value as a {@link Primitive}. If the value is of some other
* type, a {@link IllegalStateException} will result. Hence it is best to use this method after
* ensuring that this value is of the desired type by calling {@link #isPrimitive()} first.
*
* @return get this value as a {@link Primitive}.
* @throws IllegalStateException if the value is of another type.
*/
public Primitive getAsPrimitive() {
if (isPrimitive()) {
return (Primitive) this;
}
throw new IllegalStateException("This is not a Primitive.");
}
/**
* convenience method to get this value as a {@link Null}. If the value is of some other type, a
* {@link IllegalStateException} will result. Hence it is best to use this method after ensuring
* that this value is of the desired type by calling {@link #isNull()} first.
*
* @return get this value as a {@link Null}.
* @throws IllegalStateException if the value is of another type.
* @since 1.2
*/
public Null getAsNull() {
if (isNull()) {
return (Null) this;
}
throw new IllegalStateException("This is not a Null.");
}
/**
* @return
*/
public Layout getAsLayout() {
if (isLayout()) {
return (Layout) this;
}
throw new IllegalStateException("Not a Layout: " + this);
}
/**
* @return
*/
public Dimension getAsDimension() {
if (isDimension()) {
return (Dimension) this;
}
throw new IllegalStateException("Not a Dimension: " + this);
}
/**
* @return
*/
public StyleResource getAsStyleResource() {
if (isStyleResource()) {
return (StyleResource) this;
}
throw new IllegalStateException("Not a StyleResource: " + this);
}
public Style getAsStyle() {
if (isStyle()) {
return (Style) this;
}
throw new IllegalStateException("Not a StyleResource: " + this);
}
/**
* @return
*/
public AttributeResource getAsAttributeResource() {
if (isAttributeResource()) {
return (AttributeResource) this;
}
throw new IllegalStateException("Not a Resource: " + this);
}
/**
* @return
*/
public Color getAsColor() {
if (isColor()) {
return (Color) this;
}
throw new IllegalStateException("Not a ColorValue: " + this);
}
/**
* @return
*/
public Resource getAsResource() {
if (isResource()) {
return (Resource) this;
}
throw new IllegalStateException("Not a Resource: " + this);
}
/**
* @return
*/
public Binding getAsBinding() {
if (isBinding()) {
return (Binding) this;
}
throw new IllegalStateException("Not a Binding: " + this);
}
/**
* @return
*/
public DrawableValue getAsDrawable() {
if (isDrawable()) {
return (DrawableValue) this;
}
throw new IllegalStateException("Not a Drawable: " + this);
}
/**
* convenience method to get this value as a boolean value.
*
* @return get this value as a primitive boolean value.
* @throws ClassCastException if the value is of not a {@link Primitive} and is not a valid
* boolean value.
*/
public boolean getAsBoolean() {
throw new UnsupportedOperationException(getClass().getSimpleName());
}
/**
* convenience method to get this value as a string value.
*
* @return get this value as a string value.
* @throws ClassCastException if the value is of not a {@link Primitive} and is not a valid string
* value.
*/
public String getAsString() {
throw new UnsupportedOperationException(getClass().getSimpleName());
}
/**
* convenience method to get this value as a primitive double value.
*
* @return get this value as a primitive double value.
* @throws ClassCastException if the value is of not a {@link Primitive} and is not a valid double
* value.
*/
public double getAsDouble() {
throw new UnsupportedOperationException(getClass().getSimpleName());
}
/**
* convenience method to get this value as a primitive float value.
*
* @return get this value as a primitive float value.
* @throws ClassCastException if the value is of not a {@link Primitive} and is not a valid float
* value.
*/
public float getAsFloat() {
throw new UnsupportedOperationException(getClass().getSimpleName());
}
/**
* convenience method to get this value as a primitive long value.
*
* @return get this value as a primitive long value.
* @throws ClassCastException if the value is of not a {@link Primitive} and is not a valid long
* value.
*/
public long getAsLong() {
throw new UnsupportedOperationException(getClass().getSimpleName());
}
/**
* convenience method to get this value as a primitive integer value.
*
* @return get this value as a primitive integer value.
* @throws ClassCastException if the value is of not a {@link Primitive} and is not a valid
* integer value.
*/
public int getAsInt() {
throw new UnsupportedOperationException(getClass().getSimpleName());
}
/**
* convenience method to get this value as a primitive character value.
*
* @return get this value as a primitive char value.
* @throws ClassCastException if the value is of not a {@link Primitive} and is not a valid char
* value.
*/
public char getAsCharacter() {
throw new UnsupportedOperationException(getClass().getSimpleName());
}
}
| 9,344 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
StyleResource.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/StyleResource.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.LruCache;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.flipkart.android.proteus.ProteusConstants;
import java.util.HashMap;
import java.util.Map;
/**
* StyleResource
*
* @author aditya.sharat
*/
public class StyleResource extends Value {
public static final StyleResource NULL = new StyleResource(-1, -1);
private static final Map<String, Integer> styleMap = new HashMap<>();
private static final Map<String, Integer> attributeMap = new HashMap<>();
private static final Map<String, Class> sHashMap = new HashMap<>();
private static final String ATTR_START_LITERAL = "?";
public final int styleId;
public final int attributeId;
private StyleResource(String value, Context context)
throws IllegalArgumentException,
NoSuchFieldException,
IllegalAccessException,
ClassNotFoundException {
String[] tokens = value.substring(1).split(":");
String style = tokens[0];
String attr = tokens[1];
Class clazz;
Integer styleId = styleMap.get(style);
if (styleId == null) {
String className = context.getPackageName() + ".R$style";
clazz = sHashMap.get(className);
if (null == clazz) {
clazz = Class.forName(className);
sHashMap.put(className, clazz);
}
styleId = clazz.getField(style).getInt(null);
styleMap.put(style, styleId);
}
this.styleId = styleId;
Integer attrId = attributeMap.get(attr);
if (attrId == null) {
String className = context.getPackageName() + ".R$attr";
clazz = sHashMap.get(className);
if (null == clazz) {
clazz = Class.forName(className);
sHashMap.put(className, clazz);
}
attrId = clazz.getField(attr).getInt(null);
attributeMap.put(attr, attrId);
}
this.attributeId = attrId;
}
private StyleResource(int styleId, int attributeId) {
this.styleId = styleId;
this.attributeId = attributeId;
}
public static boolean isStyleResource(String value) {
return value.startsWith(ATTR_START_LITERAL);
}
@Nullable
public static StyleResource valueOf(String value, Context context) {
StyleResource style = StyleCache.cache.get(value);
if (null == style) {
try {
style = new StyleResource(value, context);
} catch (Exception e) {
if (ProteusConstants.isLoggingEnabled()) {
e.printStackTrace();
}
style = NULL;
}
StyleCache.cache.put(value, style);
}
return NULL == style ? null : style;
}
@NonNull
public static StyleResource valueOf(int styleId, int attributeId) {
return new StyleResource(styleId, attributeId);
}
public TypedArray apply(Context context) {
return context.obtainStyledAttributes(styleId, new int[] {attributeId});
}
@Override
public Value copy() {
return this;
}
private static class StyleCache {
static final LruCache<String, StyleResource> cache = new LruCache<>(64);
}
}
| 3,743 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Null.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Null.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import com.flipkart.android.proteus.ProteusConstants;
/**
* Null
*
* @author aditya.sharat
*/
public class Null extends Value {
/**
* singleton for JsonNull
*
* @since 1.8
*/
public static final Null INSTANCE = new Null();
private static final String NULL_STRING = "NULL";
@Override
public Null copy() {
return INSTANCE;
}
@Override
public String toString() {
return NULL_STRING;
}
@Override
public String getAsString() {
return ProteusConstants.EMPTY;
}
/** All instances of Null have the same hash code since they are indistinguishable */
@Override
public int hashCode() {
return Null.class.hashCode();
}
/** All instances of JsonNull are the same */
@Override
public boolean equals(java.lang.Object other) {
return this == other || other instanceof Null;
}
}
| 1,502 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Gravity.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Gravity.java | package com.flipkart.android.proteus.value;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.parser.ParseHelper;
import java.util.HashMap;
import java.util.Map;
public class Gravity extends Value {
private static final Map<Integer, String> GRAVITY_VALUES = new HashMap<>();
static {
GRAVITY_VALUES.put(android.view.Gravity.LEFT, "left");
GRAVITY_VALUES.put(android.view.Gravity.RIGHT, "right");
GRAVITY_VALUES.put(android.view.Gravity.TOP, "top");
GRAVITY_VALUES.put(android.view.Gravity.BOTTOM, "bottom");
GRAVITY_VALUES.put(android.view.Gravity.START, "start");
GRAVITY_VALUES.put(android.view.Gravity.END, "end");
GRAVITY_VALUES.put(android.view.Gravity.CENTER, "center");
GRAVITY_VALUES.put(android.view.Gravity.CENTER_HORIZONTAL, "center_horizontal");
GRAVITY_VALUES.put(android.view.Gravity.CENTER_VERTICAL, "center_vertical");
}
private final int gravity;
public static boolean isGravity(String string) {
try {
int gravity = ParseHelper.parseGravity(string);
return gravity != android.view.Gravity.NO_GRAVITY;
} catch (Throwable e) {
return false;
}
}
public Gravity(int gravity) {
this.gravity = gravity;
}
public static Gravity of(int value) {
return new Gravity(value);
}
@Override
public String getAsString() {
StringBuilder sb = new StringBuilder();
GRAVITY_VALUES.forEach(
(k, v) -> {
if ((gravity & k) == k) {
sb.append(v);
sb.append("|");
}
});
return sb.substring(0, sb.length() - 1);
}
@Override
public int getAsInt() {
return gravity;
}
@NonNull
@Override
public String toString() {
return getAsString();
}
@Override
public Value copy() {
return new Gravity(gravity);
}
}
| 1,830 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Array.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/value/Array.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.value;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
/**
* Array
*
* @author aditya.sharat
*/
public class Array extends Value {
private final List<Value> values;
/** Creates an empty Array. */
public Array() {
values = new ArrayList<>();
}
public Array(Value[] values) {
this.values = Arrays.asList(values);
}
/** Creates an empty Array with a given capacity. */
public Array(int capacity) {
values = new ArrayList<>(capacity);
}
@Override
public Array copy() {
Array result = new Array(values.size());
for (Value value : values) {
result.add(value.copy());
}
return result;
}
/**
* Adds the specified boolean to self.
*
* @param bool the boolean that needs to be added to the array.
*/
public void add(@Nullable Boolean bool) {
values.add(bool == null ? Null.INSTANCE : new Primitive(bool));
}
/**
* Adds the specified character to self.
*
* @param character the character that needs to be added to the array.
*/
public void add(@Nullable Character character) {
values.add(character == null ? Null.INSTANCE : new Primitive(character));
}
/**
* Adds the specified number to self.
*
* @param number the number that needs to be added to the array.
*/
public void add(@Nullable Number number) {
values.add(number == null ? Null.INSTANCE : new Primitive(number));
}
/**
* Adds the specified string to self.
*
* @param string the string that needs to be added to the array.
*/
public void add(@Nullable String string) {
values.add(string == null ? Null.INSTANCE : new Primitive(string));
}
/**
* Adds the specified value to self.
*
* @param value the value that needs to be added to the array.
*/
public void add(@Nullable Value value) {
if (value == null) {
value = Null.INSTANCE;
}
values.add(value);
}
/**
* Adds the specified value to self.
*
* @param value the value that needs to be added to the array.
*/
public void add(int position, @Nullable Value value) {
if (value == null) {
value = Null.INSTANCE;
}
values.add(position, value);
}
/**
* Adds all the values of the specified array to self.
*
* @param array the array whose values need to be added to the array.
*/
public void addAll(@NonNull Array array) {
values.addAll(array.values);
}
/**
* Replaces the value at the specified position in this array with the specified value. value can
* be null.
*
* @param index index of the value to replace
* @param value value to be stored at the specified position
* @return the value previously at the specified position
* @throws IndexOutOfBoundsException if the specified index is outside the array bounds
*/
public Value set(int index, @NonNull Value value) {
return values.set(index, value);
}
/**
* Removes the first occurrence of the specified value from this array, if it is present. If the
* array does not contain the value, it is unchanged.
*
* @param value value to be removed from this array, if present
* @return true if this array contained the specified value, false otherwise
* @since 2.3
*/
public boolean remove(@NonNull Value value) {
return values.remove(value);
}
/**
* Removes the value at the specified position in this array. Shifts any subsequent values to the
* left (subtracts one from their indices). Returns the value that was removed from the array.
*
* @param index index the index of the value to be removed
* @return the value previously at the specified position
* @throws IndexOutOfBoundsException if the specified index is outside the array bounds
* @since 2.3
*/
public Value remove(int index) {
return values.remove(index);
}
/**
* Returns true if this array contains the specified value.
*
* @param value whose presence in this array is to be tested
* @return true if this array contains the specified value.
* @since 2.3
*/
public boolean contains(@NonNull Value value) {
return values.contains(value);
}
/**
* Returns the number of values in the array.
*
* @return the number of values in the array.
*/
public int size() {
return values.size();
}
/**
* Returns an iterator to navigate the values of the array. Since the array is an ordered list,
* the iterator navigates the values in the order they were inserted.
*
* @return an iterator to navigate the values of the array.
*/
public Iterator<Value> iterator() {
return values.iterator();
}
/**
* Returns the ith value of the array.
*
* @param i the index of the value that is being sought.
* @return the value present at the ith index.
* @throws IndexOutOfBoundsException if i is negative or greater than or equal to the {@link
* #size()} of the array.
*/
public Value get(int i) {
return values.get(i);
}
@NonNull
@Override
public String toString() {
String items = values.stream().map(Value::toString).collect(Collectors.joining(", "));
return "[" + items + "]";
}
@Override
public boolean equals(java.lang.Object o) {
return (o == this) || (o instanceof Array && ((Array) o).values.equals(values));
}
@Override
public int hashCode() {
return values.hashCode();
}
}
| 6,191 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusAspectRatioFrameLayout.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/view/ProteusAspectRatioFrameLayout.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.view;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.ProteusView;
/**
* AspectRatioFrameLayout
*
* @author aditya.sharat
*/
public class ProteusAspectRatioFrameLayout
extends com.flipkart.android.proteus.view.custom.AspectRatioFrameLayout implements ProteusView {
private Manager viewManager;
public ProteusAspectRatioFrameLayout(Context context) {
super(context);
}
public ProteusAspectRatioFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ProteusAspectRatioFrameLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public ProteusAspectRatioFrameLayout(
Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public Manager getViewManager() {
return viewManager;
}
@Override
public void setViewManager(@NonNull Manager manager) {
this.viewManager = manager;
}
@NonNull
@Override
public View getAsView() {
return this;
}
}
| 1,941 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusEditText.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/view/ProteusEditText.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.view;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.ProteusView;
/**
* EditText
*
* @author aditya.sharat
*/
public class ProteusEditText extends android.widget.EditText implements ProteusView {
private Manager viewManager;
public ProteusEditText(Context context) {
super(context);
}
public ProteusEditText(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ProteusEditText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public ProteusEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public Manager getViewManager() {
return viewManager;
}
@Override
public void setViewManager(@NonNull Manager manager) {
this.viewManager = manager;
}
@NonNull
@Override
public View getAsView() {
return this;
}
}
| 1,814 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
ProteusButton.java | /FileExtraction/Java_unseen/Deenu488_CodeAssist-Unofficial/proteus-core/src/main/java/com/flipkart/android/proteus/view/ProteusButton.java | /*
* Copyright 2019 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flipkart.android.proteus.view;
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import androidx.annotation.NonNull;
import com.flipkart.android.proteus.ProteusView;
/**
* Button
*
* @author aditya.sharat
*/
public class ProteusButton extends android.widget.Button implements ProteusView {
Manager viewManager;
public ProteusButton(Context context) {
super(context);
}
public ProteusButton(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ProteusButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public ProteusButton(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public Manager getViewManager() {
return viewManager;
}
@Override
public void setViewManager(@NonNull Manager manager) {
this.viewManager = manager;
}
@NonNull
@Override
public View getAsView() {
return this;
}
}
| 1,792 | Java | .java | Deenu488/CodeAssist-Unofficial | 122 | 27 | 2 | 2022-12-13T08:34:02Z | 2024-05-08T01:27:41Z |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.