diff options
author | Ben Gruver <bgruv@google.com> | 2014-03-12 22:35:01 -0700 |
---|---|---|
committer | Ben Gruver <bgruv@google.com> | 2015-01-21 09:32:00 -0800 |
commit | bbc11c79e554e7fb569b32843a2e973f87b8fe58 (patch) | |
tree | 8bde86eb22810b6090d724ccba624b1408ccf15e /smali | |
parent | a669ed1f9dfdf09d9251495103f7399c7fb5bfdd (diff) | |
download | smali-bbc11c79e554e7fb569b32843a2e973f87b8fe58.tar.gz |
Add lexer implementation based on existing smali lexer
Diffstat (limited to 'smali')
-rw-r--r-- | smali/src/main/jflex/smaliLexer.flex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/smali/src/main/jflex/smaliLexer.flex b/smali/src/main/jflex/smaliLexer.flex index df571e66..8b7c66e3 100644 --- a/smali/src/main/jflex/smaliLexer.flex +++ b/smali/src/main/jflex/smaliLexer.flex @@ -172,6 +172,20 @@ import static org.jf.smali.smaliParser.*; public String getErrorHeader(InvalidToken token) { return getSourceName()+"["+ token.getLine()+","+token.getCharPositionInLine()+"]"; } + + public void reset(CharSequence charSequence, int start, int end, int initialState) { + zzReader = BlankReader.INSTANCE; + zzBuffer = new char[charSequence.length()]; + for (int i=0; i<charSequence.length(); i++) { + zzBuffer[i] = charSequence.charAt(i); + } + + yychar = zzCurrentPos = zzMarkedPos = zzStartRead = start; + zzEndRead = end; + zzAtBOL = true; + zzAtEOF = false; + yybegin(initialState); + } %} HexPrefix = 0 [xX] |