Support the -XdbgST and -XdbgSTWait options in TestPerformance

This commit is contained in:
Sam Harwell 2013-01-01 21:38:41 -06:00
parent 26d267ca38
commit c462547ff3
1 changed files with 16 additions and 0 deletions

View File

@ -128,6 +128,16 @@ public class TestPerformance extends BaseTest {
* DOT (GraphViz) file.
*/
private static final boolean EXPORT_ATN_GRAPHS = true;
/**
* {@code true} to specify the {@code -XdbgST} option when generating the
* grammar.
*/
private static final boolean DEBUG_TEMPLATES = true;
/**
* {@code true} to specify the {@code -XdbgSTWait} option when generating the
* grammar.
*/
private static final boolean DEBUG_TEMPLATES_WAIT = DEBUG_TEMPLATES;
/**
* {@code true} to delete temporary (generated and compiled) files when the
* test completes.
@ -573,6 +583,12 @@ public class TestPerformance extends BaseTest {
if (EXPORT_ATN_GRAPHS) {
extraOptions.add("-atn");
}
if (DEBUG_TEMPLATES) {
extraOptions.add("-XdbgST");
if (DEBUG_TEMPLATES_WAIT) {
extraOptions.add("-XdbgSTWait");
}
}
extraOptions.add("-visitor");
String[] extraOptionsArray = extraOptions.toArray(new String[extraOptions.size()]);
boolean success = rawGenerateAndBuildRecognizer(grammarFileName, body, "JavaParser", "JavaLexer", true, extraOptionsArray);