1   package org.daisy.pipeline.nlp.calabash.impl;
2   
3   import java.util.List;
4   import java.util.Locale;
5   
6   import net.sf.saxon.s9api.XdmNode;
7   
8   import org.daisy.pipeline.nlp.lexing.LexService.LexerInitException;
9   
10  public interface InlineSectionProcessor {
11  
12  	public class Leaf {
13  		public XdmNode formatting;
14  		public int level;
15  	}
16  
17  	/**
18  	 * Called when a new inline section has been detected.
19  	 * 
20  	 * Guaranteed to be called in document order.
21  	 * 
22  	 * The provided lists are not guaranteed to be different for each call (they
23  	 * might be recycled).
24  	 * 
25  	 * A text element can be null. A formatting element can be null as well
26  	 * (when punctuation marks have been inserted into the text to help the
27  	 * lexer)
28  	 * 
29  	 * @throws LexerInitException
30  	 */
31  
32  	public void onInlineSectionFound(List<Leaf> leaves, List<String> text, Locale lang)
33  	        throws LexerInitException;
34  
35  	public void onEmptySectionFound(List<Leaf> leaves);
36  }