-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathCommand.java
More file actions
33 lines (30 loc) · 1.21 KB
/
Copy pathCommand.java
File metadata and controls
33 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.scriptbasic.spi;
import com.scriptbasic.api.ScriptBasicException;
import com.scriptbasic.interfaces.AnalysisResult;
import com.scriptbasic.interfaces.Executor;
/**
* Classes that provide methods to execute a command implement this interface.
* <p>
* Since the objects are created as a result of the BASIC program analysis any
* command is also an {@code AnalysisResult}.
* <p>
* The implementing classes contain the execution code of the different program
* commands, like 'for', 'if' and so on.
* <p>
* These objects are multitons, do not contain any runtime data, since many
* interpreters may execute the same program at the same time. The code also has
* to be thread safe.
* <p>
* The data that may be stored in a command is referential data to other
* Commands that are in the same program. For example a command implementing
* 'while' has an object that points to the corresponding 'wend',
* but should not contain any data that holds the value of the expression
* evaluated.
*
* @author Peter Verhas
* date June 15, 2012
*/
public interface Command extends AnalysisResult, Executor {
Command getNextCommand();
void checkedExecute(Interpreter interpreter) throws ScriptBasicException;
}