public class AntlrCodeQualityHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
dfaStringPattern |
static java.util.regex.Pattern |
dfaUnpackPattern |
static java.util.regex.Pattern |
followsetPattern |
Constructor and Description |
---|
AntlrCodeQualityHelper() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
removeDuplicateBitsets(java.lang.String javaContent,
AntlrOptions options)
Remove duplicate bitset declarations to reduce the size of the static initializer but keep the bitsets
that match the given pattern with a normalized name.
|
java.lang.String |
removeDuplicateDFAs(java.lang.String content,
AntlrOptions options)
Remove duplicate bitset declarations to reduce the size of the static initializer but keep the bitsets
that match the given pattern with a normalized name.
|
static java.lang.String |
removeDuplicateFields(java.lang.String content,
java.util.regex.Pattern lookupPattern,
int origNameGroup,
int initGroup,
java.lang.String rawClientPattern,
java.lang.String synName,
java.lang.String keepPattern,
java.lang.String keptName) |
protected java.lang.String |
stripAllComments(java.lang.String fileContent) |
protected java.lang.String |
stripMachineDependentPaths(java.lang.String fileContent) |
java.lang.String |
stripUnnecessaryComments(java.lang.String javaContent,
AntlrOptions options)
Remove all unnecessary comments from a lexer or parser file
|
public static final java.util.regex.Pattern followsetPattern
public static final java.util.regex.Pattern dfaStringPattern
public static final java.util.regex.Pattern dfaUnpackPattern
protected java.lang.String stripMachineDependentPaths(java.lang.String fileContent)
protected java.lang.String stripAllComments(java.lang.String fileContent)
public java.lang.String stripUnnecessaryComments(java.lang.String javaContent, AntlrOptions options)
public java.lang.String removeDuplicateBitsets(java.lang.String javaContent, AntlrOptions options)
public static java.lang.String removeDuplicateFields(java.lang.String content, java.util.regex.Pattern lookupPattern, int origNameGroup, int initGroup, java.lang.String rawClientPattern, java.lang.String synName, java.lang.String keepPattern, java.lang.String keptName)
lookupPattern
- the regular expression pattern that we try to findpublic java.lang.String removeDuplicateDFAs(java.lang.String content, AntlrOptions options)