org.dojotoolkit.shrinksafe
Class TokenMapper

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

public class TokenMapper
extends java.lang.Object


Constructor Summary
TokenMapper(org.mozilla.javascript.ScriptOrFnNode parseTree)
           
 
Method Summary
 void enterNestingLevel(int braceNesting)
           
 java.util.Map getCurrentTokens()
           
 DebugData getDebugData(java.lang.Integer functionPosition)
           
 void incrementFunctionNumber()
           
 boolean leaveNestingLevel(int braceNesting)
           
 void reset()
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenMapper

public TokenMapper(org.mozilla.javascript.ScriptOrFnNode 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()


Copyright © 2011 SOFTEC sa. All Rights Reserved.