Tabnine Logo
org.eclipse.incquery.patternlanguage.patternLanguage
Code IndexAdd Tabnine to your IDE (free)

How to use org.eclipse.incquery.patternlanguage.patternLanguage

Best Java code snippets using org.eclipse.incquery.patternlanguage.patternLanguage (Showing top 20 results out of 315)

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

/**
 * @param varName
 * @return
 */
private static Variable initializeLocalVariable(String varName) {
  Variable decl;
  decl = PatternLanguageFactory.eINSTANCE.createVariable();
  decl.setName(varName);
  return decl;
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

/**
 * @param var
 * @return
 */
private static ParameterRef initializeParameterRef(Variable var) {
  ParameterRef refVar = PatternLanguageFactory.eINSTANCE.createParameterRef();
  refVar.setName(var.getName());
  // refVar.setType(var.getType());
  refVar.setReferredParam(var);
  return refVar;
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

public Annotation getAnnotationObject(String annotationName) {
  Annotation annotation = PatternLanguageFactory.eINSTANCE.createAnnotation();
  annotation.setName(annotationName);
  return annotation;
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

public boolean isDeprecated(AnnotationParameter parameter) {
  Annotation annotation = (Annotation) parameter.eContainer();
  return isDeprecated(annotation.getName(), parameter.getName());
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

/**
 * Returns the name of the container package of the selected pattern
 * @return a name of the pattern; never null, but may be empty string
 */
public static String getPackageName(Pattern pattern) {
  if(pattern == null || pattern.eIsProxy()) {
    return "";
  }
  PatternModel patternModel = (PatternModel) pattern.eContainer();
  return (patternModel == null) ? null : patternModel.getPackageName();
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

private boolean isEqualVariables(Variable variable, VariableReference variableReference) {
  if (variable != null && variableReference != null) {
    final Variable variableReferenceVariable = variableReference.getVariable();
    if (equal(variable, variableReferenceVariable)
        || equal(variable.getName(), variableReferenceVariable.getName())) {
      return true;
    }
  }
  return false;
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

/** Compiles a map for name-based lookup of symbolic parameter positions. */
public static Map<String, Integer> getParameterPositionsByName(Pattern pattern) {
  EList<Variable> parameters = pattern.getParameters();
  Map<String, Integer> posMapping = new HashMap<String, Integer>();
  int parameterPosition = 0;
  for (Variable parameter : parameters) {
    posMapping.put(parameter.getName(), parameterPosition++);
  }
  return posMapping;
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

private String getVariableName(Variable variable, PatternModelAcceptor<?> acceptor) {
  if (variable instanceof ParameterRef) // handle referenced parameter variables
    return getVariableName(((ParameterRef) variable).getReferredParam(), acceptor); // assumed to be non-null
  else {
    return variable.getName();
  }
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

private String prettyPrintPatternCall(PatternCall call) {
  return (isNegativePatternCall(call) ? "neg " : "") + call.getPatternRef().getName();
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

@Override
public EClassifier getExplicitClassifierForPatternParameterVariable(Variable variable) {
  if (variable instanceof ParameterRef) {
    Variable referredParameter = ((ParameterRef) variable).getReferredParam();
    return getClassifierForType(referredParameter.getType());
  } else {
    return getClassifierForType(variable.getType());
  }
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

 @Override
 public String apply(final Variable it) {
  return it.getName();
 }
};
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

private boolean isNegativePatternCall(PatternCall call) {
  return (call.eContainer() instanceof PatternCompositionConstraint && ((PatternCompositionConstraint) call
      .eContainer()).isNegative());
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

public AnnotationParameter getAnnotationParameter(Annotation annotation, String parameterName) {
  AnnotationParameter parameter = PatternLanguageFactory.eINSTANCE.createAnnotationParameter();
  parameter.setName(parameterName);
  annotation.getParameters().add(parameter);
  return parameter;
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

/**
 * @param pattern
 * @return true if the pattern has a private modifier, false otherwise.
 */
public static boolean isPrivate(Pattern pattern) {
  for (Modifiers mod : pattern.getModifiers()) {
    if (mod.isPrivate()) {
      return true;
    }
  }
  return false;
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

/**
 * @return the string describing a metamodel type, for debug / exception purposes
 */
private String typeStr(Type type) {
  return type.getTypename() == null ? "(null)" : type.getTypename();
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

public String getDescription(AnnotationParameter parameter) {
  Annotation annotation = (Annotation) parameter.eContainer();
  return getDescription(annotation.getName(), parameter.getName());
}
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

  @Override
  public String apply(Variable variable) {
    return variable.getName();
  }
});
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage

 public String apply(final Variable var) {
  return var.getName();
 }
});
origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

@Override
public String acceptVariable(final Variable variable) {
 String _xblockexpression = null;
 {
  String _name = variable.getName();
  BodyCodeGenerator.declareVariable(_name, target);
  _xblockexpression = variable.getName();
 }
 return _xblockexpression;
}

origin: org.eclipse.incquery/org.eclipse.incquery.patternlanguage.emf

  @Override
  public String apply(Variable var) {
    return var.getName();
  }
});
org.eclipse.incquery.patternlanguage.patternLanguage

Most used classes

  • AggregatedValue
    A representation of the model object 'Aggregated Value'. The following features are supported: *
  • Annotation
    A representation of the model object 'Annotation'. The following features are supported: * org.e
  • AnnotationParameter
    A representation of the model object 'Annotation Parameter'. The following features are supported:
  • BoolValue
    A representation of the model object 'Bool Value'. The following features are supported: * org.e
  • CheckConstraint
    A representation of the model object 'Check Constraint'. The following features are supported: *
  • CompareFeature,
  • Constraint,
  • DoubleValue,
  • FunctionEvaluationValue,
  • IntValue,
  • ParameterRef,
  • PathExpressionConstraint,
  • PathExpressionHead,
  • Pattern,
  • PatternBody,
  • PatternCall,
  • PatternCompositionConstraint,
  • PatternModel,
  • StringValue
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now