org.antlr.test
Class TestSymbolDefinitions

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

public class TestSymbolDefinitions
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
TestSymbolDefinitions()
          Public default constructor used by TestRig
 
Method Summary
protected  void checkPlusEqualsLabels(Grammar g, java.lang.String ruleName, java.lang.String tokenLabelsStr, java.lang.String ruleLabelsStr)
           
protected  void checkSymbols(Grammar g, java.lang.String rulesStr, java.lang.String tokensStr)
           
 void testBadGrammarOption()
           
 void testBadRuleOption()
           
 void testBadSubRuleOption()
           
 void testCharLiteralInLexerTokensSection()
           
 void testCharLiteralInParserTokensSection()
           
 void testCombinedGrammarLiterals()
           
 void testCombinedGrammarWithRefToLiteralButNoTokenIDRef()
           
 void testCombinedRuleRedefinition()
           
 void testEmptyNotChar()
           
 void testEmptyNotSet()
           
 void testEmptyNotToken()
           
 void testLabelAndArgConflict()
           
 void testLabelAndParameterConflict()
           
 void testLabelAndRuleNameConflict()
           
 void testLabelAndTokenNameConflict()
           
 void testLabelRuleScopeConflict()
           
 void testLexerRuleInParser()
           
 void testLexerRuleRedefinition()
           
 void testLexerTokensSection()
           
 void testLiteralInParserAndLexer()
           
 void testMixedPlusEqualLabel()
           
 void testParserCharLiterals()
           
 void testParserCharLiteralWithEscape()
           
 void testParserRuleInLexer()
           
 void testParserSimpleTokens()
           
 void testParserStringLiterals()
           
 void testParserTokensSection()
           
 void testRefToRuleWithNoReturnValue()
           
 void testRuleLabelScopeConflict()
           
 void testRuleRedefinition()
           
 void testRuleScopeArgConflict()
           
 void testRuleScopeConflict()
           
 void testRuleScopeReturnValueConflict()
           
 void testRuleScopeRuleNameConflict()
           
 void testSetDoesNotMissTokenAliases()
           
 void testSimplePlusEqualLabel()
           
 void testStringLiteralInParserTokensSection()
           
 void testTokenInTokensSectionAndTokenRuleDef()
           
 void testTokenInTokensSectionAndTokenRuleDef2()
           
 void testTokenLabelScopeConflict()
           
 void testTokenRuleScopeConflict()
           
 void testTokenRuleScopeConflictInLexerGrammar()
           
 void testTokenScopeConflict()
           
 void testTokensSectionWithAssignmentSection()
           
 void testTokenVocabStringUsedInCombined()
           
 void testTokenVocabStringUsedInLexer()
           
 void testUndefinedRule()
           
 void testUndefinedToken()
           
 void testUndefinedTokenOkInParser()
           
 
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
 

Constructor Detail

TestSymbolDefinitions

public TestSymbolDefinitions()
Public default constructor used by TestRig

Method Detail

testParserSimpleTokens

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

testParserTokensSection

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

testLexerTokensSection

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

testTokensSectionWithAssignmentSection

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

testCombinedGrammarLiterals

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

testLiteralInParserAndLexer

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

testCombinedGrammarWithRefToLiteralButNoTokenIDRef

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

testSetDoesNotMissTokenAliases

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

testSimplePlusEqualLabel

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

testMixedPlusEqualLabel

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

testParserCharLiteralWithEscape

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

testTokenInTokensSectionAndTokenRuleDef

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

testTokenInTokensSectionAndTokenRuleDef2

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

testRefToRuleWithNoReturnValue

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

testParserStringLiterals

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

testParserCharLiterals

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

testEmptyNotChar

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

testEmptyNotToken

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

testEmptyNotSet

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

testStringLiteralInParserTokensSection

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

testCharLiteralInParserTokensSection

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

testCharLiteralInLexerTokensSection

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

testRuleRedefinition

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

testLexerRuleRedefinition

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

testCombinedRuleRedefinition

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

testUndefinedToken

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

testUndefinedTokenOkInParser

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

testUndefinedRule

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

testLexerRuleInParser

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

testParserRuleInLexer

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

testRuleScopeConflict

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

testTokenRuleScopeConflict

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

testTokenScopeConflict

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

testTokenRuleScopeConflictInLexerGrammar

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

testTokenLabelScopeConflict

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

testRuleLabelScopeConflict

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

testLabelAndRuleNameConflict

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

testLabelAndTokenNameConflict

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

testLabelAndArgConflict

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

testLabelAndParameterConflict

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

testLabelRuleScopeConflict

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

testRuleScopeArgConflict

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

testRuleScopeReturnValueConflict

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

testRuleScopeRuleNameConflict

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

testBadGrammarOption

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

testBadRuleOption

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

testBadSubRuleOption

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

testTokenVocabStringUsedInLexer

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

testTokenVocabStringUsedInCombined

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

checkPlusEqualsLabels

protected void checkPlusEqualsLabels(Grammar g,
                                     java.lang.String ruleName,
                                     java.lang.String tokenLabelsStr,
                                     java.lang.String ruleLabelsStr)
                              throws java.lang.Exception
Throws:
java.lang.Exception

checkSymbols

protected void checkSymbols(Grammar g,
                            java.lang.String rulesStr,
                            java.lang.String tokensStr)
                     throws java.lang.Exception
Throws:
java.lang.Exception