Class TokenMapper

java.lang.Object
org.dojotoolkit.shrinksafe.TokenMapper

public class TokenMapper extends Object
  • Constructor Details

    • TokenMapper

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

    • incrementFunctionNumber

      public void incrementFunctionNumber()
    • sourceCompress

      public int sourceCompress(String encodedSource, int offset, boolean asQuotedString, 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 Map getCurrentTokens()
    • getDebugData

      public DebugData getDebugData(Integer functionPosition)
    • reset

      public void reset()