Class PatternLanguageValidator

  • All Implemented Interfaces:
    org.eclipse.emf.ecore.EValidator, IIssueCallback, org.eclipse.xtext.validation.ValidationMessageAcceptor

    public class PatternLanguageValidator
    extends org.eclipse.xtext.validation.AbstractDeclarativeValidator
    implements IIssueCallback
    Validators for Core Pattern Language.

    Validators implemented:

    • Duplicate parameter in pattern declaration
    • Duplicate pattern definition (name duplication only, better calculation is needed)
    • Pattern call parameter checking (only the number of the parameters, types not supported yet)
    • Empty PatternBody check
    • Check for recursive pattern calls
    Since:
    2.0
    • Field Detail

      • DUPLICATE_VARIABLE_MESSAGE

        public static final java.lang.String DUPLICATE_VARIABLE_MESSAGE
        See Also:
        Constant Field Values
      • DUPLICATE_PATTERN_DEFINITION_MESSAGE

        public static final java.lang.String DUPLICATE_PATTERN_DEFINITION_MESSAGE
        See Also:
        Constant Field Values
      • CONFLICTING_SPECIFICATION_NAME_MESSAGE

        public static final java.lang.String CONFLICTING_SPECIFICATION_NAME_MESSAGE
        Since:
        1.7
        See Also:
        Constant Field Values
      • UNKNOWN_ANNOTATION_ATTRIBUTE

        public static final java.lang.String UNKNOWN_ANNOTATION_ATTRIBUTE
        See Also:
        Constant Field Values
      • MISSING_ANNOTATION_ATTRIBUTE

        public static final java.lang.String MISSING_ANNOTATION_ATTRIBUTE
        See Also:
        Constant Field Values
      • ANNOTATION_PARAMETER_TYPE_ERROR

        public static final java.lang.String ANNOTATION_PARAMETER_TYPE_ERROR
        See Also:
        Constant Field Values
      • TRANSITIVE_CLOSURE_ARITY_IN_PATTERNCALL

        public static final java.lang.String TRANSITIVE_CLOSURE_ARITY_IN_PATTERNCALL
        See Also:
        Constant Field Values
      • TRANSITIVE_CLOSURE_ONLY_IN_POSITIVE_COMPOSITION

        public static final java.lang.String TRANSITIVE_CLOSURE_ONLY_IN_POSITIVE_COMPOSITION
        See Also:
        Constant Field Values
      • RECURSIVE_PATTERN_CALL

        public static final java.lang.String RECURSIVE_PATTERN_CALL
        See Also:
        Constant Field Values
      • RECURSIVE_PATTERN_CALL_TRANSITIVE

        public static final java.lang.String RECURSIVE_PATTERN_CALL_TRANSITIVE
        Since:
        2.0
        See Also:
        Constant Field Values
      • RECURSIVE_PATTERN_CALL_NEGATIVE

        public static final java.lang.String RECURSIVE_PATTERN_CALL_NEGATIVE
        Since:
        2.0
        See Also:
        Constant Field Values
      • RECURSIVE_PATTERN_CALL_AGGREGATION

        public static final java.lang.String RECURSIVE_PATTERN_CALL_AGGREGATION
        Since:
        2.9
        See Also:
        Constant Field Values
      • INVALID_AGGREGATE_MESSAGE

        public static final java.lang.String INVALID_AGGREGATE_MESSAGE
        Since:
        1.4
        See Also:
        Constant Field Values
      • UNEXPECTED_AGGREGATE_MESSAGE

        public static final java.lang.String UNEXPECTED_AGGREGATE_MESSAGE
        Since:
        1.4
        See Also:
        Constant Field Values
      • EXACTLY_ONE_AGGREGATE_MESSAGE

        public static final java.lang.String EXACTLY_ONE_AGGREGATE_MESSAGE
        Since:
        1.4
        See Also:
        Constant Field Values
      • MISSING_AGGREGATE_MESSAGE

        public static final java.lang.String MISSING_AGGREGATE_MESSAGE
        Since:
        1.4
        See Also:
        Constant Field Values
      • VARIABLE_NAME_DUBIUS_REUSE_MESSAGE_SINGLEUSE

        public static final java.lang.String VARIABLE_NAME_DUBIUS_REUSE_MESSAGE_SINGLEUSE
        Since:
        1.4
        See Also:
        Constant Field Values
      • VARIABLE_NAME_DUBIUS_REUSE_MESSAGE_AGGREGATE

        public static final java.lang.String VARIABLE_NAME_DUBIUS_REUSE_MESSAGE_AGGREGATE
        Since:
        1.4
        See Also:
        Constant Field Values
    • Constructor Detail

      • PatternLanguageValidator

        public PatternLanguageValidator()
    • Method Detail

      • enableQueryGroupGeneration

        @Inject
        public void enableQueryGroupGeneration​(boolean queryGroupGenerationEnabled)
        Since:
        2.3
      • register

        public void register​(org.eclipse.xtext.validation.EValidatorRegistrar reg)
        Overrides:
        register in class org.eclipse.xtext.validation.AbstractInjectableValidator
      • getEPackages

        protected java.util.List<org.eclipse.emf.ecore.EPackage> getEPackages()
        Overrides:
        getEPackages in class org.eclipse.xtext.validation.AbstractInjectableValidator
      • checkAggregatorExpression

        public void checkAggregatorExpression​(AggregatedValue expression)
        Checks if an aggregator expression has the correct number (0 or 1) aggregate variables.
        Parameters:
        expression - the aggregator expression
        Since:
        1.4
      • checkAggregatorCallTypes

        public void checkAggregatorCallTypes​(AggregatedValue expression)
        Check for mistyped aggregator expressions
        Since:
        1.7
      • checkEmbeddedAggregatorLength

        public void checkEmbeddedAggregatorLength​(AggregatedValue value)
      • checkPatternParameters

        public void checkPatternParameters​(Pattern pattern)
      • checkPrivatePatternCall

        public void checkPrivatePatternCall​(PatternCall call)
      • checkPatternCallParameters

        public void checkPatternCallParameters​(PatternCall call)
      • checkApplicabilityOfTransitiveClosureInPatternCall

        public void checkApplicabilityOfTransitiveClosureInPatternCall​(CallableRelation call)
      • checkPatterns

        public void checkPatterns​(PatternModel model)
      • checkPatternBody

        public void checkPatternBody​(PatternBody body)
      • checkAnnotation

        public void checkAnnotation​(Annotation annotation)
      • checkCompareConstraints

        public void checkCompareConstraints​(CompareConstraint constraint)
      • checkRecursivePatternCall

        public void checkRecursivePatternCall​(PatternCall call)
      • getFormattedArgumentsList

        protected java.lang.String getFormattedArgumentsList​(java.util.List<ValueReference> arguments)
      • checkPackageDeclaration

        public void checkPackageDeclaration​(PatternModel model)
      • checkReturnTypeOfCheckConstraints

        public void checkReturnTypeOfCheckConstraints​(CheckConstraint checkConstraint)
      • checkReturnTypeOfFunctionEvaluationValues

        public void checkReturnTypeOfFunctionEvaluationValues​(FunctionEvaluationValue evalValue)
        Since:
        2.7
      • checkVariableNames

        public void checkVariableNames​(PatternBody body)
      • checkForImpureJavaCallsInCheckConstraints

        public void checkForImpureJavaCallsInCheckConstraints​(CheckConstraint checkConstraint)
      • checkForImpureJavaCallsInEvalExpressions

        public void checkForImpureJavaCallsInEvalExpressions​(FunctionEvaluationValue eval)
      • info

        public void info​(java.lang.String message,
                         org.eclipse.emf.ecore.EObject source,
                         org.eclipse.emf.ecore.EStructuralFeature feature,
                         java.lang.String code,
                         java.lang.String... issueData)
        Specified by:
        info in interface IIssueCallback
        Overrides:
        info in class org.eclipse.xtext.validation.AbstractDeclarativeValidator
      • warning

        public void warning​(java.lang.String message,
                            org.eclipse.emf.ecore.EObject source,
                            org.eclipse.emf.ecore.EStructuralFeature feature,
                            java.lang.String code,
                            java.lang.String... issueData)
        Specified by:
        warning in interface IIssueCallback
        Overrides:
        warning in class org.eclipse.xtext.validation.AbstractDeclarativeValidator
      • error

        public void error​(java.lang.String message,
                          org.eclipse.emf.ecore.EObject source,
                          org.eclipse.emf.ecore.EStructuralFeature feature,
                          java.lang.String code,
                          java.lang.String... issueData)
        Specified by:
        error in interface IIssueCallback
        Overrides:
        error in class org.eclipse.xtext.validation.AbstractDeclarativeValidator