Search in sources :

Example 11 with Context

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));
    }
}
Also used : Context(org.osate.aadl2.Context) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 12 with 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));
    }
}
Also used : Context(org.osate.aadl2.Context) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 13 with 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));
    }
}
Also used : Context(org.osate.aadl2.Context) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 14 with 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;
}
Also used : Context(io.helidon.build.archetype.engine.v2.Context) DeclaredInput(io.helidon.build.archetype.engine.v2.ast.Input.DeclaredInput) DeclaredInput(io.helidon.build.archetype.engine.v2.ast.Input.DeclaredInput) Input(io.helidon.build.archetype.engine.v2.ast.Input) Block(io.helidon.build.archetype.engine.v2.ast.Block)

Example 15 with Context

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);
}
Also used : Context(com.microsoft.z3.Context) Status(com.microsoft.z3.Status) BoolExpr(com.microsoft.z3.BoolExpr) Solver(com.microsoft.z3.Solver) MachineToZ3Translator(de.bmoth.backend.z3.MachineToZ3Translator)

Aggregations

Context (org.eclipse.jst.server.tomcat.core.internal.xml.server40.Context)58 Context (com.microsoft.z3.Context)39 CoreException (org.eclipse.core.runtime.CoreException)34 Context (org.osate.aadl2.Context)31 BoolExpr (com.microsoft.z3.BoolExpr)25 ArrayList (java.util.ArrayList)18 HashMap (java.util.HashMap)18 Test (org.junit.Test)18 ServerInstance (org.eclipse.jst.server.tomcat.core.internal.xml.server40.ServerInstance)17 List (java.util.List)16 Map (java.util.Map)15 Solver (com.microsoft.z3.Solver)13 File (java.io.File)13 IOException (java.io.IOException)11 IPath (org.eclipse.core.runtime.IPath)11 IStatus (org.eclipse.core.runtime.IStatus)11 Status (org.eclipse.core.runtime.Status)11 Factory (org.eclipse.jst.server.tomcat.core.internal.xml.Factory)11 Feature (org.osate.aadl2.Feature)11 FileNotFoundException (java.io.FileNotFoundException)10