Class AntlrCodeQualityHelper


  • public class AntlrCodeQualityHelper
    extends java.lang.Object
    • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • followsetPattern

        public static final java.util.regex.Pattern followsetPattern
      • dfaStringPattern

        public static final java.util.regex.Pattern dfaStringPattern
      • dfaUnpackPattern

        public static final java.util.regex.Pattern dfaUnpackPattern
    • Constructor Detail

      • AntlrCodeQualityHelper

        public AntlrCodeQualityHelper()
    • 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.