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)
FactoryManaged
setFactory
in interface FactoryManaged
factory
- the factory that manages the instance.public void set(Reader reader)
LexicalAnalyzer
set
in interface LexicalAnalyzer
public void registerElementAnalyzer(LexicalElementAnalyzer lea)
LexicalAnalyzer
registerElementAnalyzer
in interface LexicalAnalyzer
public void resetLine()
LineOrientedLexicalAnalyzer
LexicalAnalyzer.get()
will return again the first lexeme of the line.resetLine
in interface LineOrientedLexicalAnalyzer
public LexicalElement get() throws AnalysisException
LexicalAnalyzer
null
get
in interface LexicalAnalyzer
AnalysisException
public 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 LexicalAnalyzer
AnalysisException
Copyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.