Package org.antlr.gunit

## Class JUnitCodeGen

- java.lang.Object
- - org.antlr.gunit.JUnitCodeGen

    public class JUnitCodeGen
    extends java.lang.Object

### Field Summary

Fields
`GrammarInfo` `grammarInfo`
`java.util.Map<java.lang.String,java.lang.String>` `ruleWithReturn`

### Constructor Summary

Constructors
`JUnitCodeGen​(GrammarInfo grammarInfo, java.lang.ClassLoader classLoader, java.lang.String testsuiteDir)`
`JUnitCodeGen​(GrammarInfo grammarInfo, java.lang.String testsuiteDir)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected java.lang.String` `changeFirstCapital​(java.lang.String ruleName)`
`void` `compile​()`
`java.lang.StringBuffer` `compileToBuffer​(java.lang.String className, java.lang.String lexerName, java.lang.String parserName)`
`static java.lang.String` `escapeForJava​(java.lang.String inputString)`
`protected java.lang.String` `genClassHeader​(org.antlr.stringtemplate.StringTemplateGroup group, java.lang.String junitFileName, java.lang.String lexerName, java.lang.String parserName)`
`protected java.lang.String` `genTestRuleMethods​(org.antlr.stringtemplate.StringTemplateGroup group)`
`java.lang.String` `getOutputDirectoryPath​()`
`java.lang.String` `getTypeString​(int type)`
`static java.lang.String` `normalizeTreeSpec​(java.lang.String t)`
`void` `setOutputDirectoryPath​(java.lang.String outputDirectoryPath)`
`protected void` `writeTestFile​(java.lang.String dir, java.lang.String fileName, java.lang.String content)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### grammarInfo

    public GrammarInfo grammarInfo

#### ruleWithReturn

    public java.util.Map<java.lang.String,java.lang.String> ruleWithReturn

### Constructor Detail

#### JUnitCodeGen

    public JUnitCodeGen​(GrammarInfo grammarInfo,
                        java.lang.String testsuiteDir)
                 throws java.lang.ClassNotFoundException

Throws:
  `java.lang.ClassNotFoundException`

#### JUnitCodeGen

    public JUnitCodeGen​(GrammarInfo grammarInfo,
                        java.lang.ClassLoader classLoader,
                        java.lang.String testsuiteDir)
                 throws java.lang.ClassNotFoundException

Throws:
  `java.lang.ClassNotFoundException`

### Method Detail

#### getOutputDirectoryPath

    public java.lang.String getOutputDirectoryPath​()

#### setOutputDirectoryPath

    public void setOutputDirectoryPath​(java.lang.String outputDirectoryPath)

#### compile

    public void compile​()
                 throws java.io.IOException

Throws:
  `java.io.IOException`

#### compileToBuffer

    public java.lang.StringBuffer compileToBuffer​(java.lang.String className,
                                                  java.lang.String lexerName,
                                                  java.lang.String parserName)

#### genClassHeader

    protected java.lang.String genClassHeader​(org.antlr.stringtemplate.StringTemplateGroup group,
                                              java.lang.String junitFileName,
                                              java.lang.String lexerName,
                                              java.lang.String parserName)

#### genTestRuleMethods

    protected java.lang.String genTestRuleMethods​(org.antlr.stringtemplate.StringTemplateGroup group)

#### getTypeString

    public java.lang.String getTypeString​(int type)

#### writeTestFile

    protected void writeTestFile​(java.lang.String dir,
                                 java.lang.String fileName,
                                 java.lang.String content)

#### escapeForJava

    public static java.lang.String escapeForJava​(java.lang.String inputString)

#### changeFirstCapital

    protected java.lang.String changeFirstCapital​(java.lang.String ruleName)

#### normalizeTreeSpec

    public static java.lang.String normalizeTreeSpec​(java.lang.String t)