/**
* Get a map from rule names to rule indexes.
*
* <p>Used for XPath and tree pattern compilation.</p>
*/
@NotNull
public Map<String, Integer> getRuleIndexMap() {
String[] ruleNames = getRuleNames();
if (ruleNames == null) {
throw new UnsupportedOperationException("The current recognizer does not provide a list of rule names.");
}
synchronized (ruleIndexMapCache) {
Map<String, Integer> result = ruleIndexMapCache.get(ruleNames);
if (result == null) {
result = Collections.unmodifiableMap(Utils.toMap(ruleNames));
ruleIndexMapCache.put(ruleNames, result);
}
return result;
}
}
Recognizer.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:Scratch-ApuC
作者:
评论列表
文章目录