Parameters parameters)
throws ProcessingException, SAXException,
IOException {
this.resolver = resolver;
Store store = null;
try {
this.grammar = src;
this.grammarSource = resolver.resolveURI(this.grammar);
// Retrieve the parser automaton from the transient store
store = (Store) this.manager.lookup(Store.TRANSIENT_STORE);
ParserAutomatonEntry entry = (ParserAutomatonEntry) store.get(this.grammarSource.getURI());
// If the parser automaton has changed, rebuild the parser automaton
if ((entry==null) || (entry.getValidity()==null) ||
(entry.getValidity().isValid(this.grammarSource.getValidity()))<=
0) {
this.logger.info("(Re)building the automaton from '"+
this.grammarSource.getURI()+"'");
SAXConfigurationHandler confighandler = new SAXConfigurationHandler();
if (this.grammarSource.getInputStream()==null) {
throw new ProcessingException("Source '"+
this.grammarSource.getURI()+
"' not found");
}
SourceUtil.toSAX(this.manager, this.grammarSource, null, confighandler);
Configuration config = confighandler.getConfiguration();
Grammar grammar = GrammarFactory.createGrammar(config);
ParserAutomatonBuilder builder = new ParserAutomatonBuilder(grammar,
this.logger);
this.automaton = builder.getParserAutomaton();
this.logger.info("Store automaton into store for '"+
this.grammarSource.getURI()+"'");
store.store(this.grammarSource.getURI(),
new ParserAutomatonEntry(this.automaton,
this.grammarSource.getValidity()));
} else {
this.logger.info("Getting automaton from store for '"+
this.grammarSource.getURI()+"'");