Search in sources :

Example 11 with ISynTransition

use of org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition in project xtext-core by eclipse.

the class SyntacticSequencerPDAProviderNavigatorTest method testAmbiguousManyOptional.

@Test
public void testAmbiguousManyOptional() throws Exception {
    ISynAbsorberState start = getParserRule("Rule: a1=ID 'kw1' 'kw2'* a2=ID;");
    ISynTransition trans = findTransition(start, "a1=ID", "a2=ID");
    assertFalse(trans.involvesUnassignedTokenRuleCalls());
    assertTrue(trans.isSyntacticallyAmbiguous());
    // assertEquals(1, trans.getDistanceWithStackToAbsorber(newStack()));
    assertEquals("['kw1']", trans.getShortestPathToAbsorber(newStack()).toString());
}
Also used : ISynAbsorberState(org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynAbsorberState) ISynTransition(org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition) Test(org.junit.Test)

Aggregations

ISynTransition (org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition)11 ISynAbsorberState (org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynAbsorberState)10 Test (org.junit.Test)8 GrammarElementTitleSwitch (org.eclipse.xtext.grammaranalysis.impl.GrammarElementTitleSwitch)1 RuleCallStack (org.eclipse.xtext.serializer.sequencer.RuleCallStack)1