Package org.eclipse.xtext.xtext
Class RuleWithoutInstantiationInspector
- java.lang.Object
-
- org.eclipse.emf.ecore.util.Switch<T>
-
- org.eclipse.xtext.util.XtextSwitch<Result>
-
- org.eclipse.xtext.xtext.XtextRuleInspector<java.lang.Boolean,ParserRule>
-
- org.eclipse.xtext.xtext.RuleWithoutInstantiationInspector
-
public class RuleWithoutInstantiationInspector extends XtextRuleInspector<java.lang.Boolean,ParserRule>
Checks if a parser rule ensures object instantiation. A rule that can be consumed without instantiating an object or providing an object that was instantiated by another unassigned called rule, is considered to be invalid as it leads to surprises when clients traverse the model.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringISSUE_CODE-
Fields inherited from class org.eclipse.xtext.util.XtextSwitch
modelPackage
-
-
Constructor Summary
Constructors Constructor Description RuleWithoutInstantiationInspector(ValidationMessageAcceptor acceptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanInspect(ParserRule rule)java.lang.BooleancaseAbstractElement(AbstractElement object)Returns the result of interpreting the object as an instance of 'Abstract Element'.java.lang.BooleancaseAction(Action object)Returns the result of interpreting the object as an instance of 'Action'.java.lang.BooleancaseAlternatives(Alternatives object)Returns the result of interpreting the object as an instance of 'Alternatives'.java.lang.BooleancaseAssignment(Assignment object)Returns the result of interpreting the object as an instance of 'Assignment'.java.lang.BooleancaseCompoundElement(CompoundElement object)Returns the result of interpreting the object as an instance of 'Compound Element'.java.lang.BooleancaseRuleCall(RuleCall object)Returns the result of interpreting the object as an instance of 'Rule Call'.protected java.lang.StringgetIssueCode()protected voidhandleResult(java.lang.Boolean r, ParserRule rule)-
Methods inherited from class org.eclipse.xtext.xtext.XtextRuleInspector
acceptError, acceptWarning, addVisited, doInspect, getNestingLevel, getTypeRefName, inspect, removeVisited
-
Methods inherited from class org.eclipse.xtext.util.XtextSwitch
caseAbstractMetamodelDeclaration, caseAbstractNegatedToken, caseAbstractRule, caseAnnotation, caseCharacterRange, caseCompositeCondition, caseCondition, caseConjunction, caseCrossReference, caseDisjunction, caseEnumLiteralDeclaration, caseEnumRule, caseEOF, caseGeneratedMetamodel, caseGrammar, caseGroup, caseKeyword, caseLiteralCondition, caseNamedArgument, caseNegatedToken, caseNegation, caseParameter, caseParameterReference, caseParserRule, caseReferencedMetamodel, caseTerminalRule, caseTypeRef, caseUnorderedGroup, caseUntilToken, caseWildcard, defaultCase, doSwitch, isSwitchFor
-
-
-
-
Field Detail
-
ISSUE_CODE
public static final java.lang.String ISSUE_CODE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RuleWithoutInstantiationInspector
public RuleWithoutInstantiationInspector(ValidationMessageAcceptor acceptor)
-
-
Method Detail
-
getIssueCode
protected java.lang.String getIssueCode()
- Overrides:
getIssueCodein classXtextRuleInspector<java.lang.Boolean,ParserRule>
-
canInspect
protected boolean canInspect(ParserRule rule)
- Overrides:
canInspectin classXtextRuleInspector<java.lang.Boolean,ParserRule>
-
handleResult
protected void handleResult(java.lang.Boolean r, ParserRule rule)- Overrides:
handleResultin classXtextRuleInspector<java.lang.Boolean,ParserRule>
-
caseCompoundElement
public java.lang.Boolean caseCompoundElement(CompoundElement object)
Description copied from class:XtextSwitchReturns the result of interpreting the object as an instance of 'Compound Element'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseCompoundElementin classXtextSwitch<java.lang.Boolean>- Parameters:
object- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Compound Element'.
- See Also:
doSwitch(EObject)
-
caseAbstractElement
public java.lang.Boolean caseAbstractElement(AbstractElement object)
Description copied from class:XtextSwitchReturns the result of interpreting the object as an instance of 'Abstract Element'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseAbstractElementin classXtextSwitch<java.lang.Boolean>- Parameters:
object- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Abstract Element'.
- See Also:
doSwitch(EObject)
-
caseAction
public java.lang.Boolean caseAction(Action object)
Description copied from class:XtextSwitchReturns the result of interpreting the object as an instance of 'Action'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseActionin classXtextSwitch<java.lang.Boolean>- Parameters:
object- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Action'.
- See Also:
doSwitch(EObject)
-
caseAlternatives
public java.lang.Boolean caseAlternatives(Alternatives object)
Description copied from class:XtextSwitchReturns the result of interpreting the object as an instance of 'Alternatives'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseAlternativesin classXtextSwitch<java.lang.Boolean>- Parameters:
object- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Alternatives'.
- See Also:
doSwitch(EObject)
-
caseAssignment
public java.lang.Boolean caseAssignment(Assignment object)
Description copied from class:XtextSwitchReturns the result of interpreting the object as an instance of 'Assignment'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseAssignmentin classXtextSwitch<java.lang.Boolean>- Parameters:
object- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Assignment'.
- See Also:
doSwitch(EObject)
-
caseRuleCall
public java.lang.Boolean caseRuleCall(RuleCall object)
Description copied from class:XtextSwitchReturns the result of interpreting the object as an instance of 'Rule Call'. This implementation returns null; returning a non-null result will terminate the switch.- Overrides:
caseRuleCallin classXtextSwitch<java.lang.Boolean>- Parameters:
object- the target of the switch.- Returns:
- the result of interpreting the object as an instance of 'Rule Call'.
- See Also:
doSwitch(EObject)
-
-