Interface HierarchicalSourceReader

All Superinterfaces:
SourceLocationBound, SourceReader
All Known Implementing Classes:
GenericHierarchicalSourceReader

public interface HierarchicalSourceReader
extends SourceReader
A hierarchical reader can include sources into the string of characters read returned by another reader. Implementation usually do not directly read any source, but rather use a non hierarchical reader to read the source.

To give the hierarchical reader to a Lexical Analyzer is done usually following the pattern:

 SourceReader reader = someSourceProvider.get("some source name");

 HierarchicalSourceReader hierarchicalReader = new SomeHierarchicalReader();
 hierarchicalReader.include(reader);

 LexicalAnalyzer lexicalAnalyzer = new ScriptBasicLexicalAnalyzer();
 la.set(hierarchicalReader);
 
Author:
Peter Verhas