org.antlr.test
Class TestDFAConversion

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.antlr.test.BaseTest
              extended by org.antlr.test.TestDFAConversion
All Implemented Interfaces:
junit.framework.Test

public class TestDFAConversion
extends BaseTest


Nested Class Summary
 
Nested classes/interfaces inherited from class org.antlr.test.BaseTest
BaseTest.StreamVacuum
 
Field Summary
 
Fields inherited from class org.antlr.test.BaseTest
CLASSPATH, jikes, pathSep, stderr, tmpdir
 
Constructor Summary
TestDFAConversion()
           
 
Method Summary
 void _template()
           
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  RecursionOverflowMessage getRecursionOverflowMessage(java.util.List warnings)
           
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 testAPlusNonGreedyWhenDeterministic()
           
 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 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 testResolveLL1ByChoosingFirst()
           
 void testResolveLL2ByChoosingFirst()
           
 void testResolveLL2MixAlt()
           
 void testRuleAltsSetCollapse()
           
 void testselfRecurseNonDet()
           
 void testselfRecurseNonDet2()
           
 void testSelfRecursionAmbigAlts()
           
 void testSynPredResolvesRecursion()
           
 void testSynPredResolvesRecursionInLexer()
           
 void testTailRecursionInvokedFromArbitraryLookaheadDecision()
           
 void testTokenCallsAnotherOnLeftEdge()
           
 void testTokensRuleAltsDoNotCollapse()
           
 void testWildcardPlusK1AndNonGreedyByDefaultInParser()
           
 void testWildcardStarK1AndNonGreedyByDefaultInParser()
           
 
Methods inherited from class org.antlr.test.BaseTest
antlr, compile, eraseFiles, execParser, execTreeParser, execTreeParser, getFirstLineOfException, mkdir, newTool, rawExecRecognizer, rawGenerateAndBuildRecognizer, writeFile, writeTemplateTestFile, writeTestFile, writeTreeTestFile
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, 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
 

Constructor Detail

TestDFAConversion

public TestDFAConversion()
Method Detail

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

testCannotSeePastRecursion

public void testCannotSeePastRecursion()
                                throws java.lang.Exception
Throws:
java.lang.Exception

testSynPredResolvesRecursion

public void testSynPredResolvesRecursion()
                                  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

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

testCyclicTableCreation

public void testCyclicTableCreation()
                             throws java.lang.Exception
Throws:
java.lang.Exception

_template

public void _template()
               throws java.lang.Exception
Throws:
java.lang.Exception

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)

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)