private List<Choice> getVariableChoices( Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env, String txt, ConstraintKind constraintType) { Set<Choice> choices = new java.util.LinkedHashSet<Choice>(); // retain order // add features of the context classifier. If the context is an // operation, then the parameters were already added to the // environment int oldSuffix = syntaxHelpStringSuffix; syntaxHelpStringSuffix = DOT; choices.addAll(getChoices(env.getSelfVariable().getType(), constraintType)); syntaxHelpStringSuffix = oldSuffix; try { List<IToken> tokens = tokenize(txt); getVariables(env, txt, tokens.listIterator(tokens.size())); } catch (Exception e) { // maybe we found a few variables. Ignore the exception } for (Variable<C, PM> var : env.getVariables()) { choices.add(new ChoiceImpl( var.getName(), uml.getName(var.getType()), ChoiceKind.VARIABLE, var)); } return filter(new ArrayList<Choice>(choices), constraintType); }
private List<Choice> getVariableChoices( Environment<PK, C, O, P, EL, PM, S, COA, SSA, CT, CLS, E> env, String txt, ConstraintKind constraintType) { Set<Choice> choices = new java.util.LinkedHashSet<Choice>(); // retain order // add features of the context classifier. If the context is an // operation, then the parameters were already added to the // environment int oldSuffix = syntaxHelpStringSuffix; syntaxHelpStringSuffix = DOT; choices.addAll(getChoices(env.getSelfVariable().getType(), constraintType)); syntaxHelpStringSuffix = oldSuffix; try { List<IToken> tokens = tokenize(txt); getVariables(env, txt, tokens.listIterator(tokens.size())); } catch (Exception e) { // maybe we found a few variables. Ignore the exception } for (Variable<C, PM> var : env.getVariables()) { choices.add(new ChoiceImpl( var.getName(), uml.getName(var.getType()), ChoiceKind.VARIABLE, var)); } return filter(new ArrayList<Choice>(choices), constraintType); }
if (result.getSelfVariable() == null) {
if (result.getSelfVariable() == null) {
initASTMapping(env, env.getSelfVariable(), invCS, null); initASTMapping(env, spec, invCS.getExpressionCS(), null); spec.setBodyExpression(oclExpression); spec.setContextVariable(env.getSelfVariable()); if (simpleNameCS != null) { simpleNameCS.setAst(spec.getContextVariable());
initASTMapping(env, env.getSelfVariable(), invCS, null); initASTMapping(env, spec, invCS.getExpressionCS(), null); spec.setBodyExpression(oclExpression); spec.setContextVariable(env.getSelfVariable()); if (simpleNameCS != null) { simpleNameCS.setAst(spec.getContextVariable());
if (owner != env.getSelfVariable().getType()) { uml.addConstrainedElement(astNode, (EObject) env.getSelfVariable().getType()); spec.setBodyExpression(oclExpression); spec.setContextVariable(env.getSelfVariable());
if (owner != env.getSelfVariable().getType()) { uml.addConstrainedElement(astNode, (EObject) env.getSelfVariable().getType()); spec.setBodyExpression(oclExpression); spec.setContextVariable(env.getSelfVariable());
spec.setContextVariable(env.getSelfVariable());
spec.setContextVariable(env.getSelfVariable());
Variable<C, PM> selfVar = env.getSelfVariable(); spec.setContextVariable(selfVar);
Variable<C, PM> selfVar = env.getSelfVariable(); spec.setContextVariable(selfVar);
initASTMapping(env, env.getSelfVariable(), defCS, null); initASTMapping(env, spec, defExpr); if (simpleNameCS != null) { spec.setContextVariable(env.getSelfVariable()); spec.setContextVariable(env.getSelfVariable()); spec.getParameterVariable().addAll(params);
initASTMapping(env, env.getSelfVariable(), defCS, null); initASTMapping(env, spec, defExpr); if (simpleNameCS != null) { spec.setContextVariable(env.getSelfVariable()); spec.setContextVariable(env.getSelfVariable()); spec.getParameterVariable().addAll(params);