Package org.dojotoolkit.shrinksafe
Class TokenMapper
java.lang.Object
org.dojotoolkit.shrinksafe.TokenMapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
enterNestingLevel
(int braceNesting) getDebugData
(Integer functionPosition) void
boolean
leaveNestingLevel
(int braceNesting) void
reset()
int
sourceCompress
(String encodedSource, int offset, boolean asQuotedString, StringBuffer sb, int prevToken, boolean inArgsList, int currentLevel, ReplacedTokens replacedTokens) Compress the script
-
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 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
-
getDebugData
-
reset
public void reset()
-