Class TokenMapper


  • public class TokenMapper
    extends java.lang.Object
    • Constructor Detail

      • TokenMapper

        public TokenMapper​(org.mozilla.javascript.ast.ScriptNode parseTree)
    • Method Detail

      • incrementFunctionNumber

        public void incrementFunctionNumber()
      • sourceCompress

        public int sourceCompress​(java.lang.String encodedSource,
                                  int offset,
                                  boolean asQuotedString,
                                  java.lang.StringBuffer sb,
                                  int prevToken,
                                  boolean inArgsList,
                                  int currentLevel,
                                  ReplacedTokens replacedTokens)
        Compress the script

        Parameters:
        encodedSource - encoded source string
        offset - position within the encoded source
        asQuotedString - boolean value indicating a quoted string
        sb - String buffer reference
        prevToken - Previous token in encoded source
        inArgsList - boolean value indicating position inside arguments list
        currentLevel - embeded function level
        parseTree - Mapping of each function node and corresponding parameters & variables names
        Returns:
        compressed script
      • enterNestingLevel

        public void enterNestingLevel​(int braceNesting)
      • leaveNestingLevel

        public boolean leaveNestingLevel​(int braceNesting)
      • getCurrentTokens

        public java.util.Map getCurrentTokens()
      • getDebugData

        public DebugData getDebugData​(java.lang.Integer functionPosition)
      • reset

        public void reset()