Class AntlrCodeQualityHelper
- java.lang.Object
-
- org.eclipse.xtext.xtext.generator.parser.antlr.splitting.AntlrCodeQualityHelper
-
public class AntlrCodeQualityHelper extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.regex.Pattern
dfaStringPattern
static java.util.regex.Pattern
dfaUnpackPattern
static java.util.regex.Pattern
followsetPattern
-
Constructor Summary
Constructors Constructor Description AntlrCodeQualityHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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
-
-
-
Method Detail
-
stripMachineDependentPaths
protected java.lang.String stripMachineDependentPaths(java.lang.String fileContent)
-
stripAllComments
protected java.lang.String stripAllComments(java.lang.String fileContent)
-
stripUnnecessaryComments
public java.lang.String stripUnnecessaryComments(java.lang.String javaContent, AntlrOptions options)
Remove all unnecessary comments from a lexer or parser file
-
removeDuplicateBitsets
public 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.
-
removeDuplicateFields
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)
- Parameters:
lookupPattern
- the regular expression pattern that we try to find
-
removeDuplicateDFAs
public 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.
-
-