public class GenericHierarchicalReader extends Object implements HierarchicalReader
Constructor and Description |
---|
GenericHierarchicalReader() |
Modifier and Type | Method and Description |
---|---|
Integer |
get()
Get the next character from the input stream.
|
String |
getFileName()
Get the name of the file to which the object is bound to.
|
int |
getLineNumber()
Get the line number to which the object is bound to.
|
int |
getPosition()
Get the position on the line to which the object is bound to.
|
SourceProvider |
getSourceProvider()
Get the source provider that provided this reader.
|
void |
include(Reader reader)
Include a new reader into the chain and start to use that child reader so
long as long exhausts.
|
void |
pushBack(Integer ch)
Readers should support lexical analyzers offering the possibility to push
some characters back to the input stream, when a lexical analyzer can not
decide its selection only consuming extra characters.
|
void |
set(String sourceFileName) |
void |
setFactory(Factory factory)
When a factory creates an instance of a class implementing this interface
this method is called to register the factory that created the instance.
|
public void setFactory(Factory factory)
FactoryManaged
setFactory
in interface FactoryManaged
factory
- the factory that manages the instance.public void include(Reader reader)
include
in interface HierarchicalReader
reader
- public String getFileName()
SourceLocationBound
getFileName
in interface SourceLocationBound
public int getLineNumber()
SourceLocationBound
getLineNumber
in interface SourceLocationBound
public int getPosition()
SourceLocationBound
getPosition
in interface SourceLocationBound
public void pushBack(Integer ch)
Reader
Some of the readers may limit the operation of this push back functionality not supporting tracking line numbers, position and file name when this method is used.
Lexical analyzers should push back the characters that were read from the reader the backward order as they were read. (Read last pushed back first.)
Implementation should ignore null
parameter.
public Integer get()
public SourceProvider getSourceProvider()
Reader
getSourceProvider
in interface Reader
Copyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.