Interface DSLScriptContextProvider
@NonNullByDefault
public interface DSLScriptContextProvider
Interface of a provider that can provide Xbase-relevant object structures for
a purely string based script. This is required to support DSL rules, which
can have a context (variables) per file that is shared among multiple rules.
- Author:
- Kai Kreuzer - Initial contribution
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringIdentifier for scripts that are created from a DSL rule file -
Method Summary
Modifier and TypeMethodDescription@Nullable org.eclipse.xtext.xbase.interpreter.IEvaluationContextgetContext(String contextName) Returns the evaluation context, i.e. the current state of the variables of the rule file.@Nullable org.eclipse.xtext.xbase.XExpressiongetParsedScript(String contextName, String ruleIndex) Returns theXExpression, which is the readily parsed script.
-
Field Details
-
CONTEXT_IDENTIFIER
Identifier for scripts that are created from a DSL rule file- See Also:
-
-
Method Details
-
getContext
Returns the evaluation context, i.e. the current state of the variables of the rule file.- Parameters:
contextName- the filename of the rule file in question- Returns:
- the evaluation context
-
getParsedScript
Returns theXExpression, which is the readily parsed script. As it might refer to variables from the rule file scope, this script cannot be parsed independently.- Parameters:
contextName- the filename of the rule file in questionruleIndex- the index of the rule within the file- Returns:
- the parsed script
-