use of com.google.cloud.dialogflow.v2.Context in project osate2 by osate.
the class FlowSegmentImpl method setContext.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setContext(Context newContext) {
Context oldContext = context;
context = newContext;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.FLOW_SEGMENT__CONTEXT, oldContext, context));
}
}
use of com.google.cloud.dialogflow.v2.Context in project osate2 by osate.
the class FlowEndImpl method setContext.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setContext(Context newContext) {
Context oldContext = context;
context = newContext;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.FLOW_END__CONTEXT, oldContext, context));
}
}
use of com.google.cloud.dialogflow.v2.Context in project osate2 by osate.
the class ModeTransitionTriggerImpl method setContext.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setContext(Context newContext) {
Context oldContext = context;
context = newContext;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.MODE_TRANSITION_TRIGGER__CONTEXT, oldContext, context));
}
}
use of com.google.cloud.dialogflow.v2.Context in project helidon-build-tools by oracle.
the class ArchetypeValidator method visitInput.
@Override
public VisitResult visitInput(Input input0, Context ctx) {
// process scope
Map<String, DeclaredInput> currentScope = requireNonNull(scopes.peek(), "current scope is null");
scopes.push(new HashMap<>());
if (input0 instanceof DeclaredInput) {
DeclaredInput input = (DeclaredInput) input0;
Context.Scope scope = ctx.newScope(input.id(), input.isGlobal());
inputPath = scope.id();
ctx.pushScope(scope);
allRefs.computeIfAbsent(inputPath, k -> new ArrayList<>());
if (input instanceof Input.Options) {
options.push(new HashSet<>());
}
if (currentScope.containsKey(inputPath)) {
errors.add(String.format("%s %s: '%s'", input.location(), INPUT_ALREADY_DECLARED, inputPath));
} else {
currentScope.put(inputPath, input);
List<Block> duplicates = requireNonNull(allRefs.get(inputPath), "duplicate refs is null");
if (!duplicates.isEmpty()) {
Block duplicate = duplicates.get(0);
if (duplicate.kind() != input.kind()) {
errors.add(String.format("%s %s: '%s'", input.location(), INPUT_TYPE_MISMATCH, inputPath));
}
}
duplicates.add(input);
}
boolean optional = input.isOptional();
if (optional && input.defaultValue().unwrap() == null) {
errors.add(String.format("%s %s: '%s'", input.location(), INPUT_OPTIONAL_NO_DEFAULT, inputPath));
}
StepState stepState = steps.peek();
if (stepState == null) {
errors.add(String.format("%s %s: '%s'", input.location(), INPUT_NOT_IN_STEP, inputPath));
} else {
stepState.optional = stepState.optional && optional;
stepState.inputs++;
}
} else if (input0 instanceof Input.Option) {
Input.Option option = (Input.Option) input0;
String value = option.value();
if (!requireNonNull(options.peek(), "option values is null").add(value)) {
errors.add(String.format("%s %s: '%s'", option.location(), OPTION_VALUE_ALREADY_DECLARED, value));
}
}
return VisitResult.CONTINUE;
}
use of com.google.cloud.dialogflow.v2.Context in project bmoth by hhu-stups.
the class InitialStateExistsChecker method doInitialStateExistsCheck.
static InitialStateExistsCheckingResult doInitialStateExistsCheck(MachineNode machine) {
Context ctx = new Context();
Solver solver = Z3SolverFactory.getZ3Solver(ctx);
MachineToZ3Translator machineTranslator = new MachineToZ3Translator(machine, ctx);
final BoolExpr invariant = machineTranslator.getInitialValueConstraint();
solver.add(invariant);
Status check = solver.check();
return new InitialStateExistsCheckingResult(check);
}
Aggregations