org.eclipse.xtext.xtext
Class ValidEntryRuleInspector

java.lang.Object
  extended by org.eclipse.xtext.util.XtextSwitch<Result>
      extended by org.eclipse.xtext.xtext.XtextRuleInspector<Pair<java.lang.Boolean,java.lang.Boolean>,ParserRule>
          extended by org.eclipse.xtext.xtext.ValidEntryRuleInspector

public class ValidEntryRuleInspector
extends XtextRuleInspector<Pair<java.lang.Boolean,java.lang.Boolean>,ParserRule>

Checks the entry rule for validity. A rule is considered to be a valid entry rule if it either accepts the empty input or if it ensures that a model is instantiated.

Author:
Sebastian Zarnekow - Initial contribution and API

Field Summary
 
Fields inherited from class org.eclipse.xtext.util.XtextSwitch
modelPackage
 
Constructor Summary
ValidEntryRuleInspector(ValidationMessageAcceptor acceptor)
           
 
Method Summary
protected  boolean canInspect(ParserRule rule)
           
 Pair<java.lang.Boolean,java.lang.Boolean> caseAbstractElement(AbstractElement object)
          Returns the result of interpreting the object as an instance of 'Abstract Element'
 Pair<java.lang.Boolean,java.lang.Boolean> caseAction(Action object)
          Returns the result of interpreting the object as an instance of 'Action'
 Pair<java.lang.Boolean,java.lang.Boolean> caseAlternatives(Alternatives object)
          Returns the result of interpreting the object as an instance of 'Alternatives'
 Pair<java.lang.Boolean,java.lang.Boolean> caseAssignment(Assignment object)
          Returns the result of interpreting the object as an instance of 'Assignment'
 Pair<java.lang.Boolean,java.lang.Boolean> caseCompoundElement(CompoundElement object)
          Returns the result of interpreting the object as an instance of 'Compound Element'
 Pair<java.lang.Boolean,java.lang.Boolean> caseRuleCall(RuleCall object)
          Returns the result of interpreting the object as an instance of 'Rule Call'
protected  void handleResult(Pair<java.lang.Boolean,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, caseCharacterRange, caseCrossReference, caseEnumLiteralDeclaration, caseEnumRule, caseEOF, caseGeneratedMetamodel, caseGrammar, caseGroup, caseKeyword, caseNegatedToken, caseParserRule, caseReferencedMetamodel, caseTerminalRule, caseTypeRef, caseUnorderedGroup, caseUntilToken, caseWildcard, defaultCase, doSwitch, doSwitch, doSwitch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidEntryRuleInspector

public ValidEntryRuleInspector(ValidationMessageAcceptor acceptor)
Method Detail

canInspect

protected boolean canInspect(ParserRule rule)
Overrides:
canInspect in class XtextRuleInspector<Pair<java.lang.Boolean,java.lang.Boolean>,ParserRule>

handleResult

protected void handleResult(Pair<java.lang.Boolean,java.lang.Boolean> r,
                            ParserRule rule)
Overrides:
handleResult in class XtextRuleInspector<Pair<java.lang.Boolean,java.lang.Boolean>,ParserRule>

caseCompoundElement

public Pair<java.lang.Boolean,java.lang.Boolean> caseCompoundElement(CompoundElement object)
Description copied from class: XtextSwitch
Returns 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:
caseCompoundElement in class XtextSwitch<Pair<java.lang.Boolean,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 Pair<java.lang.Boolean,java.lang.Boolean> caseAbstractElement(AbstractElement object)
Description copied from class: XtextSwitch
Returns 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:
caseAbstractElement in class XtextSwitch<Pair<java.lang.Boolean,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 Pair<java.lang.Boolean,java.lang.Boolean> caseAction(Action object)
Description copied from class: XtextSwitch
Returns 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:
caseAction in class XtextSwitch<Pair<java.lang.Boolean,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 Pair<java.lang.Boolean,java.lang.Boolean> caseAlternatives(Alternatives object)
Description copied from class: XtextSwitch
Returns 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:
caseAlternatives in class XtextSwitch<Pair<java.lang.Boolean,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 Pair<java.lang.Boolean,java.lang.Boolean> caseAssignment(Assignment object)
Description copied from class: XtextSwitch
Returns 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:
caseAssignment in class XtextSwitch<Pair<java.lang.Boolean,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 Pair<java.lang.Boolean,java.lang.Boolean> caseRuleCall(RuleCall object)
Description copied from class: XtextSwitch
Returns 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:
caseRuleCall in class XtextSwitch<Pair<java.lang.Boolean,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)