public class BasicLexicalAnalyzer extends Object implements LineOrientedLexicalAnalyzer
| Modifier | Constructor and Description |
|---|---|
protected |
BasicLexicalAnalyzer() |
| Modifier and Type | Method and Description |
|---|---|
LexicalElement |
get()
Get the next lexical element from the input stream.
|
Factory |
getFactory() |
LexicalElement |
peek()
Peek at the next lexical element and do not remove it from the input
stream.
|
void |
registerElementAnalyzer(LexicalElementAnalyzer lea)
Register a lexical element analyzer.
|
void |
resetLine()
Resets the state of the lexical analyzer so that the internal lexeme
pointer is reset to the first lexeme of the actual line and the next call
to
LexicalAnalyzer.get() will return again the first lexeme of the line. |
void |
set(Reader reader)
Set the reader from where the lexical analyzer has to read the input.
|
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 Factory getFactory()
public void setFactory(Factory factory)
FactoryManagedsetFactory in interface FactoryManagedfactory - the factory that manages the instance.public void set(Reader reader)
LexicalAnalyzerset in interface LexicalAnalyzerpublic void registerElementAnalyzer(LexicalElementAnalyzer lea)
LexicalAnalyzerregisterElementAnalyzer in interface LexicalAnalyzerpublic void resetLine()
LineOrientedLexicalAnalyzerLexicalAnalyzer.get() will return again the first lexeme of the line.resetLine in interface LineOrientedLexicalAnalyzerpublic LexicalElement get() throws AnalysisException
LexicalAnalyzernullget in interface LexicalAnalyzerAnalysisExceptionpublic LexicalElement peek() throws AnalysisException
peek() without calling LexicalAnalyzer.get()
will return the same lexical element. Calling LexicalAnalyzer.get() will return
the same lexical element as the last call to peek().peek in interface LexicalAnalyzerAnalysisExceptionCopyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.