<commit_before>/*******************************************************************************
 * Copyright (c) 2010 itemis AG (http://www.itemis.eu) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.eclipse.xtext.validation;

import java.util.Set;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.xtext.validation.IAssignmentQuantityAllocator.IQuantities;
import org.eclipse.xtext.validation.IConcreteSyntaxConstraintProvider.ISyntaxConstraint;
import org.eclipse.xtext.validation.impl.ConcreteSyntaxDiagnosticProvider;

import com.google.inject.ImplementedBy;

/**
 * @author <NAME> - Initial contribution and API
 */
@ImplementedBy(ConcreteSyntaxDiagnosticProvider.class)
public interface IConcreteSyntaxDiagnosticProvider {

	public interface IConcreteSyntaxDiagnostic extends Diagnostic {
	}

	public static final int ERROR_ASSIGNMENT_MISSING = 7;

	public static final int ERROR_ASSIGNMENT_PROHIBITED = 8;

	public static final int ERROR_FEATURE_MISSING = 6;

	public static final int ERROR_LIST_TOO_FEW = 4;

	public static final int ERROR_LIST_TOO_MANY = 5;

	public static final int ERROR_LIST_UNDECIDEABLE = 3;

	public static final int ERROR_VALUE_PROHIBITED = 2;

	public static final int ERROR_VALUE_REQUIRED = 1;

	public static final int ERROR_WRONG_TYPE = 7;

	public IConcreteSyntaxDiagnostic createAssignmentMissingDiagnostic(ISyntaxConstraint rule, EObject source,
			EStructuralFeature feature, Set<ISyntaxConstraint> involved);

	public IConcreteSyntaxDiagnostic createFeatureMissingDiagnostic(ISyntaxConstraint rule, EObject source,
			ISyntaxConstraint element, Set<ISyntaxConstraint> involved);

	public IConcreteSyntaxDiagnostic createFeatureQuantityDiagnostic(ISyntaxConstraint rule, IQuantities source,
			EStructuralFeature feature, int actual, int min, int max, Set<ISyntaxConstraint> involved);

	public IConcreteSyntaxDiagnostic createUnexpectedTypeDiagnostic(ISyntaxConstraint rule, EObject source,
			Set<ISyntaxConstraint> involved);
}
<commit_msg>Fix: Unique error codes in concrete syntax validator<commit_after>/*******************************************************************************
 * Copyright (c) 2010 itemis AG (http://www.itemis.eu) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.eclipse.xtext.validation;

import java.util.Set;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.xtext.validation.IAssignmentQuantityAllocator.IQuantities;
import org.eclipse.xtext.validation.IConcreteSyntaxConstraintProvider.ISyntaxConstraint;
import org.eclipse.xtext.validation.impl.ConcreteSyntaxDiagnosticProvider;

import com.google.inject.ImplementedBy;

/**
 * @author <NAME> - Initial contribution and API
 */
@ImplementedBy(ConcreteSyntaxDiagnosticProvider.class)
public interface IConcreteSyntaxDiagnosticProvider {

	public interface IConcreteSyntaxDiagnostic extends Diagnostic {
	}

	public static final int ERROR_ASSIGNMENT_MISSING = 1;

	public static final int ERROR_ASSIGNMENT_PROHIBITED = 2;

	public static final int ERROR_FEATURE_MISSING = 3;

	public static final int ERROR_LIST_TOO_FEW = 4;

	public static final int ERROR_LIST_TOO_MANY = 5;

	public static final int ERROR_LIST_UNDECIDEABLE = 6;

	public static final int ERROR_VALUE_PROHIBITED = 7;

	public static final int ERROR_VALUE_REQUIRED = 8;

	public static final int ERROR_WRONG_TYPE = 9;

	public IConcreteSyntaxDiagnostic createAssignmentMissingDiagnostic(ISyntaxConstraint rule, EObject source,
			EStructuralFeature feature, Set<ISyntaxConstraint> involved);

	public IConcreteSyntaxDiagnostic createFeatureMissingDiagnostic(ISyntaxConstraint rule, EObject source,
			ISyntaxConstraint element, Set<ISyntaxConstraint> involved);

	public IConcreteSyntaxDiagnostic createFeatureQuantityDiagnostic(ISyntaxConstraint rule, IQuantities source,
			EStructuralFeature feature, int actual, int min, int max, Set<ISyntaxConstraint> involved);

	public IConcreteSyntaxDiagnostic createUnexpectedTypeDiagnostic(ISyntaxConstraint rule, EObject source,
			Set<ISyntaxConstraint> involved);
}

{'fraction_non_alphanumeric': 0.12678979041294874, 'fraction_numerical': 0.007055405685826935, 'mean_word_length': 6.850162866449511, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5456931', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1273, 'n_words': 347}