org.antlr.test
Class TestDFAConversion
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.antlr.test.BaseTest
org.antlr.test.TestDFAConversion
- All Implemented Interfaces:
- junit.framework.Test
public class TestDFAConversion
- extends BaseTest
Method Summary |
void |
_template()
|
protected void |
assertNonLLStar(Grammar g,
java.util.List expectedBadAlts)
|
protected void |
assertRecursionOverflow(Grammar g,
java.util.List expectedTargetRules,
int expectedAlt)
|
protected void |
checkDecision(Grammar g,
int decision,
java.lang.String expecting,
int[] expectingUnreachableAlts,
int[] expectingNonDetAlts,
java.lang.String expectingAmbigInput,
int[] expectingDanglingAlts,
int expectingNumWarnings)
|
protected GrammarDanglingStateMessage |
getDanglingStateMessage(java.util.List warnings)
|
protected LeftRecursionCyclesMessage |
getLeftRecursionCyclesMessage(java.util.List warnings)
|
protected GrammarNonDeterminismMessage |
getNonDeterminismMessage(java.util.List warnings)
|
protected NonRegularDecisionMessage |
getNonRegularDecisionMessage(java.util.List errors)
|
protected RecursionOverflowMessage |
getRecursionOverflowMessage(java.util.List warnings)
|
protected java.util.Set<java.lang.String> |
ruleNames(java.util.Set<Rule> rules)
|
protected java.util.Set<java.lang.String> |
ruleNames2(java.util.Collection<java.util.HashSet> rules)
|
protected java.lang.String |
str(int[] elements)
|
void |
testA()
|
void |
testAB_or_AC_k1()
|
void |
testAB_or_AC_k2()
|
void |
testAB_or_AC()
|
void |
testAOptional()
|
void |
testAorBorCOptional()
|
void |
testAorBorCPlus()
|
void |
testAorBorCStar()
|
void |
testAOrBPlusOrAPlus()
|
void |
testAPlus()
|
void |
testAPlusGreedyWhenNonDeterministic()
|
void |
testAPlusNonGreedyWhenDeterministic()
|
void |
testAPlusNonGreedyWhenNonDeterministic()
|
void |
testAStar_immediateTailRecursion()
|
void |
testAStar_immediateTailRecursion2()
|
void |
testAStar()
|
void |
testAStarBOrAPlusC()
|
void |
testAStarBOrAStarC()
|
void |
testAutoBacktrackResolvesRecursion()
|
void |
testAutoBacktrackResolvesRecursionInLexer()
|
void |
testCannotSeePastRecursion()
|
void |
testComplement()
|
void |
testComplementChar()
|
void |
testComplementCharSet()
|
void |
testComplementToken()
|
void |
testCycleInsideRuleDoesNotForceInfiniteRecursion()
|
void |
testCyclicTableCreation()
|
void |
testDoubleInvokeRuleLeftEdge()
|
void |
testFollowReturnsToLoopReenteringSameRule()
|
void |
testGatedSynPred()
|
void |
testHoistedGatedSynPred()
|
void |
testifThenElse()
|
void |
testifThenElseChecksStackSuffixConflict()
|
void |
testimmediateLeftRecursion()
|
void |
testimmediateTailRecursion()
|
void |
testIndirectIFThenElseStyleAmbig()
|
void |
testIndirectLeftRecursion()
|
void |
testIndirectRecursionAmbigAlts()
|
void |
testIndirectRecursionLoop()
|
void |
testIndirectRecursionLoop2()
|
void |
testIndirectRecursionLoop3()
|
void |
testInvokeRule()
|
void |
testLeftRecursionInMultipleCycles()
|
void |
testLoopbackAndExit()
|
void |
testMultipleAltsSameSequenceCollision()
|
void |
testMultipleSequenceCollision()
|
void |
testNoSetCollapseWithActions()
|
void |
testNoStartRule()
|
void |
testOptionalAltAndBypass()
|
void |
testRecursionOverflow()
|
void |
testRecursionOverflow2()
|
void |
testRecursionOverflowWithPredOk()
|
void |
testRecursionOverflowWithPredOk2()
|
void |
testResolveLL1ByChoosingFirst()
|
void |
testResolveLL2ByChoosingFirst()
|
void |
testResolveLL2MixAlt()
|
void |
testRuleAltsSetCollapse()
|
void |
testselfRecurseNonDet()
|
void |
testselfRecurseNonDet2()
|
void |
testSelfRecursionAmbigAlts()
|
void |
testSemPredResolvesRecursion()
|
void |
testSemPredResolvesRecursion2()
|
void |
testSemPredResolvesRecursion3()
|
void |
testSynPredResolvesRecursion()
|
void |
testSynPredResolvesRecursion2()
|
void |
testSynPredResolvesRecursion3()
|
void |
testSynPredResolvesRecursion4()
|
void |
testSynPredResolvesRecursionInLexer()
|
void |
testTailRecursionInvokedFromArbitraryLookaheadDecision()
|
void |
testTokenCallsAnotherOnLeftEdge()
|
void |
testTokensRuleAltsDoNotCollapse()
|
void |
testWildcardPlusK1AndNonGreedyByDefaultInParser()
|
void |
testWildcardStarK1AndNonGreedyByDefaultInParser()
|
Methods inherited from class org.antlr.test.BaseTest |
antlr, checkGrammarSemanticsError, checkGrammarSemanticsWarning, compile, eraseFiles, execLexer, execParser, execTreeParser, execTreeParser, getFirstLineOfException, mkdir, newTool, newTool, rawExecRecognizer, rawGenerateAndBuildRecognizer, realElements, realElements, setUp, writeFile, writeLexerTestFile, writeTemplateTestFile, writeTestFile, writeTreeAndTreeTestFile, writeTreeTestFile |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TestDFAConversion
public TestDFAConversion()
testA
public void testA()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAB_or_AC
public void testAB_or_AC()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAB_or_AC_k2
public void testAB_or_AC_k2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAB_or_AC_k1
public void testAB_or_AC_k1()
throws java.lang.Exception
- Throws:
java.lang.Exception
testselfRecurseNonDet
public void testselfRecurseNonDet()
throws java.lang.Exception
- Throws:
java.lang.Exception
testRecursionOverflow
public void testRecursionOverflow()
throws java.lang.Exception
- Throws:
java.lang.Exception
testRecursionOverflow2
public void testRecursionOverflow2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testRecursionOverflowWithPredOk
public void testRecursionOverflowWithPredOk()
throws java.lang.Exception
- Throws:
java.lang.Exception
testRecursionOverflowWithPredOk2
public void testRecursionOverflowWithPredOk2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testCannotSeePastRecursion
public void testCannotSeePastRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSynPredResolvesRecursion
public void testSynPredResolvesRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSemPredResolvesRecursion
public void testSemPredResolvesRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSemPredResolvesRecursion2
public void testSemPredResolvesRecursion2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSemPredResolvesRecursion3
public void testSemPredResolvesRecursion3()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSynPredResolvesRecursion2
public void testSynPredResolvesRecursion2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSynPredResolvesRecursion3
public void testSynPredResolvesRecursion3()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSynPredResolvesRecursion4
public void testSynPredResolvesRecursion4()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSynPredResolvesRecursionInLexer
public void testSynPredResolvesRecursionInLexer()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAutoBacktrackResolvesRecursionInLexer
public void testAutoBacktrackResolvesRecursionInLexer()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAutoBacktrackResolvesRecursion
public void testAutoBacktrackResolvesRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testselfRecurseNonDet2
public void testselfRecurseNonDet2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testIndirectRecursionLoop
public void testIndirectRecursionLoop()
throws java.lang.Exception
- Throws:
java.lang.Exception
testIndirectRecursionLoop2
public void testIndirectRecursionLoop2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testIndirectRecursionLoop3
public void testIndirectRecursionLoop3()
throws java.lang.Exception
- Throws:
java.lang.Exception
testifThenElse
public void testifThenElse()
throws java.lang.Exception
- Throws:
java.lang.Exception
testifThenElseChecksStackSuffixConflict
public void testifThenElseChecksStackSuffixConflict()
throws java.lang.Exception
- Throws:
java.lang.Exception
testInvokeRule
public void testInvokeRule()
throws java.lang.Exception
- Throws:
java.lang.Exception
testDoubleInvokeRuleLeftEdge
public void testDoubleInvokeRuleLeftEdge()
throws java.lang.Exception
- Throws:
java.lang.Exception
testimmediateTailRecursion
public void testimmediateTailRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAStar_immediateTailRecursion
public void testAStar_immediateTailRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testNoStartRule
public void testNoStartRule()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAStar_immediateTailRecursion2
public void testAStar_immediateTailRecursion2()
throws java.lang.Exception
- Throws:
java.lang.Exception
testimmediateLeftRecursion
public void testimmediateLeftRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testIndirectLeftRecursion
public void testIndirectLeftRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testLeftRecursionInMultipleCycles
public void testLeftRecursionInMultipleCycles()
throws java.lang.Exception
- Throws:
java.lang.Exception
testCycleInsideRuleDoesNotForceInfiniteRecursion
public void testCycleInsideRuleDoesNotForceInfiniteRecursion()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAStar
public void testAStar()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAorBorCStar
public void testAorBorCStar()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAPlus
public void testAPlus()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAPlusNonGreedyWhenDeterministic
public void testAPlusNonGreedyWhenDeterministic()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAPlusNonGreedyWhenNonDeterministic
public void testAPlusNonGreedyWhenNonDeterministic()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAPlusGreedyWhenNonDeterministic
public void testAPlusGreedyWhenNonDeterministic()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAorBorCPlus
public void testAorBorCPlus()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAOptional
public void testAOptional()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAorBorCOptional
public void testAorBorCOptional()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAStarBOrAStarC
public void testAStarBOrAStarC()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAStarBOrAPlusC
public void testAStarBOrAPlusC()
throws java.lang.Exception
- Throws:
java.lang.Exception
testAOrBPlusOrAPlus
public void testAOrBPlusOrAPlus()
throws java.lang.Exception
- Throws:
java.lang.Exception
testLoopbackAndExit
public void testLoopbackAndExit()
throws java.lang.Exception
- Throws:
java.lang.Exception
testOptionalAltAndBypass
public void testOptionalAltAndBypass()
throws java.lang.Exception
- Throws:
java.lang.Exception
testResolveLL1ByChoosingFirst
public void testResolveLL1ByChoosingFirst()
throws java.lang.Exception
- Throws:
java.lang.Exception
testResolveLL2ByChoosingFirst
public void testResolveLL2ByChoosingFirst()
throws java.lang.Exception
- Throws:
java.lang.Exception
testResolveLL2MixAlt
public void testResolveLL2MixAlt()
throws java.lang.Exception
- Throws:
java.lang.Exception
testIndirectIFThenElseStyleAmbig
public void testIndirectIFThenElseStyleAmbig()
throws java.lang.Exception
- Throws:
java.lang.Exception
testComplement
public void testComplement()
throws java.lang.Exception
- Throws:
java.lang.Exception
testComplementToken
public void testComplementToken()
throws java.lang.Exception
- Throws:
java.lang.Exception
testComplementChar
public void testComplementChar()
throws java.lang.Exception
- Throws:
java.lang.Exception
testComplementCharSet
public void testComplementCharSet()
throws java.lang.Exception
- Throws:
java.lang.Exception
testNoSetCollapseWithActions
public void testNoSetCollapseWithActions()
throws java.lang.Exception
- Throws:
java.lang.Exception
testRuleAltsSetCollapse
public void testRuleAltsSetCollapse()
throws java.lang.Exception
- Throws:
java.lang.Exception
testTokensRuleAltsDoNotCollapse
public void testTokensRuleAltsDoNotCollapse()
throws java.lang.Exception
- Throws:
java.lang.Exception
testMultipleSequenceCollision
public void testMultipleSequenceCollision()
throws java.lang.Exception
- Throws:
java.lang.Exception
testMultipleAltsSameSequenceCollision
public void testMultipleAltsSameSequenceCollision()
throws java.lang.Exception
- Throws:
java.lang.Exception
testFollowReturnsToLoopReenteringSameRule
public void testFollowReturnsToLoopReenteringSameRule()
throws java.lang.Exception
- Throws:
java.lang.Exception
testTokenCallsAnotherOnLeftEdge
public void testTokenCallsAnotherOnLeftEdge()
throws java.lang.Exception
- Throws:
java.lang.Exception
testSelfRecursionAmbigAlts
public void testSelfRecursionAmbigAlts()
throws java.lang.Exception
- Throws:
java.lang.Exception
testIndirectRecursionAmbigAlts
public void testIndirectRecursionAmbigAlts()
throws java.lang.Exception
- Throws:
java.lang.Exception
testTailRecursionInvokedFromArbitraryLookaheadDecision
public void testTailRecursionInvokedFromArbitraryLookaheadDecision()
throws java.lang.Exception
- Throws:
java.lang.Exception
testWildcardStarK1AndNonGreedyByDefaultInParser
public void testWildcardStarK1AndNonGreedyByDefaultInParser()
throws java.lang.Exception
- Throws:
java.lang.Exception
testWildcardPlusK1AndNonGreedyByDefaultInParser
public void testWildcardPlusK1AndNonGreedyByDefaultInParser()
throws java.lang.Exception
- Throws:
java.lang.Exception
testGatedSynPred
public void testGatedSynPred()
throws java.lang.Exception
- Throws:
java.lang.Exception
testHoistedGatedSynPred
public void testHoistedGatedSynPred()
throws java.lang.Exception
- Throws:
java.lang.Exception
testCyclicTableCreation
public void testCyclicTableCreation()
throws java.lang.Exception
- Throws:
java.lang.Exception
_template
public void _template()
throws java.lang.Exception
- Throws:
java.lang.Exception
assertNonLLStar
protected void assertNonLLStar(Grammar g,
java.util.List expectedBadAlts)
assertRecursionOverflow
protected void assertRecursionOverflow(Grammar g,
java.util.List expectedTargetRules,
int expectedAlt)
checkDecision
protected void checkDecision(Grammar g,
int decision,
java.lang.String expecting,
int[] expectingUnreachableAlts,
int[] expectingNonDetAlts,
java.lang.String expectingAmbigInput,
int[] expectingDanglingAlts,
int expectingNumWarnings)
throws java.lang.Exception
- Throws:
java.lang.Exception
getNonDeterminismMessage
protected GrammarNonDeterminismMessage getNonDeterminismMessage(java.util.List warnings)
getNonRegularDecisionMessage
protected NonRegularDecisionMessage getNonRegularDecisionMessage(java.util.List errors)
getRecursionOverflowMessage
protected RecursionOverflowMessage getRecursionOverflowMessage(java.util.List warnings)
getLeftRecursionCyclesMessage
protected LeftRecursionCyclesMessage getLeftRecursionCyclesMessage(java.util.List warnings)
getDanglingStateMessage
protected GrammarDanglingStateMessage getDanglingStateMessage(java.util.List warnings)
str
protected java.lang.String str(int[] elements)
ruleNames
protected java.util.Set<java.lang.String> ruleNames(java.util.Set<Rule> rules)
ruleNames2
protected java.util.Set<java.lang.String> ruleNames2(java.util.Collection<java.util.HashSet> rules)