org.eclipse.xtext.parser.antlr
Class UnorderedGroupHelper

java.lang.Object
  extended by org.eclipse.xtext.parser.antlr.UnorderedGroupHelper
All Implemented Interfaces:
IUnorderedGroupHelper

public class UnorderedGroupHelper
extends java.lang.Object
implements IUnorderedGroupHelper

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
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
UnorderedGroupHelper(UnorderedGroupHelper.Collector collector)
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 interface IUnorderedGroupHelper

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 interface IUnorderedGroupHelper

leave

public void leave(UnorderedGroup group)
Description copied from interface: IUnorderedGroupHelper
Leave the group. May not be called before enter.

Specified by:
leave in interface IUnorderedGroupHelper

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 interface IUnorderedGroupHelper

select

public void select(UnorderedGroup group,
                   int index)
Description copied from interface: IUnorderedGroupHelper
Announce the usage of the given alternative.

Specified by:
select in interface IUnorderedGroupHelper

returnFromSelection

public void returnFromSelection(UnorderedGroup group)
Description copied from interface: IUnorderedGroupHelper
Finish the previously selected alternative.

Specified by:
returnFromSelection in interface IUnorderedGroupHelper

canLeave

public boolean canLeave(UnorderedGroup group)
Description copied from interface: IUnorderedGroupHelper
Query for remaining mandatory alternatives.

Specified by:
canLeave in interface IUnorderedGroupHelper

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 interface IUnorderedGroupHelper

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object