Package com.scriptbasic.syntax.commands
Class BasicCommandFactory
java.lang.Object
com.scriptbasic.syntax.commands.BasicCommandFactory
- All Implemented Interfaces:
CommandFactory
public final class BasicCommandFactory extends java.lang.Object implements CommandFactory
-
Constructor Summary
Constructors Constructor Description BasicCommandFactory(Context ctx)This implementation of the interface (btw: the only one in ScriptBasic) creates a command from a list of symbols. -
Method Summary
-
Constructor Details
-
BasicCommandFactory
This implementation of the interface (btw: the only one in ScriptBasic) creates a command from a list of symbols. First it checks if the first symbol of the command is a keyword and appears in theclassMapas a key. If yes, for example the- Parameters:
ctx- the context of the interpreter
-
-
Method Details
-
create
Description copied from interface:CommandFactoryCreate a Command that starts with the keyword.- Specified by:
createin interfaceCommandFactory- Parameters:
commandKeyword- the command keyword lexeme ornullin case the command does not start with a keyword (e.g. procedure call or assignment or a DSL sentence)- Returns:
- the created command
- Throws:
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)
-