Class XsemanticsValidator
- java.lang.Object
-
- org.eclipse.xtext.validation.AbstractInjectableValidator
-
- org.eclipse.xtext.validation.AbstractDeclarativeValidator
-
- org.eclipse.xtext.xbase.validation.AbstractXbaseValidator
-
- org.eclipse.xtext.xbase.validation.XbaseValidator
-
- org.eclipse.xtext.xbase.annotations.validation.XbaseWithAnnotationsValidator
-
- org.eclipse.xsemantics.dsl.validation.AbstractXsemanticsValidator
-
- org.eclipse.xsemantics.dsl.validation.XsemanticsValidator
-
- All Implemented Interfaces:
org.eclipse.emf.ecore.EValidator,org.eclipse.xtext.validation.ValidationMessageAcceptor
public class XsemanticsValidator extends AbstractXsemanticsValidator
Custom validation rules. see http://www.eclipse.org/Xtext/documentation.html#validation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.validation.AbstractDeclarativeValidator
org.eclipse.xtext.validation.AbstractDeclarativeValidator.MethodWrapper, org.eclipse.xtext.validation.AbstractDeclarativeValidator.State, org.eclipse.xtext.validation.AbstractDeclarativeValidator.StateAccess
-
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.EValidator
org.eclipse.emf.ecore.EValidator.Descriptor, org.eclipse.emf.ecore.EValidator.PatternMatcher, org.eclipse.emf.ecore.EValidator.Registry, org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider, org.eclipse.emf.ecore.EValidator.ValidationDelegate
-
-
Field Summary
Fields Modifier and Type Field Description protected XsemanticsUtils_xsemanticsUtilsstatic java.lang.StringACCESS_TO_OUTPUT_PARAM_WITHIN_CLOSUREstatic java.lang.StringASSIGNMENT_TO_INPUT_PARAMstatic java.lang.StringCYCLIC_HIERARCHYstatic java.lang.StringDUPLICATE_AUXFUN_WITH_SAME_ARGUMENTSstatic java.lang.StringDUPLICATE_AUXILIARY_NAMEstatic java.lang.StringDUPLICATE_JUDGMENT_DESCRIPTION_SYMBOLSstatic java.lang.StringDUPLICATE_NAMEstatic java.lang.StringDUPLICATE_RULE_WITH_SAME_ARGUMENTSprotected booleanenableWarningsstatic java.lang.StringEXTENDS_CANNOT_COEXIST_WITH_VALIDATOR_EXTENDSstatic java.lang.StringFINAL_FIELD_NOT_INITIALIZEDstatic intmaxOfOutputParamsstatic java.lang.StringMUST_OVERRIDEstatic java.lang.StringNO_AUXDESC_FOR_AUX_FUNCTIONstatic java.lang.StringNO_AUXFUN_FOR_AUX_DESCRIPTIONstatic java.lang.StringNO_INPUT_PARAMstatic java.lang.StringNO_JUDGMENT_DESCRIPTIONstatic java.lang.StringNO_RULE_FOR_JUDGMENT_DESCRIPTIONprotected XsemanticsNodeModelUtilsnodeModelUtilsstatic java.lang.StringNOT_PARAMETERstatic java.lang.StringNOT_SUBTYPEstatic java.lang.StringNOT_VALID_INPUT_ARGstatic java.lang.StringNOT_VALID_OUTPUT_ARGstatic java.lang.StringNOT_VALID_SUPER_SYSTEMstatic java.lang.StringNOT_VALIDATORstatic java.lang.StringNOTHING_TO_OVERRIDEstatic java.lang.StringOVERRIDE_WITHOUT_SYSTEM_EXTENDSstatic java.lang.StringPARAMS_SIZE_DONT_MATCHstatic java.lang.StringPREFIXstatic java.lang.StringRESERVED_VARIABLE_NAMEstatic java.lang.StringRETURN_NOT_ALLOWEDstatic java.lang.StringTHROW_NOT_ALLOWEDstatic java.lang.StringTOO_LITTLE_TYPE_INFORMATIONstatic java.lang.StringTOO_MANY_OUTPUT_PARAMSprotected XsemanticsTypeSystemtypeSystemprotected XsemanticsXExpressionHelperxExpressionHelper-
Fields inherited from class org.eclipse.xtext.validation.AbstractInjectableValidator
CURRENT_LANGUAGE_NAME, ISSUE_SEVERITIES
-
-
Constructor Summary
Constructors Constructor Description XsemanticsValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckAssignment(org.eclipse.xtext.xbase.XAssignment assignment)voidcheckAuxiliaryDescription(AuxiliaryDescription aux)voidcheckAuxiliaryFunctionHasAuxiliaryDescription(AuxiliaryFunction aux)protected voidcheckConformance(JudgmentParameter judgmentParameter, org.eclipse.emf.ecore.EObject element, java.lang.String elementDescription, org.eclipse.emf.ecore.EStructuralFeature feature)protected voidcheckConformanceOfAuxiliaryFunction(AuxiliaryFunction aux, AuxiliaryDescription auxiliaryDescription)voidcheckFieldInitialization(FieldDefinition f)protected voidcheckInputParams(JudgmentDescription judgmentDescription)voidcheckJudgmentDescription(JudgmentDescription judgmentDescription)voidcheckJudgmentDescriptionRules(JudgmentDescription judgmentDescription)protected voidcheckNumOfOutputParams(JudgmentDescription judgmentDescription)voidcheckOutputParamAccessWithinClosure(org.eclipse.xtext.xbase.XFeatureCall featureCall)voidcheckReturn(org.eclipse.xtext.xbase.XReturnExpression expr)voidcheckRule(Rule rule)voidcheckRuleInvocation(RuleInvocation ruleInvocation)voidcheckSystem(XsemanticsSystem system)voidcheckThrow(org.eclipse.xtext.xbase.XThrowExpression expr)voidcheckVariableDeclaration(org.eclipse.xtext.xbase.XVariableDeclaration declaration)protected voidensureNotPrimitive(org.eclipse.xtext.common.types.JvmTypeReference typeRef)protected booleanisContainedInAuxiliaryFunction(org.eclipse.xtext.xbase.XExpression expr)booleanisEnableWarnings()protected booleanisLocallyUsed(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EObject containerToFindUsage)protected booleanisValueExpectedRecursive(org.eclipse.xtext.xbase.XExpression expr)protected java.lang.StringjudgmentRepresentation(java.lang.String judgmentSymbol, java.lang.Iterable<java.lang.String> relationSymbols)protected java.lang.StringreportContainingSystemName(org.eclipse.emf.ecore.EObject object)voidsetEnableWarnings(boolean enableWarnings)protected java.lang.StringtupleTypeRepresentation(TupleType tupleType)-
Methods inherited from class org.eclipse.xsemantics.dsl.validation.AbstractXsemanticsValidator
getEPackages
-
Methods inherited from class org.eclipse.xtext.xbase.annotations.validation.XbaseWithAnnotationsValidator
checkAllAttributesConfigured
-
Methods inherited from class org.eclipse.xtext.xbase.validation.XbaseValidator
addImportUnusedIssues, canonicalName, checkAssignment, checkAssignment, checkAssignment, checkAssignment, checkCast, checkCasts, checkCatchClausesOrder, checkClosureParameterTypes, checkClosureParams, checkConflicts, checkConstructorArgumentsAreValid, checkDelegateConstructorIsFirst, checkDeprecated, checkDeprecated, checkDeprecated, checkDeprecated, checkDeprecated, checkDeprecated, checkDuplicatedCases, checkExplicitOperationCall, checkExplicitOperationCall, checkExplicitOperationCall, checkFinalFieldInitialization, checkImports, checkIncompleteCasesOnEnum, checkInitializationRec, checkInnerExpressions, checkInstanceOf, checkInstanceOfOrder, checkIsValidConstructorArgument, checkLocalUsageOfDeclared, checkLocalUsageOfSwitchParameter, checkNoCircularConstructorCall, checkNoForwardReferences, checkNoJavaStyleTypeCasting, checkNoJavaStyleTypeCasting, checkNumberFormat, checkOperandTypesForTripleEquals, checkPrimitiveComparedToNull, checkRedundantCase, checkReferInvalidTypes, checkReferInvalidTypes, checkReferInvalidTypes, checkTypeArguments, checkTypeArguments, checkTypeGuards, checkTypeGuardsOrder, checkTypeGuardsOrderWithGenerics, checkTypeLiteral, checkTypeParameterConstraintIsValid, checkTypeParameterNotUsedInStaticContext, checkTypeReferenceIsNotVoid, checkTypeReferenceIsNotVoid, checkTypes, checkVariableIsNotInferredAsVoid, containsTypeArgs, doCheckTypeParameterForwardReference, ensureNotPrimitiveNorWildcard, getActualType, getActualType, getActualType, getExpectedType, getExpressionHelper, getFirstLeafNode, getLogicalContainerProvider, getNameOfTypes, getNode, getReferInvalidTypeMessage, getServices, hasConstructorCallWithThis, isFinal, isHandled, isHidden, isInitialized, isInterface, isLocalClassSemantics, isLocalType, isPrimitiveVoid, isSemicolon, isStaticContext, isTripleEqualsOperation, isXExpressionInsideBlock, memberOfTypeHierarchy, mustBeJavaStatementExpression, populateMaps, reportFieldAlreadyInitialized, reportUninitializedField, reportUninitializedField, toLightweightTypeReference, toLightweightTypeReference
-
Methods inherited from class org.eclipse.xtext.validation.AbstractDeclarativeValidator
acceptError, acceptError, acceptInfo, acceptInfo, acceptWarning, acceptWarning, addIssue, addIssue, addIssue, addIssue, addIssue, addIssueToState, checkDone, checkIsFromCurrentlyCheckedResource, createDiagnostic, createDiagnostic, createMethodWrapper, error, error, error, error, error, error, error, error, getCancelIndicator, getChain, getCheckMode, getContext, getCurrentMethod, getCurrentObject, getIssueSeverities, getMessageAcceptor, guard, handleExceptionDuringValidation, info, info, info, info, info, info, info, info, internalValidate, isIgnored, newInstance, setInjector, setMessageAcceptor, toDiagnosticSeverity, warning, warning, warning, warning, warning, warning, warning, warning
-
-
-
-
Field Detail
-
typeSystem
@Inject protected XsemanticsTypeSystem typeSystem
-
_xsemanticsUtils
@Inject @Extension protected XsemanticsUtils _xsemanticsUtils
-
xExpressionHelper
@Inject protected XsemanticsXExpressionHelper xExpressionHelper
-
nodeModelUtils
@Inject protected XsemanticsNodeModelUtils nodeModelUtils
-
maxOfOutputParams
public static final int maxOfOutputParams
- See Also:
- Constant Field Values
-
enableWarnings
protected boolean enableWarnings
-
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
DUPLICATE_JUDGMENT_DESCRIPTION_SYMBOLS
public static final java.lang.String DUPLICATE_JUDGMENT_DESCRIPTION_SYMBOLS
- See Also:
- Constant Field Values
-
NO_JUDGMENT_DESCRIPTION
public static final java.lang.String NO_JUDGMENT_DESCRIPTION
- See Also:
- Constant Field Values
-
NOT_SUBTYPE
public static final java.lang.String NOT_SUBTYPE
- See Also:
- Constant Field Values
-
DUPLICATE_RULE_WITH_SAME_ARGUMENTS
public static final java.lang.String DUPLICATE_RULE_WITH_SAME_ARGUMENTS
- See Also:
- Constant Field Values
-
DUPLICATE_AUXFUN_WITH_SAME_ARGUMENTS
public static final java.lang.String DUPLICATE_AUXFUN_WITH_SAME_ARGUMENTS
- See Also:
- Constant Field Values
-
MUST_OVERRIDE
public static final java.lang.String MUST_OVERRIDE
- See Also:
- Constant Field Values
-
DUPLICATE_NAME
public static final java.lang.String DUPLICATE_NAME
- See Also:
- Constant Field Values
-
NOT_VALIDATOR
public static final java.lang.String NOT_VALIDATOR
- See Also:
- Constant Field Values
-
NOT_PARAMETER
public static final java.lang.String NOT_PARAMETER
- See Also:
- Constant Field Values
-
NOT_VALID_OUTPUT_ARG
public static final java.lang.String NOT_VALID_OUTPUT_ARG
- See Also:
- Constant Field Values
-
NOT_VALID_INPUT_ARG
public static final java.lang.String NOT_VALID_INPUT_ARG
- See Also:
- Constant Field Values
-
TOO_MANY_OUTPUT_PARAMS
public static final java.lang.String TOO_MANY_OUTPUT_PARAMS
- See Also:
- Constant Field Values
-
NO_INPUT_PARAM
public static final java.lang.String NO_INPUT_PARAM
- See Also:
- Constant Field Values
-
ASSIGNMENT_TO_INPUT_PARAM
public static final java.lang.String ASSIGNMENT_TO_INPUT_PARAM
- See Also:
- Constant Field Values
-
NO_RULE_FOR_JUDGMENT_DESCRIPTION
public static final java.lang.String NO_RULE_FOR_JUDGMENT_DESCRIPTION
- See Also:
- Constant Field Values
-
NO_AUXFUN_FOR_AUX_DESCRIPTION
public static final java.lang.String NO_AUXFUN_FOR_AUX_DESCRIPTION
- See Also:
- Constant Field Values
-
RETURN_NOT_ALLOWED
public static final java.lang.String RETURN_NOT_ALLOWED
- See Also:
- Constant Field Values
-
THROW_NOT_ALLOWED
public static final java.lang.String THROW_NOT_ALLOWED
- See Also:
- Constant Field Values
-
NOT_VALID_SUPER_SYSTEM
public static final java.lang.String NOT_VALID_SUPER_SYSTEM
- See Also:
- Constant Field Values
-
CYCLIC_HIERARCHY
public static final java.lang.String CYCLIC_HIERARCHY
- See Also:
- Constant Field Values
-
EXTENDS_CANNOT_COEXIST_WITH_VALIDATOR_EXTENDS
public static final java.lang.String EXTENDS_CANNOT_COEXIST_WITH_VALIDATOR_EXTENDS
- See Also:
- Constant Field Values
-
OVERRIDE_WITHOUT_SYSTEM_EXTENDS
public static final java.lang.String OVERRIDE_WITHOUT_SYSTEM_EXTENDS
- See Also:
- Constant Field Values
-
NOTHING_TO_OVERRIDE
public static final java.lang.String NOTHING_TO_OVERRIDE
- See Also:
- Constant Field Values
-
DUPLICATE_AUXILIARY_NAME
public static final java.lang.String DUPLICATE_AUXILIARY_NAME
- See Also:
- Constant Field Values
-
NO_AUXDESC_FOR_AUX_FUNCTION
public static final java.lang.String NO_AUXDESC_FOR_AUX_FUNCTION
- See Also:
- Constant Field Values
-
PARAMS_SIZE_DONT_MATCH
public static final java.lang.String PARAMS_SIZE_DONT_MATCH
- See Also:
- Constant Field Values
-
ACCESS_TO_OUTPUT_PARAM_WITHIN_CLOSURE
public static final java.lang.String ACCESS_TO_OUTPUT_PARAM_WITHIN_CLOSURE
- See Also:
- Constant Field Values
-
RESERVED_VARIABLE_NAME
public static final java.lang.String RESERVED_VARIABLE_NAME
- See Also:
- Constant Field Values
-
FINAL_FIELD_NOT_INITIALIZED
public static final java.lang.String FINAL_FIELD_NOT_INITIALIZED
- See Also:
- Constant Field Values
-
TOO_LITTLE_TYPE_INFORMATION
public static final java.lang.String TOO_LITTLE_TYPE_INFORMATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
checkAssignment
public void checkAssignment(org.eclipse.xtext.xbase.XAssignment assignment)
- Overrides:
checkAssignmentin classorg.eclipse.xtext.xbase.validation.XbaseValidator
-
checkReturn
public void checkReturn(org.eclipse.xtext.xbase.XReturnExpression expr)
- Overrides:
checkReturnin classorg.eclipse.xtext.xbase.validation.XbaseValidator
-
checkVariableDeclaration
public void checkVariableDeclaration(org.eclipse.xtext.xbase.XVariableDeclaration declaration)
- Overrides:
checkVariableDeclarationin classorg.eclipse.xtext.xbase.validation.XbaseValidator
-
isContainedInAuxiliaryFunction
protected boolean isContainedInAuxiliaryFunction(org.eclipse.xtext.xbase.XExpression expr)
-
checkThrow
public void checkThrow(org.eclipse.xtext.xbase.XThrowExpression expr)
-
isLocallyUsed
protected boolean isLocallyUsed(org.eclipse.emf.ecore.EObject target, org.eclipse.emf.ecore.EObject containerToFindUsage)- Overrides:
isLocallyUsedin classorg.eclipse.xtext.xbase.validation.XbaseValidator
-
isValueExpectedRecursive
protected boolean isValueExpectedRecursive(org.eclipse.xtext.xbase.XExpression expr)
- Overrides:
isValueExpectedRecursivein classorg.eclipse.xtext.xbase.validation.XbaseValidator
-
checkJudgmentDescription
public void checkJudgmentDescription(JudgmentDescription judgmentDescription)
-
checkJudgmentDescriptionRules
public void checkJudgmentDescriptionRules(JudgmentDescription judgmentDescription)
-
checkNumOfOutputParams
protected void checkNumOfOutputParams(JudgmentDescription judgmentDescription)
-
checkInputParams
protected void checkInputParams(JudgmentDescription judgmentDescription)
-
checkRule
public void checkRule(Rule rule)
-
checkRuleInvocation
public void checkRuleInvocation(RuleInvocation ruleInvocation)
-
checkSystem
public void checkSystem(XsemanticsSystem system)
-
checkAuxiliaryDescription
public void checkAuxiliaryDescription(AuxiliaryDescription aux)
-
checkAuxiliaryFunctionHasAuxiliaryDescription
public void checkAuxiliaryFunctionHasAuxiliaryDescription(AuxiliaryFunction aux)
-
checkOutputParamAccessWithinClosure
public void checkOutputParamAccessWithinClosure(org.eclipse.xtext.xbase.XFeatureCall featureCall)
-
ensureNotPrimitive
protected void ensureNotPrimitive(org.eclipse.xtext.common.types.JvmTypeReference typeRef)
-
checkFieldInitialization
public void checkFieldInitialization(FieldDefinition f)
-
checkConformanceOfAuxiliaryFunction
protected void checkConformanceOfAuxiliaryFunction(AuxiliaryFunction aux, AuxiliaryDescription auxiliaryDescription)
-
reportContainingSystemName
protected java.lang.String reportContainingSystemName(org.eclipse.emf.ecore.EObject object)
-
checkConformance
protected void checkConformance(JudgmentParameter judgmentParameter, org.eclipse.emf.ecore.EObject element, java.lang.String elementDescription, org.eclipse.emf.ecore.EStructuralFeature feature)
-
judgmentRepresentation
protected java.lang.String judgmentRepresentation(java.lang.String judgmentSymbol, java.lang.Iterable<java.lang.String> relationSymbols)
-
tupleTypeRepresentation
protected java.lang.String tupleTypeRepresentation(TupleType tupleType)
-
isEnableWarnings
public boolean isEnableWarnings()
-
setEnableWarnings
public void setEnableWarnings(boolean enableWarnings)
-
-