public interface CommandFactory extends FactoryManaged
CommandFactory
analyzes a BASIC program line and creates a
Command
that is the result of the analysis.Modifier and Type | Method and Description |
---|---|
Command |
create(String commandKeyword)
Create a Command that starts with the keyword.
|
void |
registerCommandAnalyzer(String keywords,
CommandAnalyzer analyzer)
Register a new command analyzer that the factory will use to analyze a
line.
|
setFactory
Command create(String commandKeyword) throws AnalysisException
commandKeyword
- the command keyword lexeme or null
in case the command
does not start with a keyword (e.g. procedure call or
assignment)AnalysisException
- is there is a lexical or syntax exception
if there is some error with the command factory itself and it
can not analyze the line and does not know what the error is.
(probably the syntax of the line is totally wrong)void registerCommandAnalyzer(String keywords, CommandAnalyzer analyzer)
keyword
.keywords
- the keyword the line should start when this command is to be
analyzed or null
if this analyzer analyzes a line that
does not start with a specific keywordanalyzer
- the command analyzer for the specific keywordCopyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.