Package org.dojotoolkit.shrinksafe
Class TokenMapper
- java.lang.Object
-
- org.dojotoolkit.shrinksafe.TokenMapper
-
public class TokenMapper extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TokenMapper(org.mozilla.javascript.ast.ScriptNode parseTree)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
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 stringoffset
- position within the encoded sourceasQuotedString
- boolean value indicating a quoted stringsb
- String buffer referenceprevToken
- Previous token in encoded sourceinArgsList
- boolean value indicating position inside arguments listcurrentLevel
- embeded function levelparseTree
- 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()
-
-