Interpreter
public protocol Interpreter : EvaluatorWithLocalContext
The base protocol of interpreters, that are context-aware, and capable of recursively evaluating variables. They use the evaluate method as their main input
-
The evaluator type to use when interpreting variables
Declaration
Swift
associatedtype VariableEvaluator : EvaluatorWithLocalContext
-
The stored context object for helping evaluation and providing persistency
Declaration
Swift
var context: Context { get }
-
Sometimes interpreters don’t use themselves to evaluate variables by default, maybe a third party, or another contained interpreter. For example, the
StringTemplateInterpreter
class usesTypedInterpreter
instance to evaluate its variables.Declaration
Swift
var interpreterForEvaluatingVariables: VariableEvaluator { get }