Package org.eclipse.xtext.parser.antlr
Class UnorderedGroupHelper
- java.lang.Object
-
- org.eclipse.xtext.parser.antlr.UnorderedGroupHelper
-
- All Implemented Interfaces:
IUnorderedGroupHelper
public class UnorderedGroupHelper extends java.lang.Object implements IUnorderedGroupHelper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UnorderedGroupHelper.Collector
protected static class
UnorderedGroupHelper.Frame
protected static class
UnorderedGroupHelper.State
protected class
UnorderedGroupHelper.UnorderedGroupStateImpl
-
Nested classes/interfaces inherited from interface org.eclipse.xtext.parser.antlr.IUnorderedGroupHelper
IUnorderedGroupHelper.Null, IUnorderedGroupHelper.UnorderedGroupState
-
-
Constructor Summary
Constructors Constructor Description UnorderedGroupHelper(UnorderedGroupHelper.Collector collector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canLeave(UnorderedGroup group)
Query for remaining mandatory alternatives.boolean
canSelect(UnorderedGroup group, int index)
Predicate to answer the question whether the given alternative may be used.protected void
configure(UnorderedGroup group)
void
enter(UnorderedGroup group)
Invoke when the group is entered in the parser.protected UnorderedGroupHelper.State
get(UnorderedGroup group)
protected int
getBacktrackingLevel()
protected org.antlr.runtime.BaseRecognizer
getRecognizer()
void
initializeWith(org.antlr.runtime.BaseRecognizer recognizer)
Initializes this helper with the given recognizer.void
leave(UnorderedGroup group)
Leave the group.void
returnFromSelection(UnorderedGroup group)
Finish the previously selected alternative.void
select(UnorderedGroup group, int index)
Announce the usage of the given alternative.IUnorderedGroupHelper.UnorderedGroupState
snapShot(UnorderedGroup... groups)
Obtain the current state to be able to roll-back after backtracking.protected void
snapShotForBacktracking()
java.lang.String
toString()
-
-
-
Constructor Detail
-
UnorderedGroupHelper
@Inject public UnorderedGroupHelper(UnorderedGroupHelper.Collector collector)
-
-
Method Detail
-
initializeWith
public void initializeWith(org.antlr.runtime.BaseRecognizer recognizer)
Description copied from interface:IUnorderedGroupHelper
Initializes this helper with the given recognizer.- Specified by:
initializeWith
in interfaceIUnorderedGroupHelper
-
getRecognizer
protected org.antlr.runtime.BaseRecognizer getRecognizer()
-
configure
protected void configure(UnorderedGroup group)
-
get
protected UnorderedGroupHelper.State get(UnorderedGroup group)
-
snapShotForBacktracking
protected void snapShotForBacktracking()
-
getBacktrackingLevel
protected int getBacktrackingLevel()
-
enter
public void enter(UnorderedGroup group)
Description copied from interface:IUnorderedGroupHelper
Invoke when the group is entered in the parser. Access to any other querying method is answered optimistically.- Specified by:
enter
in interfaceIUnorderedGroupHelper
-
leave
public void leave(UnorderedGroup group)
Description copied from interface:IUnorderedGroupHelper
Leave the group. May not be called before enter.- Specified by:
leave
in interfaceIUnorderedGroupHelper
-
canSelect
public boolean canSelect(UnorderedGroup group, int index)
Description copied from interface:IUnorderedGroupHelper
Predicate to answer the question whether the given alternative may be used.- Specified by:
canSelect
in interfaceIUnorderedGroupHelper
-
select
public void select(UnorderedGroup group, int index)
Description copied from interface:IUnorderedGroupHelper
Announce the usage of the given alternative.- Specified by:
select
in interfaceIUnorderedGroupHelper
-
returnFromSelection
public void returnFromSelection(UnorderedGroup group)
Description copied from interface:IUnorderedGroupHelper
Finish the previously selected alternative.- Specified by:
returnFromSelection
in interfaceIUnorderedGroupHelper
-
canLeave
public boolean canLeave(UnorderedGroup group)
Description copied from interface:IUnorderedGroupHelper
Query for remaining mandatory alternatives.- Specified by:
canLeave
in interfaceIUnorderedGroupHelper
-
snapShot
public IUnorderedGroupHelper.UnorderedGroupState snapShot(UnorderedGroup... groups)
Description copied from interface:IUnorderedGroupHelper
Obtain the current state to be able to roll-back after backtracking.- Specified by:
snapShot
in interfaceIUnorderedGroupHelper
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-