}
}
private void loadRepository() {
repository = new HashMap<String, List<Pattern>>();
Dict plistRepo = plist.getDictionary("repository");
if (plistRepo == null)
return;
Dict plistRepoEntry;
for (String key : plistRepo.keys()) {
// System.out.printf("loading repository entry: %s\n", key);
List<Pattern> repoArray = new ArrayList<Pattern>();
plistRepoEntry = plistRepo.getDictionary(key);
if (plistRepoEntry.containsElement("begin") || plistRepoEntry.containsElement("match")) {
// System.out.printf(" contains begin or match\n");
Pattern pattern = Pattern.createPattern(this.allPatterns, plistRepoEntry);
if (pattern != null) {
pattern.grammar = this;
repoArray.add(pattern);
}
}
else if (plistRepoEntry.containsElement("patterns")) {
// System.out.printf(" contains patterns\n");
for (PlistNode<?> plistPattern : plistRepoEntry.getArray("patterns")) {
Pattern pattern = Pattern.createPattern(this.allPatterns, (Dict) plistPattern);
if (pattern != null) {
pattern.grammar = this;
repoArray.add(pattern);
}