org.antlr.gunit
Class JUnitCodeGen

java.lang.Object
  extended by org.antlr.gunit.JUnitCodeGen

public class JUnitCodeGen
extends Object


Field Summary
 GrammarInfo grammarInfo
           
 Map<String,String> ruleWithReturn
           
 
Constructor Summary
JUnitCodeGen(GrammarInfo grammarInfo, ClassLoader classLoader, String testsuiteDir)
           
JUnitCodeGen(GrammarInfo grammarInfo, String testsuiteDir)
           
 
Method Summary
protected  String changeFirstCapital(String ruleName)
           
 void compile()
           
 StringBuffer compileToBuffer(String className, String lexerName, String parserName)
           
static String escapeForJava(String inputString)
           
protected  String genClassHeader(org.antlr.stringtemplate.StringTemplateGroup group, String junitFileName, String lexerName, String parserName)
           
protected  String genTestRuleMethods(org.antlr.stringtemplate.StringTemplateGroup group)
           
 String getOutputDirectoryPath()
           
 String getTypeString(int type)
           
static String normalizeTreeSpec(String t)
           
 void setOutputDirectoryPath(String outputDirectoryPath)
           
protected  void writeTestFile(String dir, String fileName, 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 Map<String,String> ruleWithReturn
Constructor Detail

JUnitCodeGen

public JUnitCodeGen(GrammarInfo grammarInfo,
                    String testsuiteDir)
             throws ClassNotFoundException
Throws:
ClassNotFoundException

JUnitCodeGen

public JUnitCodeGen(GrammarInfo grammarInfo,
                    ClassLoader classLoader,
                    String testsuiteDir)
             throws ClassNotFoundException
Throws:
ClassNotFoundException
Method Detail

getOutputDirectoryPath

public String getOutputDirectoryPath()

setOutputDirectoryPath

public void setOutputDirectoryPath(String outputDirectoryPath)

compile

public void compile()
             throws IOException
Throws:
IOException

compileToBuffer

public StringBuffer compileToBuffer(String className,
                                    String lexerName,
                                    String parserName)

genClassHeader

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

genTestRuleMethods

protected String genTestRuleMethods(org.antlr.stringtemplate.StringTemplateGroup group)

getTypeString

public String getTypeString(int type)

writeTestFile

protected void writeTestFile(String dir,
                             String fileName,
                             String content)

escapeForJava

public static String escapeForJava(String inputString)

changeFirstCapital

protected String changeFirstCapital(String ruleName)

normalizeTreeSpec

public static String normalizeTreeSpec(String t)


Copyright © 2011. All Rights Reserved.